Xruns?

54 replies [Last post]
lotone
User offline. Last seen 3 years 15 weeks ago. Offline
Joined: 2009-01-30
Posts:

How do I get rid of xruns, everytime I try to record multi track drums I get xruns, what can I do to stop this from happening? Thank You All

Tone

peder
User offline. Last seen 49 weeks 4 days ago. Offline
Joined: 2007-05-08
Posts:

Search this forum for limits.conf

lotone
User offline. Last seen 3 years 15 weeks ago. Offline
Joined: 2009-01-30
Posts:

Im still a little lost

Tone

peder
User offline. Last seen 49 weeks 4 days ago. Offline
Joined: 2007-05-08
Posts:

Look at this post : http://ardour.org/node/2421
thorgals suggestion is a starter.
I.e. run jack realtime and increase frames/period until you don't get any xruns.

And when you post, try to explain your circumstances; I have no idea wheather you're getting xruns at 6ms latencies or 46 and if you're using an RME Hammerfall or a crappy Soundblaster...

lotone
User offline. Last seen 3 years 15 weeks ago. Offline
Joined: 2009-01-30
Posts:

I have an M-Audio delta 1010Lt I configured Jack the best I could but I still get Xruns, Frames/period 2048, Port maximum 128, and my latency is at 92.9, thanks again

lotone
User offline. Last seen 3 years 15 weeks ago. Offline
Joined: 2009-01-30
Posts:

oh yea hear ya go

lsmod | grep snd
snd_ice1712 80036 0
snd_ice17xx_ak4xxx 12416 1 snd_ice1712
snd_ak4xxx_adda 17792 2 snd_ice1712,snd_ice17xx_ak4xxx
snd_cs8427 17792 1 snd_ice1712
snd_ac97_codec 133080 1 snd_ice1712
snd_pcm_oss 52608 0
snd_mixer_oss 25088 1 snd_pcm_oss
snd_pcm 99208 3 snd_ice1712,snd_ac97_codec,snd_pcm_oss
snd_page_alloc 17680 1 snd_pcm
ac97_bus 10368 1 snd_ac97_codec
snd_i2c 14720 2 snd_ice1712,snd_cs8427
snd_mpu401_uart 16768 1 snd_ice1712
snd_seq_dummy 11524 0
snd_seq_oss 42368 0
snd_seq_midi 15872 0
snd_rawmidi 34176 2 snd_mpu401_uart,snd_seq_midi
snd_seq_midi_event 16768 2 snd_seq_oss,snd_seq_midi
snd_seq 67168 6 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event
snd_timer 34320 2 snd_pcm,snd_seq
snd_seq_device 16404 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq
snd 79432 14 snd_ice1712,snd_ak4xxx_adda,snd_cs8427,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_i2c,snd_mpu401_uart,snd_seq_oss,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
soundcore 16800 1 snd

allank
allank's picture
User offline. Last seen 6 weeks 3 days ago. Offline
Joined: 2006-12-07
Posts:

Wow lotone.

That's really poor performance from an M-Audio (I usually run at 64 periods 3 buffers, now sometimes at 128...)...
A few questions?

What's your CPU and RAM spec?
Are you running an rt kernel?
What frequency are you recording at (44100,48000,96000, anything above 48 is probably not necessary unless you are in a professional environment)?
Are you trying to run plugins while recording?
Have you turned off any unnecessary applications?
Are you running Gnome or KDE (If so maybe try to run a more lightwieght wm... I like fluxbox, But it requires configuration to be good to use, XFce seems to be a good compromise)
Do you have automount setup for CD's, usb drives e.t.c? (you may want to turn this off to minimise polling going on in the system?

cheers

Allan

lotone
User offline. Last seen 3 years 15 weeks ago. Offline
Joined: 2009-01-30
Posts:

Processor

* Type Intel Pentium 4 631 / 3.0 GHz
* 64-bit processor Yes
* Installed Qty 1.0
* Max processors supported 1.0
* Processor main features Hyper-Threading Technology

Cache Memory

* Type L2 cache
* Installed Size 2.0 MB
* Cache Per Processor 2 MB

Mainboard

* Chipset type ATI Radeon Xpress 1100
* Data bus speed 800.0 MHz

RAM

* Installed Size 512.0 MB -( Replaced with 2G of ram)
* Technology DDR2 SDRAM
* Memory specification compliance PC2-4200
* RAM form factor DIMM 240-pin
* RAM configuration features 1 x 512 MB

Storage Controller

* Type 1.0 x Serial ATA - Integrated

Storage Controller (2nd)

* Type 1 x IDE - Integrated

Storage

* Floppy drive type None
* Hard Drive 1.0 x 160.0 GB - Standard - Serial ATA-150 - 7200.0 rpm
* Hard Drive (2nd) None

Optical Storage

* Type DVD±RW (±R DL) / DVD-RAM - IDE
* CD / DVD read speed 40x (CD) / 16x (DVD)
* CD / DVD write speed 40x (CD) / 16x (DVD±R) / 4x (DVD-R DL) / 8x (DVD+R DL)
* CD / DVD rewrite speed 32x (CD) / 6x (DVD-RW) / 8x (DVD+RW) / 5x (DVD-RAM)
* Disc Labeling Technology LightScribe Technology

Optical Storage (2nd)

* Type None

Storage Removable

* Type None

Monitor

* Monitor Type None.

Multimedia Functionality

* TV tuner type None

Graphics Controller

* Type Integrated
* Graphics Processor / Vendor ATI Radeon Xpress 1100
* Video Memory Shared video memory (UMA)

Audio Output

* Type Sound card - Integrated
* Speaker(s) None

Input Device

* Type Mouse , Keyboard

Mouse

* Mouse features Scroll

Audio Input

* Type None

Telecom

* Modem Fax / modem
* Max transfer rate 56.0 Kbps

Networking

* Networking Network adapter - Integrated
* Data Link Protocol Ethernet , Fast Ethernet

Printer

* Type None

Expansion / Connectivity

* Expansion Bays Total (Free) 1.0 ( 1.0 ) x Internal - 3.5" x 1/3H , 2.0 ( 0.0 ) x Front accessible - 3.5" x 1/3H , 1.0 ( 1.0 ) x Front accessible - 5.25" x 1/2H
* Expansion Slots Total (Free) 1.0 ( 2.0 ) x Processor - DIMM 240-pin , 1.0 ( 1.0 ) x PCI - LGA775 Socket , 2.0 ( 1.0 ) x PCI Express x16 , 3.0 ( 0.0 ) x Memory
* Interfaces 1.0 x Mouse - S-video output - 15 pin HD D-Sub (HD-15) ( 2 in front ) , 2.0 x Microphone - Line-out - Mini-phone stereo 3.5 mm ( 1 in front ) , 1.0 x Audio - Output - Mini-phone stereo 3.5 mm ( 1 in front ) , 1.0 x Hi-Speed USB - VGA - Mini-phone stereo 3.5 mm ( 1 in front ) , 1.0 x Headphones - Line-out (center/subwoofer) - Mini-phone 3.5 mm , 1.0 x Keyboard - Line-out (side surround) - Mini-phone stereo 3.5 mm , 2.0 x Audio - Generic - 6 pin mini-DIN (PS/2 style) , 1.0 x Audio - Generic - Mini-phone stereo 3.5 mm , 4.0 x Display / video - Input - RJ-45 , 1.0 x Parallel - Ethernet 10Base-T/100Base-TX - 6 pin mini-DIN (PS/2 style) , 1.0 x Audio - Line-out (rear) - Mini-phone stereo 3.5 mm , 1.0 x Network - IEEE 1284 (EPP/ECP) - 25 pin D-Sub (DB-25) , 1.0 x Audio - Line-in - 4 pin USB Type A , 1.0 x Display / video - SPDIF output , 1.0 x Audio

I record at 48000, with no plugins at all

I don't know if I'm running a RT kernel or not how can you find out?

as far as Gnome or KDE I think im running Gnome not to sure, Thank again for your help.

Tone

duffrecords
duffrecords's picture
User offline. Last seen 37 weeks 4 days ago. Offline
Joined: 2008-05-20
Posts:

To determine whether you have a real-time kernel, open a terminal and type:

uname -r

The kernel version should have a "-rt" on the end. If it says generic, it's not real-time.

peder
User offline. Last seen 49 weeks 4 days ago. Offline
Joined: 2007-05-08
Posts:

Hmmm, for your latency to be 92,9 at 2048 f/p you have to be recording at 44100Hz, unless you've changed to 48000 now.

But, nevermind. With a 3GHz P4 you should be able to run at least 48000Khz, 512 f/p (latency 21,3ms) w/o any problem and w/o realtime. I just tried that on my Compaq nx9110 with a 3.2GHz P4 and the only way to get an xrun was to move the ardour window around vigorously for about 40 seconds. You're not doing that, are you? ;)

I wonder if you're using pulseaudio and if that causes problems. Try google for 'disable pulseaudio' and see how it's done for your distro (which one is it btw).

pleasebeus
pleasebeus's picture
User offline. Last seen 2 years 15 weeks ago. Offline
Joined: 2008-11-28
Posts:

Peder, any reason to use 48000Hz over 44000Hz? The difference doesn't seem worth bothering with and if it's to go to CD anyway then surely it needs downsampling which adds to complications. I can see the point of 96000Hz... I could be entirely wrong and wouldn't be surprised if I was ;)

Lotone, if it's any help, I was getting x-runs all the time until I switched to the rt kernel and connected my 1010LT directly to Alsa rather than through Pulse. I haven't seen one since, even if I push my plug-ins to the limit and make my system practically grind to a halt.

lotone
User offline. Last seen 3 years 15 weeks ago. Offline
Joined: 2009-01-30
Posts:

My kernel is 2.6.27-11-generic

How do I change that and is it for the better?

I set the f/p to 256 my sample rate is 44100, and my period buffer is set at 3, latency is 17.4 and I believe that their shouldn't be any more xruns because the counter in jack just displays this -:-:- but if I open envy an xrun appears and the counter starts up. I'm really glad that the xruns have gone down I just want to know the cause of them so I don't have to deal with this problem again, and again thank you all for your help.

pleasebeus
pleasebeus's picture
User offline. Last seen 2 years 15 weeks ago. Offline
Joined: 2008-11-28
Posts:

On Debian systems like Ubuntu, it's

sudo apt-get install linux-rt

lotone
User offline. Last seen 3 years 15 weeks ago. Offline
Joined: 2009-01-30
Posts:

this is what I got when I put sudo apt-get install linux-rt in the terminal and this is what I got,

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libsox-fmt-base libsox-fmt-alsa celestia-common libsox0 gnuchess-book
libsdl-image1.2 sox liblua5.1-0 xaw3dg gnuchess
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
linux-image-2.6.27-3-rt linux-image-rt linux-restricted-modules-2.6.27-3-rt
linux-restricted-modules-rt
Suggested packages:
fdutils linux-doc-2.6.27 linux-source-2.6.27
The following NEW packages will be installed:
linux-image-2.6.27-3-rt linux-image-rt linux-restricted-modules-2.6.27-3-rt
linux-restricted-modules-rt linux-rt
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 23.3MB of archives.
After this operation, 95.0MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com intrepid/universe linux-image-2.6.27-3-rt 2.6.27-3.8 [22.5MB]
Get:2 http://us.archive.ubuntu.com intrepid/multiverse linux-restricted-modules-2.6.27-3-rt 2.6.27-3.7 [754kB]
Get:3 http://us.archive.ubuntu.com intrepid/universe linux-image-rt 2.6.27.3.4 [2078B]
Get:4 http://us.archive.ubuntu.com intrepid/multiverse linux-restricted-modules-rt 2.6.27.3.4 [2108B]
Get:5 http://us.archive.ubuntu.com intrepid/multiverse linux-rt 2.6.27.3.4 [2096B]
Fetched 23.3MB in 1min11s (326kB/s)
Selecting previously deselected package linux-image-2.6.27-3-rt.
(Reading database ... 154536 files and directories currently installed.)
Unpacking linux-image-2.6.27-3-rt (from .../linux-image-2.6.27-3-rt_2.6.27-3.8_amd64.deb) ...
Done.
Selecting previously deselected package linux-restricted-modules-2.6.27-3-rt.
Unpacking linux-restricted-modules-2.6.27-3-rt (from .../linux-restricted-modules-2.6.27-3-rt_2.6.27-3.7_amd64.deb) ...
Selecting previously deselected package linux-image-rt.
Unpacking linux-image-rt (from .../linux-image-rt_2.6.27.3.4_amd64.deb) ...
Selecting previously deselected package linux-restricted-modules-rt.
Unpacking linux-restricted-modules-rt (from .../linux-restricted-modules-rt_2.6.27.3.4_amd64.deb) ...
Selecting previously deselected package linux-rt.
Unpacking linux-rt (from .../linux-rt_2.6.27.3.4_amd64.deb) ...
Setting up linux-image-2.6.27-3-rt (2.6.27-3.8) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.27-3-rt
Running postinst hook script /sbin/update-grub.
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.27-11-generic
Found kernel: /boot/vmlinuz-2.6.27-9-generic
Found kernel: /boot/vmlinuz-2.6.27-7-generic
Found kernel: /boot/vmlinuz-2.6.27-3-rt
Found kernel: /boot/memtest86+.bin
Replacing config file /var/run/grub/menu.lst with new version
Updating /boot/grub/menu.lst ... done

Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms
* Running DKMS auto installation service for kernel 2.6.27-3-rt
* fglrx (8.543)... fglrx (8.543): Installing module.
Kernel source for 2.6.27-3-rt not installed. Cannot install this module.
[fail]
run-parts: executing /etc/kernel/postinst.d/nvidia-common

Setting up linux-restricted-modules-2.6.27-3-rt (2.6.27-3.7) ...
update-initramfs: Generating /boot/initrd.img-2.6.27-3-rt

Setting up linux-image-rt (2.6.27.3.4) ...
Setting up linux-restricted-modules-rt (2.6.27.3.4) ...
Setting up linux-rt (2.6.27.3.4) ...

Don't know if it installed or not.

lotone
User offline. Last seen 3 years 15 weeks ago. Offline
Joined: 2009-01-30
Posts:

Restarted computer and tried to jack and I get this now

12:57:01.216 Patchbay deactivated.
12:57:01.296 Statistics reset.
12:57:01.513 Startup script...
12:57:01.514 artsshell -q terminate
12:57:01.520 ALSA connection graph change.
12:57:02.132 Startup script terminated with exit status=256.
12:57:02.133 JACK is starting...
12:57:02.134 /usr/bin/jackd -p512 -dalsa -r44100 -p256 -n3 -D -Chw:0 -Phw:0 -m
12:57:02.137 JACK was started with PID=6098.
jackd 0.109.2
Copyright 2001-2005 Paul Davis and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK compiled with System V SHM support.
loading driver ..
SSE2 detected
apparent rate = 44100
creating alsa driver ... hw:0|hw:0|256|3|44100|0|0|nomon|swmeter|-|32bit
control device hw:0
the playback device "hw:0" is already in use. Please stop the application using it and run JACK again
cannot load driver module alsa
no message buffer overruns
12:57:02.169 JACK was stopped successfully.
12:57:02.169 Post-shutdown script...
12:57:02.169 killall jackd
12:57:02.338 ALSA connection change.
jackd: no process killed
12:57:02.584 Post-shutdown script terminated with exit status=256.
12:57:04.484 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.

pleasebeus
pleasebeus's picture
User offline. Last seen 2 years 15 weeks ago. Offline
Joined: 2008-11-28
Posts:

Did you click on the "use real time" check box in Jack?

lotone
User offline. Last seen 3 years 15 weeks ago. Offline
Joined: 2009-01-30
Posts:

yes and this is what I get in jack,

