[SOLVED!] Problems KXStudio, Mint KDE 12, xruns…

Unofficial support for the KXStudio Linux distribution and applications.
More info at http://kxstudio.linuxaudio.org/

Moderators: MattKingUSA, khz

Post Reply
wolftune
Established Member
Posts: 1350
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Been thanked: 2 times
Contact:

[SOLVED!] Problems KXStudio, Mint KDE 12, xruns…

Post by wolftune »

[EDIT: everything works! short answer: turn off networking, set cpufreq governor to performance, eliminate rtirq threading stuff I had tried before, use XRender instead of OpenGL for desktop effects, viola!]

Here's the deal:

I had a functioning Mint KDE / KXStudio system. However, I never got it to the point where it was really smooth and no xruns. I was trying DIN (which is awesome), but the sound was crackly even when there were no xruns (whereas usually crackle relates to xruns). After some research, I did the following:

I discovered that I had only radeon graphics driver, thus no hardware acceleration (glxgears was at 60fps only). So I followed instructions I found for installing the proprietary ATI driver for my video card. Now glxgears runs at around 900fps.

I also tried to install a widget for controlling the cpufreq governor, and I installed some random dev packages that someone said might help fix the errors the widget was giving me. No luck. I ended up getting a different widget to work as a desktop widget though.

I didn't mess with disabling the wifi, but I tried turning it off sometimes in just the network widget.

Thing is, before I used to get no xruns at most buffer sizes, but they'd go crazy if I went to 64 and they'd show up here and there at 128 or 256. Now, the xruns show up sometimes even at 1024 (running NOTHING except for cadence and catia) and start really showing up constantly into the hundreds at a buffer size of 256.

Biggest problem with my system: wifi is on the same ineterrupt line as my build-in audio, and what used to be radeon but is now fglrx shows up on the same line as my usb ports which I had used for a class-compliant USB interface. All of these are labeled IO-APIC-fasteoi.

I previously had my usb port listed in my rtirq script thing, but I worried that it was the high-level of the new fglrx video that was causing all my xruns, so I tried deleting that and returning my rtirq script to default, but that didn't help. Right now it says RTIRQ_NAME_LIST="rtc snd usb i8042"
I did restart.

Htop says I have these priorities:
RT rtkit-daemon
-91 irq/8-rt0
-86 irq/16-hda inte [my internal audio card]
-85 irq/16-rtlwifi
-83 jackdbus
then a all my USB ports
then a2jmidid
then i8042 and a bunch of other irq things, the last in the list being fglrx
next is pulseaudio stuff

So the wifi is way too high still, but is below the audio card. The fglrx is above pulse audio but below the other things I think are relevant.

Incidental, maybe red-herring: When I turn off networking, the screen freezes up and cursor even doesn't move, and again when I turn it on, just for a few seconds. Whenever I wake from sleep, there's a 10 second freeze including the cursor and then things start working and then the wifi engages.

Anyway, it used to be that I had enough xruns that it wasn't really ideal but mostly worked. Now I can't run low-latency at all because of the number of xruns.

