A question about XRUNs (Buffer underrun)

2 replies [Last post]
daemonic_myst
User offline. Last seen 47 weeks 1 day ago. Offline
Joined: 2008-04-25
Posts:

Hello!

I have some issues I'd like to understand. My hardware is firewire Edirol FA-66, AMD x64 6400, 4 GB RAM. OS is Linux Debian (unstable) with soft RAID1, kernel 2.6.24.4 (with RT patch applied).
I start JACK in the following way:

jackd -R -P70 -dfreebob -dhw:0 -r48000 -p512 -n3 -D

(after that I remove all cpufreq modules, and run the following script to set processes' priorities):
---------------------------------------------------
#!/bin/sh

chrt -f -p 99 `pgrep softirq-timer/0`
chrt -f -p 99 `pgrep softirq-timer/1`
for i in `pgrep softirq-hrtimer`; do
chrt -f -p 99 $i
done
---------------------------------------------------

Next I start QSynth (with two engines), and ZynAddSubFX - when I load Zyn's saved parameters from its config file I almost always get buffer underrun, and JACK crashes (or just stops working):

---------------------------------------------------
myst@daemon:~$ subgraph starting at Qsynth2 timed out (subgraph_wait_fd=18, status = 0, state = Running)
LibFreeBoB ERR: SLAVE XMT : Buffer underrun! 512 (0 / 224) (0 / 0 )
LibFreeBoB ERR: Xrun on connection 1
---------------------------------------------------

Next I can't start JACK again until I reset the whole 1394 bus by unloading/loading its modules, or unplugging/plugging the sound unit.
When I do it, I can start JACK, and QSynth and ZynAddSubFX in the same way again - then I don't get any Xrun, and can work with my sound using Ardour, Muse, and Hydrogen.
So I get this Xrun, and JACK crash only for the first startup of software synths.

Do you have any idea what is the reason for this?

Another interesting thing:
When I run JACK with -p128 parameter, and QSynth only with one engine, it works quite OK, but running only ZynAddSubFX instead makes Xrun and JACK crash in several seconds, or in a minute.

So does JACK stability and the value of '-p' parameter depend on number of clients running and how well they are coded?
The '-p256' param gives me quite good stability, unfortunately until I start using ZynAddSubFX.
With several software synths (including ZynAddSubFX) I must use at least '-p512' to work safely enough (with one restart any way as mentioned in the beginning).

Can anyone explain this to me why it behaves like this? My CPU load is not high, up to 30% all the time.
And if you use Edirol FA-66 does your experience look similar to mine?

Cheers!

daemonic_myst
User offline. Last seen 47 weeks 1 day ago. Offline
Joined: 2008-04-25
Posts:

I'll answer to myself :)
Maybe it'll help somebody else...

The solution seems to be setting the timeout parameter to some higher value
(it's good to read manuals after all ;) )

Yesterday I started jack with additional '-t2000' parameter, and was able to work stable with ZynAddSubFX, QSynth (two engines), Muse, Hydrogen, vkeybd, and Ardour for several hours.

I don't know if it solves the problem, but at least makes the situation much better in my case.

daemonic_myst
User offline. Last seen 47 weeks 1 day ago. Offline
Joined: 2008-04-25
Posts:

P.S.
Forgot to mention that jack was running with the 128 buffer length instead of 512. So I was very satisfied.