13:14:02.068 Patchbay deactivated.
13:14:02.074 Statistics reset.
13:14:02.129 Startup script...
13:14:02.130 artsshell -q terminate
13:14:02.135 ALSA connection graph change.
13:14:02.550 Startup script terminated with exit status=256.
13:14:02.551 JACK is starting...
13:14:02.553 /usr/bin/jackd -p512 -dalsa -r44100 -p256 -n3 -D -Chw:0 -Phw:0 -m
jackd 0.109.2
Copyright 2001-2005 Paul Davis and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK compiled with System V SHM support.
13:14:02.579 JACK was started with PID=6239.
loading driver ..
SSE2 detected
apparent rate = 44100
creating alsa driver ... hw:0|hw:0|256|3|44100|0|0|nomon|swmeter|-|32bit
control device hw:0
the playback device "hw:0" is already in use. Please stop the application using it and run JACK again
cannot load driver module alsa
no message buffer overruns
13:14:02.640 JACK was stopped successfully.
13:14:02.641 Post-shutdown script...
13:14:02.641 killall jackd
13:14:02.778 ALSA connection change.
jackd: no process killed
13:14:03.058 Post-shutdown script terminated with exit status=256.
13:14:04.824 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
13:14:30.500 Startup script...
13:14:30.500 artsshell -q terminate
13:14:30.920 Startup script terminated with exit status=256.
13:14:30.921 JACK is starting...
13:14:30.921 /usr/bin/jackd -R -p512 -dalsa -r44100 -p256 -n3 -D -Chw:0 -Phw:0 -m
jackd 0.109.2
Copyright 2001-2005 Paul Davis and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK compiled with System V SHM support.
cannot use real-time scheduling (FIFO at priority 10) [for thread -1490872608, from thread -1490872608] (1: Operation not permitted)
cannot create engine
13:14:30.935 JACK was started with PID=6250.
13:14:30.938 JACK was stopped successfully.
13:14:30.939 Post-shutdown script...
13:14:30.940 killall jackd
jackd: no process killed
13:14:31.352 Post-shutdown script terminated with exit status=256.
13:14:33.154 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.

pleasebeus
pleasebeus's picture
User offline. Last seen 2 years 15 weeks ago. Offline
Joined: 2008-11-28
Posts:

The key thing here is

the playback device “hw:0” is already in use.

Something else is using your soundcard. It seems that's why Jack can't start; it doesn't seem specific to using the rt kernel. Could be your web browser if you've been on YouTube for eg.

lotone
User offline. Last seen 3 years 15 weeks ago. Offline
Joined: 2009-01-30
Posts:

Got it! I restarted my cpu and booted the rt kernel, checked the real time, and started ardour and it works!, being that I just figured this out, what are the benefits of having real time activated? thanks for your help, again I don't know what I would do without this amazing site.

Tone

pleasebeus
pleasebeus's picture
User offline. Last seen 2 years 15 weeks ago. Offline
Joined: 2008-11-28
Posts:

err - less x-runs for one :D

peder
User offline. Last seen 49 weeks 4 days ago. Offline
Joined: 2007-05-08
Posts:

@pleasebeus:
As for 48kHz in this case, it was just what I used for testing.

As for recording fidelity the debate rages on. My take is that if you only record one signal and dump it directly to CD, then the best approach is 44.1kHz.

If you record multiple signals that will be summarized in the end and are being fed through a number of plugins prior, the best thing is to record at the highest feasable rate.
I don't know if its applicable, but if you summarize 1.1+1.1+1.1+1.1+1.1+1.1 and round it to the nearest integer you get 7 whereas 1+1+1+1+1+1 is 6. Which of the two best represent the actual value?

And libsamplerate, which is used for downsampling in Ardour, is among the very best so I guess the fidelity lost there is by far won earlier in the chain.

@lotone:
The generic kernel is fairly lazy and may pospone things like delivering the signal from your soundcard to the program until it feels like it. The rt kernel has been whipped into submission and does what it's told when it's told to =)

audiodef
User offline. Last seen 6 days 1 hour ago. Offline
Joined: 2009-08-29
Posts:

I'm having a REAL hard time getting rid of xruns. The maddening part of this is that this same computer running Windows and Sonar has no trouble with latency at all.

Here's my specs:

HW:
* 2 Mackie Onyx firewire mixers (1640 and 1620)
* Pentium D (dual core) in a Dell Dimension 5510
* 4 GB ram

Jack:
* jackd, realtime
* priority: 70
* f/p: 1024
* rate: 48000
* p/b: 3
* port max: 512
* timeout: 500
* interace: hw:0
* audio: duplex

Desktop: Fluxbox. Kernel: rt-sources.

I have been tweaking settings for a few weeks now with no luck whatsoever. It seems like no matter what I do I eventually get xruns while playing back or recording. I don't run anything else while running Ardour. I've moved the f/p all the way up and back to no avail. Incidentally, a p/b of 4 turns my audio into garbage. So it's either 2 or 3, neither of which changes the fact that I still get xruns.

/etc/security/limits.conf is set according to advice given in these forums.

I've apparently done all the right things, but still no cigar. I will shine your boots if you say something that fixes it. ;-)

audiodef
User offline. Last seen 6 days 1 hour ago. Offline
Joined: 2009-08-29
Posts:

Also, the driver is freebob. It finds and interfaces with my Mackies just fine.

linuxdsp
linuxdsp's picture
User offline. Last seen 1 day 19 hours ago. Offline
Joined: 2009-02-04
Posts:

How many xruns do you get? Is it a lot or just one or two after running for a long time? Does changing the buffer sizes (or sample rate) affect the frequency of the xruns? Also, I've had some problems with other types of interface that were related to running in duplex mode. Is it possible to run your interface in playback or capture only and does this affect the number of xruns?

audiodef
User offline. Last seen 6 days 1 hour ago. Offline
Joined: 2009-08-29
Posts:

The number of xruns seems to vary. Sometimes I won't get any for a while and then 1 or 2 will pop up. Sometimes they just keep coming one after another. It seems very random, although we know it really can't be.

Setting the mode to capture or playback only seems to eliminate xruns, but it would be a very tedious process to set it to capture, record (without the benefit of hearing existing tracks!), then switch to playback.

Changing anything doesn't seem to affect the frequency of xruns. Literally, anything. As far as sampling rate goes, my only options are 41khz and 48khz. Above that and the qjackctl message window goes nuts and I have to kill jack and switch it back to 41 or 48.

And like I've said, changing the buffer size does nothing either.

I am truly stumped and confused. Is is possible to have hardware that can handle audio just fine under one OS (Windows) and not under another? That doesn't make sense to me, given that I see that many other folks here have Linux systems where they never get xruns - some of whom have processors a step or two under the one I have.

audiodef
User offline. Last seen 6 days 1 hour ago. Offline
Joined: 2009-08-29
Posts:

I seem to have stumbled on a possible solution, but only time and testing will tell.

Disabling my NIC seems to have completely eliminated xruns while running Ardour. Not in the 20 minutes I was running it just now did I get nary an xrun. Invariably, in this amount of time in the past, at least a few would pop up. And this is with duplex.

I'll keep playing with it and see if I've indeed nabbed it this way.

seablade
User offline. Last seen 8 hours 41 min ago. Offline
Joined: 2007-01-22
Posts:

If you have realtime permissions set up, then it sounds like you likely have a much deeper problem, either a faulty driver for your NIC, not unheard of, or possibly a hardware problem. Is your NIC and Audio Card by chance sharing IRQs?

Seablade

linuxdsp
linuxdsp's picture
User offline. Last seen 1 day 19 hours ago. Offline
Joined: 2009-02-04
Posts:

Interesting... I've heard of problems with sound / network interface 'conflicts' on other systems (with a variety of different hardware) but it is rare - the possible reasons are many and varied. There are differences between operating systems and their drivers obviously so that may explain why windows works and linux is more troublesome. I've had problems with duplex mode in the past, with a PCI card (ICE1712 chipset) - with my motherboard / kernel / driver combination it would only work in half duplex mode else I got xruns after a while depending upon buffer sizes, but on a different PC it worked fine. In my case the problem could be traced to the playback and capture halves of the card running at slightly different sample rates (I did lengthy investigations into the cause and it wasn't a simple config issue... Seemed to be related to interrupt latency in the kernel e.g. the time taken between the hardware saying it had data and the kernel processing it) It wasn't a fault with JACK either - jack needs to get / send buffers of samples synchronously for full duplex mode to work or you eventually get x-runs but I could clearly see the IRQs from the two parts of the sound card (via ALSA) happening at varying times relative to each other as the timing slipped. Performance under windows was varied too.

DavePhillips
User offline. Last seen 2 weeks 7 hours ago. Offline
Joined: 2006-04-19
Posts:

@linuxdsp - I found that disabling Ubuntu's Network Manager helped eliminate various system errors, e.g. hung-up shutdowns. I wrote a little overview of my experience with Ubuntu, it details what I did to tame that system:

http://www.linuxjournal.com/content/judgement-day-studio-dave-tests-ubuntu-studio-904

It's not a pretty story, but it all worked out. I'm now using Jaunty on my 2nd production box, I'm liking it a lot. However, unless UStudio has ironed out its rt problems I can't recommend it to a novice.

Btw, the un-fixed system produced xruns from HAL polling. And Ubuntu has the nasty habit of re-writing limits.conf after system updates. Grrr...

dp

thorgal
User offline. Last seen 1 year 21 weeks ago. Offline
Joined: 2007-08-03
Posts:

there are many things that can cause xruns but what Dave is saying reminds me of these particular problems:

- between 2.6.26 and 2.6.29, RT kernels are not to be trusted

- the HAL polling means you have the hald daemon running. Xorg 7.4+ relies on hald running at X startup for keyboard and mouse detection. While this may be an interesting development for normal desktop usage, hald has often been a PITA for us RT kernel users.
Since I use KDE (4.3), I added a '/etc/init.d/hal stop' in $HOME/.kde/Autostart/some-startup-script.sh. Do not remove it from the boot services (with e.g. sysv-rc-conf) because gdm (or X in fact) would screw up if hal is not running at login time ...

- the rtirq script needs some update (I think it is already updated by its author but it might not have made it into official package repos). I find rtirq to be quite important on my system. If all IRQ threads that the RT kernel creates run at the same priority, there can be some issues. rtirq aims at prioritizing some threads rather than other. Remember what the RT kernel does: it creates a process thread for every IRQ, and you can them check with

ps -Leo comm,class,rtprio | grep -i irq

and tune them with the 'chrt' command line utility (that the rtirq script is using internally).

These are issue candidates when I update the software side of my system:
- startup daemons
- X and WMs
- IRQ threads

From RT patch to RT patch, some changes may break a previously valid config. For example, the process threads related to timers are now called sirq-xxxx. They were called softirq-xxxx. The new 2.6.31-rt kernel names them even more slightly differently: what used to be called 'IRQ-xx' (for example, the process thread of my soundcard at IRQ 22 was called IRQ-22) is now called 'irq/xx' (irq/22 for my soundcard).

The linux distros have to do with these differences and this will continue like this until the whole RT "hack" makes it into the mainline kernel. It is getting there but who knows when the whole patch is integrated ...

GMaq
GMaq's picture
User offline. Last seen 4 days 3 hours ago. Offline
Joined: 2007-12-11
Posts:

Hi,

Further to what linuxDSP said above regarding M-Audio 1010LT there is real performance variability in Kernels. I have built several -rt Kernels from 2.6.28 to 2.6.29.4 and only 2.6.29-rt1 will run my M-Audio 1010LT at less than 256 fpp reliably with no xruns and without further system tweaks, in fact my current low-latency Kernel will run my 1010LT as quickly as any other -rt Kernel other than 2.6.29-rt1. If I hadn't built several Kernels and tested them I wouldn't have even noticed there was a difference so how is the end user supposed to have a chance.

I'm starting to think that Linux having the Kernel core itself as the main source of hardware support is not a good thing at all, Kernel versions blip by so fast that specialized hardware support for tasks like -rt Audio are routinely broken or degraded without anyone even knowing, I've certainly learned that all -rt Kernels aren't created equal just because they have the -rt patch, certainly newer is not always better!