Rockbox Development > Starting Development and Compiling

Adding time delay to left channel on sound output

<< < (3/4) > >>

s3t:
Please please please, guys, help me out with this - just a name of file i should look into.
The last time i tried to investigate the data flow, it turned out there is DMA thing, which prevented me from inserting the delay near the codec driver (the CPU feeds the codec using it's internal routines for DMA managing?)

Well, another option is to go to EQ section, and check out how the IIR filters are applied. All in all there is 100% chance of getting direct access to data stream.



UPD: dsp.c is the file, and int dsp_process(...) is the process.
t2[0..1] have both channels.
and now... i need to create global array for 64 samples, hooray!

s3t:
And, the end of story: mission accomplished, i've got the delay.

It was really easy after i've found the dsp.c.
Made circulating "log" buffer of 128 samples in int32_t array, and some "if" statement for calculating the playback position.

I'm unable to make patch/contribute, as i believe my source already violated a couple of rules, i've bricked the "crossfeed" function, i don't have settings page for the delay (i use crossfeed's instead), and... my current source is already modified for SW volume.

Recording Guy:
Well done!  ;D

s3t:
Looks like my ideas gone wild.
I want to try digital room correction in there, down to some 500-1000hz range (keeping FIR filter sequence short).
n^2 multiplifications, where n=FIR length.
n=Fs/Fo
Seems a lot of multiplifications there...
For Fo=500:
Fs:   44100
Fo:   500
Taps:   88.2
Multiplifications:   7779.24

1000hz
Fs:   44100
Fo:   1000
Taps:   44.1
Multiplifications:   1944.81

Going over >1kHz doesn't makes sense...
Well, probably i should leave the idea out.
Or... maybe... I'll throw a "while" loop in there, that will do some multiplication just to check the performance.


Probably won't work, as i need ~2000 multiplications per 44100 cycle. It translates into minimum of 44100 *2000 multiplications per second = minimum 88mhz as long as single multiplication takes 1 clock cycle.


Another idea... there is both TosLink and analog outputs on the player. I have checked the CODEC datasheet and it doesn't support TosLink = therefore, the TosLink transmitter is connected to the CPU directly = it should have separate I2S bus, and be able to produce sounds different from the CODEC.
What i'm trying to say is i could get 4 separate channels out of iRiver! All i need to squeeze there is additional delay to make the subwoofer and front stage produce time-coherent waves at listening position... Wow!

fcporto:
hi st3 !
Great work!
I am not a developer, just a simple RockBox user. I was eagerly waiting for someone to develop this time delay tool! I too love to hear music in my car and imaging is always misplaced in an asymmetrical listening position like this (unless you own a McLaren F1...). Time delay is a very useful feature to correct this and it is only available in top head units or sound processors. Newer cars do not allow to change the stereo, so we are left with the (usually expensive) option of adding a digital sound processor. The idea of bringing it to RockBox is great, and I just wonder if it will be incorporated in future versions of this wonderful open source software (in my case, I'm using a 5th gen iPod).
Thanks !

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version