Trying to get rid of xruns.

Just to let you guys know, I’m pretty new in this audio/linux thing. I tried to go deep into searching about it before posting, but i felt like each person with xruns problems had a different thing going on on their machine, so I guess is time to ask directly for help. I was quite happy I was able to install a RT kernel and patch it for running my M-AUDIO FAST TRACK PRO at 24bits. If im not posting the right --infos you guys need for helping out, just tell me.

I’m using Gentoo running on a 2.6.33-rt kernel (got from pro-audio overlay) and patched as joegiampaoli.com/blog/?p=462 explains (only with a few gentooish mods, of course, and that may be part of the problem!). The point is, im getting xruns, and as I have read, thats not a good thing.

My qjackctl config (and some of the messages it shows): http://postimage.org/image/2ulons5s4/

As Joe Giampaoli recommends, my etc/security/limits.conf is as follows. He stated that the ‘nice’ thing wasn’t necessary:

@audio - rtprio 99 @audio - memlock unlimited

Ive got a Core 2 Duo @ 2.10GHz, 4GB RAM, so I believe my machine isn’t the problem.

Any thoughts?

So I assume 'ulimit -r ’ show ‘99’ then.

One obvious suspect in your picture is ZynAddSubFX which is NOT real-time safe (try yoshimi instead) though you seem to have xruns even before you’ve started it.

Also, you have Realtime set to Priority: (default). Try raising it to 70 or something.

Thanks for the quick reply, bro.

Yeah, my user is in the audio group, and I have even rebooted the computer after editing limits.conf, cuz it’s been a few days already.

Well, I might try that out, but still, there must be a way of setting it up without having to sacrifice good latency, right?

Anyone?

Is your user a member of the audio group? After you edit /etc/security/limits.conf you need to log out and log back in again in order to apply the changes. Other than that, try setting JACK’s frames/period to a higher value until you no longer get xruns (unfortunately, the tradeoff is higher latency).

Frames Period = 128 (256 if still many xruns)
Sample Rate = 48000 (can be 44100 but 48K might be better since it’s the native sample rate for this device)
Periods/Buffer = 3

Did you also install RTIRQ and set it up as I explained there…?

You can aslo try changing the output to 5,0 and see how that works.

