[SOLVED] Unexpected xruns frenzy on Arch based distro

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Post Reply
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

[SOLVED] Unexpected xruns frenzy on Arch based distro

Post by CrocoDuck »

Hi guys!

As you know, I have been running ArchBang for a while (http://www.linuxmusicians.com/viewtopic ... 19&t=10837). During the past months I had a very good time: after some update I was able to make music on the standard kernel without even having to run the killer script to kill unwanted services and programs!

Then I had to focus on other stuff and here we are: after a lot of updates my (until then never experienced) super good audio stability is ruined. I cannot see what I did wrong, since I always take a great care when updating the software. Anyhow, now I have a ton of xruns. It is possible to work actually, but it is frustrating to have to throw away some good take just because a xrun popped in the track! So, I am on a quest to fix the situation. Some Archer around here is able to point me in the right direction? Maybe I have skipped some manual intervention for some upgrade you may know about? Also, editing /etc/pam.d/login to this seems to help somewhat:

Code: Select all

#%PAM-1.0

auth       required     pam_securetty.so
auth       requisite    pam_nologin.so
auth       include      system-local-login
account    include      system-local-login
session    include      system-local-login
session    required     pam_limits.so

I added the last line. This should suggest me something... but I need help to get to that something... Some Archer around here have experienced his stability falling into pieces? That is sad, because, as I said, when it was stable was awesome (the best experience I had so far) and I was starting to like a lot Arch and Arch based distros...
Last edited by CrocoDuck on Tue Nov 18, 2014 11:11 pm, edited 1 time in total.
Joermungand
Established Member
Posts: 276
Joined: Wed Oct 24, 2012 5:19 pm

Re: Unexpected xruns frenzy on Arch based distro

Post by Joermungand »

Hi CrocoDuck!

Arch user here, replied to the post you mentioned. I keep my Arch system up to date and there is nothing I could complain about. 0 Xruns on all fronts. While I'm experiencing issues with other things (e.g. Shotwell), everything works smoothly on the audio side. I didn’t have to intervene on any upgrade. I know this doesn’t really help, but might there be something related to your setup?
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: Unexpected xruns frenzy on Arch based distro

Post by CrocoDuck »

Hey! Thanks for your reply. I think that my setup is ok. Here what quickscan thinks about it:

Image

I have installed both linux-rt and linux-rt-lts, so I can boot Into a realtime kernel. Also, I can boost up cpus when I want. I think that probably my regression is due the software I have installed in the past months. For example, I had to install pulsaudio to use Skype. Now I have removed both, but maybe some conf file is still around messing things up. Also, I had to install TeamViewer. I kill its service everytime I have to make music... but seems not that helpful...
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: Unexpected xruns frenzy on Arch based distro

Post by CrocoDuck »

So, I got some improvement. Reading again the Pro Audio page on ArchWiki I found this:
Pro Audio - ArchWiki wrote: Warning: Enabling threadirqs seems to be causing system lockups in conjunction with usb devices in at least some kernel versions starting with 3.13 and including at least 3.14-rc2. See for example https://bugs.launchpad.net/ubuntu/+sour ... ug/1279081 and http://www.spinics.net/lists/linux-usb/msg102504.html also linked from there.
EDIT: The changelog seems to indicate that this has been fixed in the 3.13.6 vanilla kernel. (Search for threadirqs in https://www.kernel.org/pub/linux/kernel ... Log-3.13.6)
https://wiki.archlinux.org/index.php/Pr ... figuration

I have removed the threadirqs kernel parameter:

In /etc/default/grub :

Code: Select all

GRUB_CMDLINE_LINUX=""
then:

Code: Select all

grub-mkconfig -o /boot/grub/grub.cfg
and disabled rtirq:

Code: Select all

systemctl disable rtirq
that seems to have improved a lot the stability. Yesterday I had, at a point, so much xruns that Ardour actually crashed. Now I have been able to load the system with the same session without having a xrun for more than 15 minutes. Also, my USB mouse was working quite bad before. After disabling the rtirq thing seems that it is working better. Since rtirq was configured to give to USB highest priority, I am supposing it was actually messing with my USB stuff in some way.

Joermungand: what is your experience with rtirq? Are you using it?

I will keep on experimenting in order to understand if that improved the situation for real. Also, I will make some experiment with rtirq configuration. If I find a solution I will post here and I will update the tutorial.
Last edited by CrocoDuck on Tue Oct 21, 2014 10:16 pm, edited 1 time in total.
Joermungand
Established Member
Posts: 276
Joined: Wed Oct 24, 2012 5:19 pm

Re: Unexpected xruns frenzy on Arch based distro

Post by Joermungand »

Yes, I do. I have been using rtirq since I set up this machine for audio use a couple of years ago. The thing is, I don’t have any USB audio device. Only one PCI and one FireWire, apart from the onboard stuff. I do use a USB mouse, though, along with a USB keyboard, but have never experienced any issue with either. I don’t think a Pulseaudio config file left behind can really mess things up, but that’s another area I’ve no experience with, as I’ve never installed it on my Arch box.
I’m really at a loss here. What DE are you using? Last time I saw massive updates, they were Gnome-related and my Gnome applications were affected by it to a certain extent, but nothing dramatic, as I’m on XFCE.
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: Unexpected xruns frenzy on Arch based distro

Post by CrocoDuck »

I am using a pure and simple openbox. I have tried to avoid the software with dependencies in the realm of other DEs, like K-stuff, as much as possible. My laptop has always been a mess with USB. The fact is that there are a lot of things on the USB bus, like webcam, WiFi, tons of controllers and so. Unfortunately, I have only USB ports. I will see if I get the same results just organizing the priority of devices in another way. My suspect is that rtirq + latest kernels have some hard time working properly on my hardware-messy laptop.
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: Unexpected xruns frenzy on Arch based distro

Post by CrocoDuck »

Suppressing rtirq made my setup while using this kernel is fairly stable, but not as much as before:

uname -r

Code: Select all

3.14.21-1-lts
My realtime (linux-rt and linux-rt-lts) kernels behave strangely. They are from archaudio repos. They exhibit the mouse inconsistency stuff and one of the cores of my dual core machine is constantly pushed up to a load around 70%, while the other is almost quiet around 1%. That is making me thinking about some weird low level issue with newest kernels. I was thinking about laptop-mode-tools as one of the variables, but it is switched off when I am on AC...

Joermungand: Are you using a rt kernel? If so, how did you install it? From archaudio repos, AUR or manually?
Joermungand
Established Member
Posts: 276
Joined: Wed Oct 24, 2012 5:19 pm

Re: Unexpected xruns frenzy on Arch based distro

Post by Joermungand »

Using rt kernel 3.14.12-rt9-1-rt from the Archaudio repo with threadirqs boot kernel option, Jack2 1.9.10 from Community. No mouse inconsistency, no erratic behaviour, no Xruns (even when my wireless is on – depending on the load, of course), and my CPU load (2 cores) if fairly balanced. I must say this is not a laptop, but a desktop (home-made, Intel Core2 Duo E6850 CPU, 4GB RAM). I know laptops tend to be quirky sometimes.
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: Unexpected xruns frenzy on Arch based distro

Post by CrocoDuck »

Guys, good news!

Indeed, it was laptop-mode-tools. It took a lot to figure it out, since I am used to work with my computer with power supply plugged in, battery removed. Laptop mode tools was configured to be basically inactive when laptop is connected to power supply... so I was not expecting it to be the source of the problem. However, last night I was using my computer with battery and mouse was working... as soon as I plugged the the power supply mouse stopped working. So, that was a hint that Laptop mode tools was interfering with the hardware. Lucky enough, documenting myself for a new laptop, I stumbled across this:

https://wiki.archlinux.org/index.php/Le ... management
ArchWiki wrote: DO NOT install laptop-mode, cpupower, or any other power-management tools in addition to tlp. cpupower may even break p-state (powersaving) of your Haswell CPU, modern CPUs know how to handle themselves.
I just had Laptop mode tools and cpupower installed (and my Presario CQ61 is quite different from that Lenovo), but I removed them (with all their conf files and dependencies not need by other packages) to try tlp:

Code: Select all

pacman -Rns cpupower
pacman -Rns laptop-mode-tools
pacman -S tlp
And now I am back to business. I have switched back on all the pro audio settings (including rtirq) and with the latest linux-rt from archaudio I get a very smooth lowlatency audio experience with 0 xruns whatsoever again! And I not even need to kill services and programs! I am happy again, I am gonna update the tutorial with the new infos. Thank you for your help!
Post Reply