Lowest possible latency
Moderator: flatmax
Lowest possible latency
I've tried finding the latency of the WM8731 codec, but there's no specific information on this in the datasheet. I suspect it to be low though, on the order of < 0.5 ms.
I've bought the soundcard in order to make a system with as low a latency as can be achieved. I suspect a 32 sample ALSA period size (~ 0.7 ms @ 48Khz) should be achievable on a R Pi 3 ?
Any feelings/thoughts on this ?
I've bought the soundcard in order to make a system with as low a latency as can be achieved. I suspect a 32 sample ALSA period size (~ 0.7 ms @ 48Khz) should be achievable on a R Pi 3 ?
Any feelings/thoughts on this ?
Re: Lowest possible latency
To clarify, I'm seeking to minimize the latency of the audiopath:
ADC -> ALSA -> DAC
ADC -> ALSA -> DAC
Re: Lowest possible latency
I have run the ALSA utility latency to find it is of the order of 500 us (half a microsecond). This was found using very low CPU load.
Check here for example :
https://www.kickstarter.com/projects/12 ... ts/1606640
I would start with 2 periods of 1ms and see if that works nicely. If so, then reduce the sample count accordingly.
Can you post your findings back here please ?
thanks
Matt
Check here for example :
https://www.kickstarter.com/projects/12 ... ts/1606640
I would start with 2 periods of 1ms and see if that works nicely. If so, then reduce the sample count accordingly.
Can you post your findings back here please ?
thanks
Matt
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector
Re: Lowest possible latency
Thanks! Will do so.
Re: Lowest possible latency
Ok, I've setup my Pi with the stereo board (and have been streaming Spotify via Mopidy, sounds really good! )
Anyway, built the ALSA latency test and got following results:
./latency -r 96000 -f S32_LE -p
Maximum read: 56 frames
Maximum read latency: 583.333us, 0.583333ms (1714.2857Hz)
Playback time = 131878.455664, Record time = 131878.455662, diff = 2
./latency -r 48000 -f S32_LE -p
Maximum read: 48 frames
Maximum read latency: 1000.000us, 1.000000ms (1000.0000Hz)
Playback time = 132038.521231, Record time = 132038.521228, diff = 3
Not bad at all. The application I have in mind will do a lot of FFT convolution, so that's an aspect also, to have enough time to compute everything during a callback period.
Anyway, built the ALSA latency test and got following results:
./latency -r 96000 -f S32_LE -p
Maximum read: 56 frames
Maximum read latency: 583.333us, 0.583333ms (1714.2857Hz)
Playback time = 131878.455664, Record time = 131878.455662, diff = 2
./latency -r 48000 -f S32_LE -p
Maximum read: 48 frames
Maximum read latency: 1000.000us, 1.000000ms (1000.0000Hz)
Playback time = 132038.521231, Record time = 132038.521228, diff = 3
Not bad at all. The application I have in mind will do a lot of FFT convolution, so that's an aspect also, to have enough time to compute everything during a callback period.
Re: Lowest possible latency
OK - sounds like you have a real time application on your hands.
How many Fourier bins are you targeting ?
I find that the more Fourier bins I use, the lower the latency requirement.
Matt
How many Fourier bins are you targeting ?
I find that the more Fourier bins I use, the lower the latency requirement.
Matt
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector
Re: Lowest possible latency
Depends, I'm doing FIR filters in the frequency domain, so it can be 4 instances with lengths of up to 0.5 s (24000 taps @48K). I'm planning on a partitioned implementation to remove the latency due to FFTs. Maybe dual-rate to lower the lengths of the IRs. I'll see how it goes. Also, it is possible to use the GPU for the FFTs, which should heighten performance significantly.
Re: Lowest possible latency
Oh be interested to hear if you get GPU computation for DFTs going !
Sounds like you have nice long filters. Are you running FIR eqs or a different application ?
You writing the software yourself ?
Matt
Sounds like you have nice long filters. Are you running FIR eqs or a different application ?
You writing the software yourself ?
Matt
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector
Re: Lowest possible latency
It is for a room correction application, so 0.3 to 0.5 s length of FIRs usually are adequate, and yes, I'll be writing the software myself. Right now I'm trying to determine where to apply the processing. Since I want to do both in/out low latency and be able to stream audio (like Spotify), I think an ALSA PCM plugin would be the appropriate place.
Re: Lowest possible latency
Room correction - nice one.
I agree, an ALSA plugin would probably be the best. That way you can set it to be default and not even have to think about it.
I have an ALSA Plugin class as part of gtkiostream. An example is here :
http://gtkiostream.flatmax.org/ALSAExte ... ample.html
You can also interface Eigen matrices to that, which come with an fftw inferface. You may find that useful.
Are you planning to use C/C++ ?
Matt
I agree, an ALSA plugin would probably be the best. That way you can set it to be default and not even have to think about it.
I have an ALSA Plugin class as part of gtkiostream. An example is here :
http://gtkiostream.flatmax.org/ALSAExte ... ample.html
You can also interface Eigen matrices to that, which come with an fftw inferface. You may find that useful.
Are you planning to use C/C++ ?
Matt
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector
Who is online
Users browsing this forum: No registered users and 4 guests