bsp
Very Active Member
- Joined
- Dec 2, 2006
- Messages
- 314
Just want to swing by for a second to tell you how happy I am with my Pandora right now
I spent the whole day figuring out how to configure it for realtime MIDI and audio.
This morning it was a crackle / glitch-fest..
..now I have a stable, zero underrun, 1.4ms (!) low latency audio stream running, along with 9 MIDI device threads and a very CPU/GPU intensive OpenGL ES 2 GUI (runs with least priority).
To make this happen, I had to patch the OMAP MCBSP audio driver since it always reported the maximum buffer size as the minimum (wtf!).
With the original kernel, you always end up with at least a 256 frame ALSA period size.
With the patches/hacks, you can use e.g. 64 frame period sizes.
This kind of low latency is needed since the latencies add up if you process audio. 2*5.8=11.6ms was just too high and felt sluggish.
The drawback with the patches is that it breaks the sound of some emulators (e.g. EmuExAlpha), that's why I now keep two kernels around, one for gaming, and the other one for audio.
Last but not least I had to use a utility called "set_rlimits" to allow my user process to use the SCHED_FIFO scheduling policy and rather high (40) realtime priorities in its threads.
I've attached the updated kernel sources and the set_rlimits ARM binary (+example config file), in case anyone is interested.
alsa_async_super_lowlatency-23Aug2014.tar.gz
I spent the whole day figuring out how to configure it for realtime MIDI and audio.
This morning it was a crackle / glitch-fest..
..now I have a stable, zero underrun, 1.4ms (!) low latency audio stream running, along with 9 MIDI device threads and a very CPU/GPU intensive OpenGL ES 2 GUI (runs with least priority).
To make this happen, I had to patch the OMAP MCBSP audio driver since it always reported the maximum buffer size as the minimum (wtf!).
With the original kernel, you always end up with at least a 256 frame ALSA period size.
With the patches/hacks, you can use e.g. 64 frame period sizes.
This kind of low latency is needed since the latencies add up if you process audio. 2*5.8=11.6ms was just too high and felt sluggish.
The drawback with the patches is that it breaks the sound of some emulators (e.g. EmuExAlpha), that's why I now keep two kernels around, one for gaming, and the other one for audio.
Last but not least I had to use a utility called "set_rlimits" to allow my user process to use the SCHED_FIFO scheduling policy and rather high (40) realtime priorities in its threads.
I've attached the updated kernel sources and the set_rlimits ARM binary (+example config file), in case anyone is interested.
alsa_async_super_lowlatency-23Aug2014.tar.gz