I'm hoping to fix the system and learn more in the process. But I'm wondering if I should just wait for the full 12.04 KXStudio and just install that fresh and go from there. I heard something about the new kernel in 12.04 having an easy low-latency option… I'm also wondering if this computer is hopeless because of the shared threads (or whatever it's called) between the graphics and USB and between the wifi and internal sound… maybe I should just go all the way and get a new computer, and one with firewire… ugh. :(

Thanks for the help. I hope I've learned my lessons up to here so that my explanations are clear enough.
Last edited by wolftune on Mon Apr 30, 2012 2:22 pm, edited 2 times in total.
Aaron Wolf
Music teacher, scholar
http://wolftune.com
wolftune
Established Member
Posts: 1350
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Been thanked: 2 times
Contact:

Re: [SOLVED mostly] Problems KXStudio, Mint KDE 12, xruns…

Post by wolftune »

Ok, I found the problem on my own!

The proprietary video driver seems not compatible with OpenGL or something. Turning off desktop effects helped, but I also switched desktop effects to XRender and the problems went away. The smoothest is still desktop effects off, but with XRender things can still be functional with desktop effects.

And glxgears was at 60fps before the driver install, then moved to 900 but everything was glitchy in JACK, switching desktop effects to XRender gets glxgears to 1400 and turning off desktop effects it jumps to 5000+

I take it that my video card just isn't very good, but at least it is something. It's working smoother on the system overall than when I was using only radeon…

I still have intermittent xruns every few minutes at low buffer sizes, so I'm guessing that's the wifi, which I'll now play with turning that off…

Also, a buffer of 64 still goes wild with xruns. But I can use 128 functionally again.

I think I'm back to acceptible, maybe better than before. I now have an easy way to adjust the cpu governor, and better graphics overall. I suppose I should return the rtirq thread to where it was before, since maybe that was not the problem…

I still want to move to the improvements in KXStudio 12.04, but I can wait until that system is fully ready and then carefully pick which distro to pair it with, possibly wait for Mint KDE to be updated…

I'd still welcome any educational or other comments if anyone has any. I'm trying to learn to understand this whole system…
Last edited by wolftune on Sun Apr 29, 2012 6:27 pm, edited 1 time in total.
Aaron Wolf
Music teacher, scholar
http://wolftune.com
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: [SOLVED mostly] Problems KXStudio, Mint KDE 12, xruns…

Post by Pablo »

RTIRQ_NAME_LIST="rtc snd usb i8042"
Try "rtc hda_intel" or even "rtc intel". Probably, just "snd" is raising the wifi card aswell. Restart the computer and check priorities again.

Yes, wait a bit. The 3.2 low latency kernel may help you. When mint upgrades to 12.04 ubuntu repos, it will be there, along with faltkx superb updated KXstudio.

128 frames per period with no xruns is very good already. If you are curious, you can measure the real round-trip latency through a cli program, jack_iodelay.
wolftune
Established Member
Posts: 1350
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Been thanked: 2 times
Contact:

Re: [SOLVED mostly] Problems KXStudio, Mint KDE 12, xruns…

Post by wolftune »

Ok, major update:

I tried with my USB card again and everything was terrible. There were no xruns but the sound was completely distorted to the extreme. I tried a lot of things but the only thing that fixed it was just eliminating the associated bit from rtirq.

Then I tried some further adjustments… I don't know exactly where I went wrong before, but apparently a certain combination of things was needed. Everything is GREAT now, and I'd like to make the situation clear and figure out what lessons to learn from all this.

When I first was told to disable the network and to move cpufreq -g to performance mode, I stupidly assumed these to be just kinda "free the cpu more" suggestions, comparable to "don't have too many windows open at once", boy was I wrong. But I did try these and neither one eliminated xruns and that's when I got into the whole discussion about rtirq in that other thread… Now, I think the answer was just that to eliminate xruns I needed to have both network off and the governor at performance, and either one on its own wasn't enough. But actually, the whole rtirq discussion came from my naive curiousity about the idea of real-time kernels and then the advice to use rtirq instead…

Here's the status now:
After getting things working well, I turned off rtirq entirely! I even went back to jack being set to RT still but to only a priority of 10 instead of 88. I turn off the network, I turn on performance governor, and with this arrangement I was able to go to a buffer of 64 with several effects running and absolutely zero xurns!

Turns out the answer was just what people said at the beginning: network off, minimize desktop effects (actually, that isn't fully necessary now that I installed the proprietary ATI vid-card driver which might be a notable factor in all this), performance cpufreq…

With the shared thread lines on my system rtirq screwed things up more than it helped. Maybe if I learned to do it more, it could help the system run even more, but I don't need it. I was running rakarrak and guitarix simultaneously with most of their effects on and additional extra things. To get xruns, I had to run Pianoteq and play lots of sustained keys to get the DSP over 50% and then xruns showed up, but all this was still at a buffer of 64 (which used to go insane with xruns even when running no effects at all).

I think I was hesitant to set all the things right in the first place because the advice I was given involved command-line ways to change governor and networking and/or done with bash scripts and it was opaque to me how to turn things back since I didn't understand the commands and still don't yet know how to make bash scripts. I'm now using widgets to set these things, and with those I know how to return to the old settings. I'm happy to learn command-line and scripting, but I'm hesitant to just type in commands when I don't understand what they are doing or how to undo them…

Anyway, I went through way more hassle than I ought to have, and it's my fault essentially, but I learned some things, and I hope to figure out the best take-away lessons… and the system really works great now!
Aaron Wolf
Music teacher, scholar
http://wolftune.com
wolftune
Established Member
Posts: 1350
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Been thanked: 2 times
Contact:

Re: [SOLVED!] Problems KXStudio, Mint KDE 12, xruns…

Post by wolftune »

Update: I got the terrible distortions again. It had something to do with changing some setting related to the USB interface. I can't quite explain it, but simply restarting the interface got it functioning normally again. It's some issue with settings changing and not being compatible, maybe sample rate…

Anyway, if that issue isn't related to rtirq, then maybe setting up rtirq is ok, and is not a problem. It may not be necessary, but it could perhaps help the system do better when DSP is getting up there… But I won't mess with it now. Eventually I'll move to the new 12.04 KXStudio and maybe try the low-latency kernel option… But I'm functional as is.
Aaron Wolf
Music teacher, scholar
http://wolftune.com
Post Reply