Frames Period = 128 (256 if still many xruns) Sample Rate = 48000 (can be 44100 but 48K might be better since it's the native sample rate for this device) Periods/Buffer = 3 Did you also install RTIRQ and set it up as I explained there....? You can aslo try changing the output to 5,0 and see how that works.

Changing the output to 5,0 brought up much more xruns. =/
I did everything from the blog… except for some kernel configs. When you say:

POWER MANAGEMENT AND ACPI OPTIONS:

Enable ACPCI Support

Enable ACPI (Advanced Configuration and Power Interface) Support

Enable Power Management Timer Support

I cant find the ACPCI thing neither the Timer Support under POWER MANAGEMENT. Also, I’ve set most stuff under Soundcard as modules (suggested by a friend), and now I have maany modules being loaded at startup. I don’t know if thats okay tho. I’ll list them:

snd-hda-codec-intelhdmi
snd-hda-codec-via
snd-hda-codec
snd-hda-codec-nvhdmi
snd-hda-codec-cirrus
snd-hda-codec-ca0110
snd-hda-codec-analog
snd-hda-codec-idt
snd-hda-codec-si3054
snd-hda-codec-realtek
snd-hda-codec-cmedia
snd-hda-codec-atihdmi
snd-hda-codec-conexant
snd-hda-intel
snd-rawmidi
snd-hrtimer
snd-pcm
snd-hwdep
snd
snd-seq-dummy
snd-seq-device
snd-seq-midi
snd-seq-midi-event
snd-seq
snd-seq-oss
snd-timer
snd-mixer-oss
snd-pcm-oss
snd-page-alloc
snd-usb-audio
snd-usb-caiaq
snd-usb-lib
snd-usb-us122l
usb-usx2y (this one is failing to load, actually)
sound_firmware
soundcore
snd-soc-core
usblp
cdc-wdm
cdc-acm
wusbcore
whci-hcd
gspca_main
smsc95xx
i915
drm_kms_helper
scsi_wait_scan
cfbfillrect
cfbcopyarea
cfbimgblt
umc
whc-rc
whci
uwb

I wanted to allow kernel support for other soundcards, but are there any “useless” stuff being loaded?

So I assume 'ulimit -r ' show '99' then. One obvious suspect in your picture is ZynAddSubFX which is NOT real-time safe (try yoshimi instead) though you seem to have xruns even before you've started it. Also, you have Realtime set to Priority: (default). Try raising it to 70 or something.

Yeah, 99 it is, and thanks for the synth tip. Hm… I’m trying your suggestions as I make a reply, so just now, after I emerged yoshimi, jack can’t find my Fast Track Pro anymore. oO Maybe it has changed some alsa config? I dont know if /var/log/emerge.log is the right file to analyse?

1297865071: Started emerge on: Feb 16, 2011 12:04:31
1297865071: *** emerge yoshimi
1297865074: >>> emerge (1 of 3) media-sound/jack-audio-connection-kit-1.9.6 to /
1297865074: === (1 of 3) Cleaning (media-sound/jack-audio-connection-kit-1.9.6::/var/lib/layman/pro-audio/media-sound/jack-audio-connection-kit/jack-audio-connection-kit-1.9.6.ebuild)
1297865086: === (1 of 3) Compiling/Merging (media-sound/jack-audio-connection-kit-1.9.6::/var/lib/layman/pro-audio/media-sound/jack-audio-connection-kit/jack-audio-connection-kit-1.9.6.ebuild)
1297865145: === (1 of 3) Merging (media-sound/jack-audio-connection-kit-1.9.6::/var/lib/layman/pro-audio/media-sound/jack-audio-connection-kit/jack-audio-connection-kit-1.9.6.ebuild)
1297865147: >>> AUTOCLEAN: media-sound/jack-audio-connection-kit:0
1297865147: === Unmerging… (media-sound/jack-audio-connection-kit-0.109.2-r1)
1297865149: >>> unmerge success: media-sound/jack-audio-connection-kit-0.109.2-r1
1297865150: === (1 of 3) Post-Build Cleaning (media-sound/jack-audio-connection-kit-1.9.6::/var/lib/layman/pro-audio/media-sound/jack-audio-connection-kit/jack-audio-connection-kit-1.9.6.ebuild)
1297865150: ::: completed emerge (1 of 3) media-sound/jack-audio-connection-kit-1.9.6 to /
1297865150: >>> emerge (2 of 3) dev-libs/mini-xml-2.6 to /
1297865150: === (2 of 3) Cleaning (dev-libs/mini-xml-2.6::/usr/portage/dev-libs/mini-xml/mini-xml-2.6.ebuild)
1297865150: === (2 of 3) Compiling/Merging (dev-libs/mini-xml-2.6::/usr/portage/dev-libs/mini-xml/mini-xml-2.6.ebuild)
1297865161: === (2 of 3) Merging (dev-libs/mini-xml-2.6::/usr/portage/dev-libs/mini-xml/mini-xml-2.6.ebuild)
1297865163: >>> AUTOCLEAN: dev-libs/mini-xml:0
1297865163: === Unmerging… (dev-libs/mini-xml-2.2.1)
1297865164: >>> unmerge success: dev-libs/mini-xml-2.2.1
1297865165: === (2 of 3) Post-Build Cleaning (dev-libs/mini-xml-2.6::/usr/portage/dev-libs/mini-xml/mini-xml-2.6.ebuild)
1297865165: ::: completed emerge (2 of 3) dev-libs/mini-xml-2.6 to /
1297865165: >>> emerge (3 of 3) media-sound/yoshimi-0.058.1 to /
1297865165: === (3 of 3) Cleaning (media-sound/yoshimi-0.058.1::/var/lib/layman/pro-audio/media-sound/yoshimi/yoshimi-0.058.1.ebuild)
1297865166: === (3 of 3) Compiling/Merging (media-sound/yoshimi-0.058.1::/var/lib/layman/pro-audio/media-sound/yoshimi/yoshimi-0.058.1.ebuild)
1297865220: === (3 of 3) Merging (media-sound/yoshimi-0.058.1::/var/lib/layman/pro-audio/media-sound/yoshimi/yoshimi-0.058.1.ebuild)
1297865222: >>> AUTOCLEAN: media-sound/yoshimi:0
1297865223: === (3 of 3) Updating world file (media-sound/yoshimi-0.058.1)
1297865223: === (3 of 3) Post-Build Cleaning (media-sound/yoshimi-0.058.1::/var/lib/layman/pro-audio/media-sound/yoshimi/yoshimi-0.058.1.ebuild)
1297865223: ::: completed emerge (3 of 3) media-sound/yoshimi-0.058.1 to /
1297865223: *** Finished. Cleaning up…
1297865224: *** exiting successfully.
1297865224: *** terminating.

=/

Thanks again and in advance. =)

From your ebuild and the first screenshot it seems you’ve gone from jack1 v0.109.2 (veeeery old) to the new jack2 (1.9.6) so you might need to reconfigure things in qjackctl.
You should probably need to set the Interface to your USB card.

Actually, Alsa itself isnt showing Fast Track Pro as an option.

How is that possible?

Ok, i just made a sudo modprobe -r snd-usb-audio (with the FTP turned off) and both alsa and qjackctl sees it… but jack isnt starting… and is not explaining whats going on:

16:57:19.110 Startup script... 16:57:19.111 artsshell -q terminate Cannot connect to server socket err = No such file or directory Cannot connect to server socket jack server is not running or cannot be started sh: artsshell: command not found 16:57:19.515 Startup script terminated with exit status=32512. 16:57:19.515 JACK is starting... 16:57:19.515 jackd -P70 -p512 -t5000 -dalsa -r48000 -p128 -n3 -Xseq -D -Chw:5,1 -Phw:5,0 16:57:19.519 Could not start JACK. Sorry. 16:57:20.472 JACK was stopped successfully. 16:57:20.472 Post-shutdown script... 16:57:20.473 killall jackd jackd: no process found 16:57:20.883 Post-shutdown script terminated with exit status=256.

I’m doing a global update in my system… still, whats going on with jack? =/

Try running jackd in verbose mode from a terminal :

jackd -v -P70 -p512 -t5000 -dalsa -r48000 -p128 -n3 -Xseq -D -Chw:5,1 -Phw:5,0

It might be the “-t5000” since the manual states that “In realtime mode the client timeout must be smaller than the watchdog timeout (5000 msec)”. The default is 500.

Or maybe it’s the “-Chw:5,1 -Phw:5,0” that should be changed to something else now. And you probably should use the Interface dropdown in qjackctl instead of the Input/Output Device

Edit: what does ‘cat /proc/asound/cards’ say?

‘cat /proc/asound/cards’

0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xf8700000 irq 28
 5 [Pro             ]: USB-Audio - FastTrack Pro
                      M-Audio FastTrack Pro at usb-0000:00:1a.1-2, full speed

What is that interface dropdown located at? Sorry…

I tried to start it up from the shell, but didnt find the command… i tried jack and qjackctl as well… no good!

The Interface dropdown is on the Setup page of qjackctl, in the top-right of the Parameters section (set to hw:0 in this picture : http://qjackctl.sourceforge.net/image/qjackctlSetupForm1.png). You could try setting it to hw:5 and set the Input and Output device to default. And set Timeout to 500 msec.

You can also set Verbose message output on the bottom left of that menu.

Ok, now Jack isn’t starting!

20:14:28.216 Startup script...
20:14:28.216 artsshell -q terminate
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
sh: artsshell: command not found
20:14:28.620 Startup script terminated with exit status=32512.
20:14:28.620 JACK is starting...
20:14:28.621 jackd -v -P70 -p512 -dalsa -dhw:5 -r48000 -p128 -n3 -Xseq
20:14:28.624 Could not start JACK. Sorry.
20:14:34.913 JACK was stopped successfully.
20:14:34.913 Post-shutdown script...
20:14:34.913 killall jackd
jackd: no process found
20:14:35.323 Post-shutdown script terminated with exit status=256.

I’ve set the FTP through the Interface dropdown and changed the options u suggested. The messages dont seem to be very verboseish, do they?

Here’s a suggestion (#6) to use hw:Pro : http://ubuntuforums.org/showthread.php?t=1438696

What does

which jackd
jackd --version
and
ldd which jackd
say?
which: no jackd in (/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.4:/usr/games/bin)

The other commands werent found. hmm… i guess I dont have it installed? Isnt it what qjackctl is all about, but without the interface?

=/

(thanks for the help, bro!

QJackCtl is a GUI to JACK, and unless you have entered a specific path in the Server field of the QJackCtl setup there’s no wonder it can’t start JACK, as it doesn’t seem to exist (atleast not in your search path).

Try emerging JACK again. Perhaps it failed somehow the previous time.

I’ve reemerged jack, but it hasnt change anything…

 /usr/bin $ find -iname 'jack*'
./jack_rec
./jack_thru
./jack_wait
./jack_alias
./jack_disconnect
./jack_test
./jack
./jack_evmon
./jack_server_control
./jack_freewheel
./jack_samplerate
./jack_connect
./jackdbus
./jack_unload
./jack_showtime
./jack_metro
./jack_multiple_metro
./jack_cpu_load
./jack_transport
./jack_cpu
./jack_capture
./jack_monitor_client
./jack_zombie
./jack_delay
./jack_control
./jack_capture_gui2
./jack_load
./jack_bufsize
./jack-dssi-host
./jack_lsp
./jack_netsource
./jack_simple_client
./jack_midiseq
./jack_midisine

Maybe gentoo gives it a different name? Ive tried only ‘jack’ as the server path, and hasnt worked…

To quote keenblade on http://forums.gentoo.org/viewtopic-t-790360-start-75.html : You don’t have jackd but have jackdbus. It seems you emerged jack with dbus useflag.

So try putting jackdbus in the Server field in QJackCtl

Hmm, judging from that genoo thread it might not be that simple. The easiest route is probably to disable the dbus flag in the emerge (I don’t run gentoo so I don’t know how you’d do that) to get the normal jackd.

Awesome! I also had to check the “Use D-Bus Interface” at the Misc tab, and its working now.

No xruns so far! Yoshimi working well, recording with Ardour.

Thanks peder!