[linux-audio-user] Advice needed re: latency tuning/optimization, esp. video

Chris Metzler cmetzler at speakeasy.net
Mon Feb 16 13:24:46 EST 2004


Hi.  I'm looking for some advice on how to deal with latency introduced
by graphics activity.

My setup:
AMD Athlon XP 2000+
ASus A7V333 Raid+ Motherboard
1 GB Corsair CAS2 PC2700 RAM
Creative SBLive 5.1 sound card
Matrox Millenium G550 video card, AGP4x, 32MB RAM
1 WD800JB IDE disk (80 GB, 8 MB cache); 4 WD1200JB IDE disks (120 GB,
	8 MB cache each)
Kernel 2.4.23 + preempt + lowlatency, XFree86 4.2.1

The plan for the four 120GB disks right now is to use pairs as RAID0
(striped) 240 GB disks, for speed; then to have one pair mirror the
other (RAID1), for safety.  I thought about doing RAID5 with all four
but decided against.  But I haven't set that up yet, and right now
everything is living on the 80GB disk.

The sound card shares IRQ 10 with the USB2 bus; but I have no USB
devices of any sort.  On IRQ 9 are two of my four IDE channels.

As noted above, I patched my Debian 2.4.23 kernel with Robert Love's
preempt patch and Andrew Morton's low-latency patch.  I then went
looking for test software to see what my latency numbers looked
like.  I found http://www.gardena.net/benno/linux/audio/
and the low-latency test software there (from 2000).  I don't
know if that's the best software to use, but that's what I found.
It doesn't have much documentation, so I didn't really know what
were the best number and size of audio fragments to use in the
tests; so I just used the same that was written in the docs (three
fragments, each 256 bytes).  xscreensaver was disabled for the
test.

The test results were rather interesting.  My latency numbers looked
really good for procfs stress, and disk read/write/copy stress.  In
each case except for disk writes, the max latency only 1.6 ms, only
0.15 ms above the fragment latency of 1.45ms (which is found,
presumably, by taking 44.1kHz * 2 channels * 2 bytes and dividing
it into 256 bytes/fragment).  For disk writes, the maximum latency
got as high as 2.2 ms because of spikes on just two fragments.
Anyway, that all seems fairly good to me, based on my very limited
understanding of all this.

But the X11 stress test was a different matter.  There, my max latency
was 18.4ms, with over 1500 overruns.  While 96.25% of the reps came in
within 1ms of the fragment latency, and 98% came in within 2ms, there
were still enough big excursions to cause audible drop-outs/popping
in the output.  So it seems that while my latency numbers are generally
good, video stuff can cause significant problems.  This matches my
experience, which is that I see significant xruns in JACK (50-70ms)
if I minimize or open a window, or move a window, etc.

This result surprises me.  I'm using a video card that's supposedly
very very good at 2D stuff -- indeed, it's the video card that RME
recommended as recently as last year as their card of choice for
audio workstations.  It's definitely open at AGP 4x (XF86 wants to
open it at 1x unless you explicitly say in the config file that you
want 4x).  32 MB isn't a huge amount of video RAM, but I would think
would be fine for 2D stuff.

So what gives?  Does anyone have advice on something to try?  Is
there something here I'm missing (likely, since I'm really really
new to this stuff)?  Are there tweaks to X11 I don't know about?
Other than minimizing use of the GUI (which I'd be trying to do
while using audio apps anyway), how can I bring the sensitivity to
video stuff down?  Other than kernel patching, watching relative
IRQ priorities, and killing unneeded apps, are there any other
tricks I might wanna consider?

Thanks for any advice.

-c

-- 
Chris Metzler			cmetzler at speakeasy.snip-me.net
		(remove "snip-me." to email)

"As a child I understood how to give; I have forgotten this grace since I
have become civilized." - Chief Luther Standing Bear
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://music.columbia.edu/pipermail/linux-audio-user/attachments/20040216/86252d67/attachment.bin


More information about the linux-audio-user mailing list