[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: alsa and jack latency



In order to lower the latency you first need to be able to measure
it... I have been able to do some latency testing using the ALSA latencytest
tools on my powerbook using 2.6.11 and some patches:

[1] A patch for the genrtc kernel driver
    http://www.mph.eclipse.co.uk/pub/linux/patches/2.6.11/genrtc.c.patch
The ioctls added can be tested using
    http://www.mph.eclipse.co.uk/pub/linux/patches/rtctest2.c
It is important to run to this to find out the accuracy of the clock on
your platform. On PPC 1024Hz is probably the highest accurate frequency.
Any machine using genrtc should be able to use these ioctls, not just PPC.

[2] A patch against latencytest.0.5.5
    http://www.mph.eclipse.co.uk/pub/linux/patches/latencytest.patch
With USE_GENERIC_TIMER selected in the makefile, this should work on
any platform. For PPC I'd recommend setting USE_PPC_VEA_TIMEBASE in the
Makefile.

Results: Initial testing showed serious latency from the X11 tests, but
the rest looks okay.
[3] http://www.mph.eclipse.co.uk/pub/linux/latency/test3/index.html
With a (questionable) DRM patch for the Radeon driver the results become:
[4] http://www.mph.eclipse.co.uk/pub/linux/latency/test7/index.html
Jack shows 11.6msec latency with -r44100 -p128 -n4.

I'm working with Takashi to get [2] included. I'm not convinced [1] is
needed/usefull for inclusion in the default kernel, unless I hear otherwise.

Martin

On Sat, May 14, 2005 at 09:56:40PM +0100, Paul Brossier wrote:
> Hi all,
> 
> Trying to reduce the latency of jack on my ibook G4, i realised i can go
> down to 8.7ms using the oss mode, which is really good. But alsa won't
> accept running with less than 22ms and click on most X request:
> 
> $ jackd -R -doss -r44100 -p128 -n3 -w16
> works perfectly, 128*3/44100=8.7ms latency, hardly any xrun on heavy load
> 
> $ jackd -R -doss -r44100 -p256 -n2 -w16
> works fine, 11.6ms latency
> 
> $ jackd -R -dalsa -r44100 -p128 -n3 -S
> runs but no clients can connect
> 
> $ jackd -R -dalsa -r44100 -p256 -n2 -S
> fails saying ...
> ALSA: cannot set number of periods to 2 for capture
> ALSA: cannot configure capture channel
> 
> $ jackd -R -dalsa -r44100 -p256 -n4 -S
> would run with 23.2ms latency, but xruns on most X queries
> 
> It looks to me that this is related to the pmac driver. I have similar
> problems with snd-usb-audio and an edirol usb, which will only let jack
> run in oss mode. 
> 
> I wonder what prevents the pmac module to do so while the oss emulation
> layer does it very well. I am running 2.6.12-rc4, but had this problem
> with earlier 2.6 kernels. Any thoughts?
> 
> Many thanks, Paul



Reply to: