Trying to get rid of xruns.

Hello!
This is my first post here so first of all I would like to thank Ardour developers for such great software! Unfortunatly I have not found any “welcome” thread.

Ontopic: I’m using Zepto ZNote6214W (Core 2 Duo, 2 gb Ram, Intel HDA integrated audio) with Archlinux, Xfce4 and Jack. I tried different kernels with various jackd settings and obtained best results with archaudio provided kernel26rt. Surprisingly default arch stock kernel gave me better results than liquorix one. I managed to get no xruns with following test: Ardour with some preloaded wave files and armored 6-channel track, vlc playing blueray film routed to ardour’s armored track and GNU Octave creating 1900x1900 matrix filled with random numbers so I guess the config is good enough. Frames/Periods are set to 128 and Periods/Buffers to 6, Realitme, Monitor H/W and Monitor enabled. I have noticed that increasing the Periods/Buffers and lowering the Frames/Periods gives better performance than doing the opposite while keeping the Latency at the exact level. I’m wondering if there are any drawbacks of increasing number of Periods/Buffers?

I would like to test my setup thoroughly so if you could give me a piece of advice I would be grateful :slight_smile:

@karm: you do not need or want JACK’s Monitor or Monitor H/W options enabled.

Increasing Periods/Buffer makes it less likely that the software will miss a deadline. If you have only 2 periods/buffer, if you miss 1 period’s “boundary”, you will get an xrun. If you have 3 periods/buffer, you have to miss 2 of them before there is an xrun. Since missing the boundary deadlines is not very likely, and since probabilities multiply, this works quite well. However, 6 periods/buffer is a rather high number. If it works for you, though, then just use it.

Hey Paul! Thanks for your great work. It’s very motivating to keep trying on open-source with ppl like you working on it full time.

I’m a musician, and I’m studying music at college, but I’ve always wanted to work with computers. So I’m learning a lot lately.

I wanted you or someone to explain me what is that xrun thing and periods/buffer settings.

;D

@bacon: “xrun” is a term that emerged from developing ALSA as a way to describe both an “underrun” and/or an “overrun”. Audio hardware is constantly reading/writing from/to a circular buffer of some size. Its the job of the computer (both the hardware and software) to keep the playback buffer filled with new data, on time, and to keep emptying the capture buffer (e.g. to write it to disk), on time.

If the computer doesn’t keep up with the playback buffer, the situation is termed an “underrun”, and the audio device will repeat the playback of some material already in the buffer that should have been replaced with new stuff. If it doesn’t keep up with the capture buffer, an “overrun” occurs where data that hasn’t yet been processed by the recording software is overwritten with new incoming data.

Since JACK generally runs in full-duplex mode (simultaneous playback & capture), a term is needed to describe either or both of these situations generically - we use “xrun”.

Someone else will have to take care of “periods/buffer”.

@bacon: I’m no expert in this field but I think this could give you a hand: http://rivendell.tryphon.org/wiki/Jack_frame,_period,_buffer_info

@paul: thanks for your reply, I think I understand it better know. Unfortunatly previously described config didn’t work too well.

Thanks, paul! That was of great help!

Thank you too, karm. I will take a look.

I also wanted to understand about what the kernel modules like snd_seq and so on has to do with jack. I’m having some trouble with qjackctl (again). Take a look:

16:33:40.861 Patchbay deactivated. 16:33:40.865 Statistics reset. 16:33:40.866 Could not open ALSA sequencer as a client. ALSA MIDI patchbay will be not available. ALSA lib seq_hw.c:457:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory 16:33:46.140 D-BUS: Service is available (org.jackaudio.service aka jackdbus). 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 16:35:05.940 Startup script... 16:35:05.941 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:35:06.344 Startup script terminated with exit status=32512. 16:35:06.498 D-BUS: JACK server is starting... 16:35:06.501 D-BUS: JACK server was started (org.jackaudio.service aka jackdbus). Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: driver "alsa" selected Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Saving settings to "/home/bacon/.config/jack/conf.xml" ... Sun May 1 16:35:06 2011: Starting jack server... Sun May 1 16:35:06 2011: JACK server starting in realtime mode with priority 70 Sun May 1 16:35:06 2011: Acquired audio card Audio5 Sun May 1 16:35:06 2011: creating alsa driver ... hw:Pro|hw:Pro|128|3|48000|0|0|nomon|swmeter|-|32bit Sun May 1 16:35:06 2011: e[1me[31mERROR: ALSA: Cannot open PCM device alsa_pcm for capture. Falling back to playback-only modee[0m Sun May 1 16:35:06 2011: configuring for 48000Hz, period = 128 frames (2.7 ms), buffer = 3 periods Sun May 1 16:35:06 2011: ALSA: final selected sample format for playback: 16bit little-endian Sun May 1 16:35:06 2011: ALSA: use 3 periods for playback Sun May 1 16:35:06 2011: e[1me[31mERROR: failed to open alsa seqe[0m Sun May 1 16:35:06 2011: e[1me[31mERROR: ALSA: cannot attach MIDI: -2e[0m Sun May 1 16:35:06 2011: graph reorder: new port 'system:playback_1' Sun May 1 16:35:06 2011: New client 'system' with PID 0 Sun May 1 16:35:06 2011: graph reorder: new port 'system:playback_2' 16:35:08.723 JACK connection change. 16:35:08.724 Server configuration saved to "/home/bacon/.jackdrc". 16:35:08.724 Statistics reset. 16:35:08.728 Client activated. 16:35:08.748 JACK connection graph change. Sun May 1 16:35:08 2011: New client 'qjackctl' with PID 18974

=/