Keep getting xruns no matter what

Optimize your system for ultimate performance.

Moderators: khz, MattKingUSA

User avatar
pkslot
Established Member
Posts: 40
Joined: Sun Feb 07, 2010 7:36 pm
Location: Denmark

Keep getting xruns no matter what

Post by pkslot »

Hi :)

I recently accuired a used laptop that iwant to turn into my main computer. I'd like to get ardour 3 (beta5) up and running on it.

Spec:
AMD Athlon(tm) X2 Dual-Core QL-64 × 2
4gb RAM
320gb hd
Ubuntu 12.04 64-bit

The thing is, that i keep getting xruns no matter how i set up jack. I've added my user to the audio group, made sure i have the rights to use realtime priority, and let the ardour3beta5 installer set up jack for me. It worked like a charm on my old desktop when i did like this, but just not on this laptop. So here's what i get in the messagebox, when i fire up jack through qjackctl:

Code: Select all

19:27:15.667 Patchbay deactivated.
19:27:15.672 Statistics reset.
19:27:15.682 ALSA connection change.
19:27:15.807 D-BUS: Service is available (org.jackaudio.service aka jackdbus).
Cannot connect to server socket err = Opkobling nægtet
Cannot connect to server socket
jack server is not running or cannot be started
19:27:15.820 ALSA connection graph change.
19:27:20.458 D-BUS: JACK server is starting...
Cannot connect to server socket err = Opkobling nægtet
Cannot connect to server socket
jack server is not running or cannot be started
19:27:20.474 D-BUS: JACK server was started (org.jackaudio.service aka jackdbus).
Sat Nov 24 19:27:20 2012: Starting jack server...
Sat Nov 24 19:27:20 2012: JACK server starting in realtime mode with priority 10
Sat Nov 24 19:27:20 2012: control device hw:0
Sat Nov 24 19:27:20 2012: control device hw:0
Sat Nov 24 19:27:20 2012: Acquired audio card Audio0
Sat Nov 24 19:27:20 2012: creating alsa driver ... hw:0|hw:0|512|2|48000|0|0|nomon|swmeter|-|32bit
Sat Nov 24 19:27:20 2012: control device hw:0
Sat Nov 24 19:27:20 2012: configuring for 48000Hz, period = 512 frames (10.7 ms), buffer = 2 periods
Sat Nov 24 19:27:20 2012: ALSA: final selected sample format for capture: 32bit integer little-endian
Sat Nov 24 19:27:20 2012: ALSA: use 2 periods for capture
Sat Nov 24 19:27:20 2012: ALSA: final selected sample format for playback: 32bit integer little-endian
Sat Nov 24 19:27:20 2012: ALSA: use 2 periods for playback
Sat Nov 24 19:27:20 2012: graph reorder: new port 'system:capture_1'
Sat Nov 24 19:27:20 2012: New client 'system' with PID 0
Sat Nov 24 19:27:20 2012: graph reorder: new port 'system:capture_2'
Sat Nov 24 19:27:20 2012: graph reorder: new port 'system:playback_1'
Sat Nov 24 19:27:20 2012: graph reorder: new port 'system:playback_2'
Sat Nov 24 19:27:20 2012: graph reorder: new port 'system:playback_3'
Sat Nov 24 19:27:20 2012: graph reorder: new port 'system:playback_4'
Sat Nov 24 19:27:20 2012: graph reorder: new port 'system:playback_5'
Sat Nov 24 19:27:20 2012: graph reorder: new port 'system:playback_6'
Sat Nov 24 19:27:20 2012: New client 'PulseAudio JACK Sink' with PID 1841
Sat Nov 24 19:27:20 2012: Connecting 'PulseAudio JACK Sink:front-left' to 'system:playback_1'
Sat Nov 24 19:27:20 2012: Connecting 'PulseAudio JACK Sink:front-right' to 'system:playback_2'
Sat Nov 24 19:27:20 2012: Connecting 'PulseAudio JACK Sink:rear-left' to 'system:playback_3'
Sat Nov 24 19:27:20 2012: Connecting 'PulseAudio JACK Sink:rear-right' to 'system:playback_4'
Sat Nov 24 19:27:20 2012: Connecting 'PulseAudio JACK Sink:front-center' to 'system:playback_5'
Sat Nov 24 19:27:20 2012: Connecting 'PulseAudio JACK Sink:lfe' to 'system:playback_6'
Sat Nov 24 19:27:20 2012: New client 'PulseAudio JACK Source' with PID 1841
Sat Nov 24 19:27:20 2012: Connecting 'system:capture_1' to 'PulseAudio JACK Source:front-left'
Sat Nov 24 19:27:20 2012: Connecting 'system:capture_2' to 'PulseAudio JACK Source:front-right'
Sat Nov 24 19:27:21 2012: Saving settings to "/home/peter/.config/jack/conf.xml" ...
19:27:22.728 JACK connection change.
19:27:22.731 Server configuration saved to "/home/peter/.jackdrc".
19:27:22.734 Statistics reset.
19:27:22.765 Client activated.
19:27:22.783 XRUN callback (1).
19:27:22.785 JACK connection graph change.
Sat Nov 24 19:27:22 2012: New client 'qjackctl' with PID 3042
19:27:24.784 XRUN callback (46 skipped).
19:27:26.788 XRUN callback (45 skipped).
19:27:28.793 XRUN callback (46 skipped).
19:27:30.796 XRUN callback (45 skipped).
If this information is not enough, please tell me what's needed, and i'll provide it.

Hope someone can help me :|

User avatar
autostatic
Established Member
Posts: 1728
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Contact:

Re: Keep getting xruns no matter what

Post by autostatic »

Could you post the output of

Code: Select all

cat /proc/interrupts
and

Code: Select all

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
Those are the first things I would check, if your soundcard is sharing an IRQ with something else and if the CPU frequency scaling governor is set to ondemand. More info here: http://wiki.linuxmusicians.com/doku.php ... figuration

User avatar
pkslot
Established Member
Posts: 40
Joined: Sun Feb 07, 2010 7:36 pm
Location: Denmark

Re: Keep getting xruns no matter what

Post by pkslot »

AutoStatic wrote:Could you post the output of

Code: Select all

cat /proc/interrupts
and

Code: Select all

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
Those are the first things I would check, if your soundcard is sharing an IRQ with something else and if the CPU frequency scaling governor is set to ondemand. More info here: http://wiki.linuxmusicians.com/doku.php ... figuration

Code: Select all

           CPU0       CPU1       
  0:         43          2   IO-APIC-edge      timer
  1:        272         29   IO-APIC-edge      i8042
  7:          1          0   IO-APIC-edge    
  8:          0          1   IO-APIC-edge      rtc0
  9:       1052        629   IO-APIC-fasteoi   acpi
 12:     117166        169   IO-APIC-edge      i8042
 16:        136        902   IO-APIC-fasteoi   ohci_hcd:usb3, ohci_hcd:usb4, snd_hda_intel
 17:     174831        370   IO-APIC-fasteoi   ehci_hcd:usb1, ath9k
 18:          0          1   IO-APIC-fasteoi   ohci_hcd:usb5
 19:          0         31   IO-APIC-fasteoi   ehci_hcd:usb2
 22:      11070      23955   IO-APIC-fasteoi   ahci
 40:          0          0   PCI-MSI-edge      PCIe PME
 41:          0          0   PCI-MSI-edge      PCIe PME
 42:          0          0   PCI-MSI-edge      PCIe PME
 43:         29         64   PCI-MSI-edge      snd_hda_intel
 44:          0          3   PCI-MSI-edge      eth0
 45:         58      52591   PCI-MSI-edge      fglrx[0]@PCI:2:0:0
NMI:         10         12   Non-maskable interrupts
LOC:      64529      58033   Local timer interrupts
SPU:          0          0   Spurious interrupts
PMI:         10         12   Performance monitoring interrupts
IWI:          0          0   IRQ work interrupts
RES:      53900     109587   Rescheduling interrupts
CAL:       1609       1712   Function call interrupts
TLB:       6740      12544   TLB shootdowns
TRM:          0          0   Thermal event interrupts
THR:          0          0   Threshold APIC interrupts
MCE:          0          0   Machine check exceptions
MCP:          2          2   Machine check polls
ERR:          1
MIS:          0
And

Code: Select all

peter@pks:~$ sudo     cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
[sudo] password for peter: 
performance
performance

User avatar
autostatic
Established Member
Posts: 1728
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Contact:

Re: Keep getting xruns no matter what

Post by autostatic »

Thanks! Looks ok though one of your soundcard shares its IRQ with two usb ports. That shouldn't be a problem unless those ports are connected to devices with a lot of IO (and even then I doubt if that could cause xruns). What onboard soundcards do you have? Could you post the output of

Code: Select all

cat /proc/asound/cards

User avatar
pkslot
Established Member
Posts: 40
Joined: Sun Feb 07, 2010 7:36 pm
Location: Denmark

Re: Keep getting xruns no matter what

Post by pkslot »

Code: Select all

peter@pks:~$     cat /proc/asound/cards
 0 [SB             ]: HDA-Intel - HDA ATI SB
                      HDA ATI SB at 0xf0400000 irq 16
 1 [HDMI           ]: HDA-Intel - HDA ATI HDMI
                      HDA ATI HDMI at 0xcfeec000 irq 43
I use the SB card.

User avatar
autostatic
Established Member
Posts: 1728
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Contact:

Re: Keep getting xruns no matter what

Post by autostatic »

My netbook has the same issues, AMD CPU and Ati SB soundcard that shares its IRQ with an usb port. I have to unbind the USB port before I can use the SB soundcard with Jack. Otherwise it's xruns galore. More about unbinding a device is also in the System Configuration Wiki page.

User avatar
pkslot
Established Member
Posts: 40
Joined: Sun Feb 07, 2010 7:36 pm
Location: Denmark

Re: Keep getting xruns no matter what

Post by pkslot »

AutoStatic wrote:Thanks! Looks ok though one of your soundcard shares its IRQ with two usb ports. That shouldn't be a problem unless those ports are connected to devices with a lot of IO (and even then I doubt if that could cause xruns). What onboard soundcards do you have? Could you post the output of

Code: Select all

cat /proc/asound/cards
On Jack's homepage?

Pablo
Established Member
Posts: 1270
Joined: Thu Apr 17, 2008 9:57 pm

Re: Keep getting xruns no matter what

Post by Pablo »

Autostatic wrote:
My netbook has the same issues, AMD CPU and Ati SB soundcard that shares its IRQ with an usb port. I have to unbind the USB port before I can use the SB soundcard with Jack. Otherwise it's xruns galore. More about unbinding a device is also in the System Configuration Wiki page.
Here:

http://www.wiki.linuxmusicians.com/doku ... ng_devices

User avatar
pkslot
Established Member
Posts: 40
Joined: Sun Feb 07, 2010 7:36 pm
Location: Denmark

Re: Keep getting xruns no matter what

Post by pkslot »

Ok, so i wrote

Code: Select all

sudo gedit  /proc/interrupts
and got to see this

Code: Select all

          CPU0       CPU1       
  0:        194          2   IO-APIC-edge      timer
  1:       3774         29   IO-APIC-edge      i8042
  7:          1          0   IO-APIC-edge    
  8:          0          1   IO-APIC-edge      rtc0
  9:     110177       3165   IO-APIC-fasteoi   acpi
 12:    1194880      41491   IO-APIC-edge      i8042
 16:      70568      39986   IO-APIC-fasteoi   ohci_hcd:usb3, ohci_hcd:usb4, snd_hda_intel
 17:    3703521        370   IO-APIC-fasteoi   ehci_hcd:usb1, ath9k
 18:          0          1   IO-APIC-fasteoi   ohci_hcd:usb5
 19:        100         31   IO-APIC-fasteoi   ehci_hcd:usb2
 22:      78837      23955   IO-APIC-fasteoi   ahci
 40:          0          0   PCI-MSI-edge      PCIe PME
 41:          0          0   PCI-MSI-edge      PCIe PME
 42:          0          0   PCI-MSI-edge      PCIe PME
 43:          0          0   PCI-MSI-edge      snd_hda_intel
 44:          0          4   PCI-MSI-edge      eth0
 45:       1708    3432315   PCI-MSI-edge      fglrx[0]@PCI:2:0:0
NMI:         11        242   Non-maskable interrupts
LOC:    2408715    1767538   Local timer interrupts
SPU:          0          0   Spurious interrupts
PMI:         11        242   Performance monitoring interrupts
IWI:          0          0   IRQ work interrupts
RES:    1422860    2713628   Rescheduling interrupts
CAL:       2720       3049   Function call interrupts
TLB:      23515      26149   TLB shootdowns
TRM:          0          0   Thermal event interrupts
THR:          0          0   Threshold APIC interrupts
MCE:          0          0   Machine check exceptions
MCP:        157        155   Machine check polls
ERR:          1
MIS:          0
I can see that usb3 and usb4 is on the same irq as snd_hda_intel.

In the terminal i can see the bindings of the usb ports:

Code: Select all

$ tree /sys/bus/usb/drivers/usb/
/sys/bus/usb/drivers/usb/
├── 2-5 -> ../../../../devices/pci0000:00/0000:00:13.2/usb2/2-5
├── bind
├── uevent
├── unbind
├── usb1 -> ../../../../devices/pci0000:00/0000:00:12.2/usb1
├── usb2 -> ../../../../devices/pci0000:00/0000:00:13.2/usb2
├── usb3 -> ../../../../devices/pci0000:00/0000:00:12.0/usb3
├── usb4 -> ../../../../devices/pci0000:00/0000:00:12.1/usb4
└── usb5 -> ../../../../devices/pci0000:00/0000:00:13.0/usb5
Now what am i doing then?

Would it be the right thing to do. if i wrote:

Code: Select all

# echo -n "0000:00:12.0" > /sys/bus/pci/drivers/ohci_hcd/unbind
# echo -n "0000:00:12.1" > /sys/bus/pci/drivers/ohci_hcd/unbind
in the terminal?

And how long will this last, untill next bootup, or for ever?

User avatar
pkslot
Established Member
Posts: 40
Joined: Sun Feb 07, 2010 7:36 pm
Location: Denmark

Re: Keep getting xruns no matter what

Post by pkslot »

Hmm, i did that, but with no luck. I'm not really sure what path to write, when doing the echo thing. Any ideas?

User avatar
autostatic
Established Member
Posts: 1728
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Contact:

Re: Keep getting xruns no matter what

Post by autostatic »

Path is ok and if you didn't get errors when issueing the echo commands then I'd say usb3 and usb4 should got unbinded sucessfully. Did you check afterwards with lsusb and/or cat /proc/interrupts?
If it's really the usb ports open top or htop and you should see the IRQ thread of snd-hda-intel munching up all CPU. That's what's causing the xruns. This could be solved in newer kernels though.

User avatar
pkslot
Established Member
Posts: 40
Joined: Sun Feb 07, 2010 7:36 pm
Location: Denmark

Re: Keep getting xruns no matter what

Post by pkslot »

AutoStatic wrote:Path is ok and if you didn't get errors when issueing the echo commands then I'd say usb3 and usb4 should got unbinded sucessfully. Did you check afterwards with lsusb and/or cat /proc/interrupts?
If it's really the usb ports open top or htop and you should see the IRQ thread of snd-hda-intel munching up all CPU. That's what's causing the xruns. This could be solved in newer kernels though.
Usb3 and 4 is still there so the path isn't the right one. I've checked both with "lsusb" and "cat /proc/interrupts" just to be sure. They're still up and running.

I think i'll start out by getting rid of my disk encryption. From what i could read on the wiki, this is not helping regarding speed, when working with sound. After that i'll get back the usb problen once again.

User avatar
pkslot
Established Member
Posts: 40
Joined: Sun Feb 07, 2010 7:36 pm
Location: Denmark

Re: Keep getting xruns no matter what

Post by pkslot »

Sorry for the delay, i just ran out of time yesterday.

I've tried to shut down the two usb ports with:

Code: Select all

# echo -n "0000:00:12.0" > /sys/bus/pci/drivers/ohci_hcd/unbind
And

Code: Select all

# echo -n "0000:00:12.1" > /sys/bus/pci/drivers/ohci_hcd/unbind
Nothing really happends, and running lsusb still tells me that they're active. So my question is, what other paths could i try out. I really have no clue to what other paths it could be, so any suggestions would be very welcome.

And thank you so much for your help so far, it's really not something i could have figured out my self in any way!

User avatar
autostatic
Established Member
Posts: 1728
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Contact:

Re: Keep getting xruns no matter what

Post by autostatic »

The two echo commands must be issued as root. You can execute the commands with sudo though so you migt want to try that:

Code: Select all

echo -n "0000:00:12.0" | sudo tee /sys/bus/pci/drivers/ohci_hcd/unbind
echo -n "0000:00:12.1" | sudo tee /sys/bus/pci/drivers/ohci_hcd/unbind
This doesn't persist across reboots but you can modify a file like /etc/rc.local so that the commands get executed at boot time.

User avatar
pkslot
Established Member
Posts: 40
Joined: Sun Feb 07, 2010 7:36 pm
Location: Denmark

Re: Keep getting xruns no matter what

Post by pkslot »

Yes, this was what i was looking for. I didn't quite know where to put the sudo command. Running lsusb shows usb3 and 4 is gone. I'l just have to reboot to see what jack says about this. I hope the xrun is history :D

Post Reply