Crackling noise on USB interface in certain apps

Talk about your MIDI interfaces, microphones, keyboards...

Moderators: MattKingUSA, khz

blablack
Established Member
Posts: 22
Joined: Sun Feb 22, 2009 7:18 pm

Re: Crackling noise on USB interface in certain apps

Post by blablack »

Hi everyone,

First of all, thanks for the quick help!

To answer the different questions:
- the Sample Rate I use is 48kHz... Tried 96kHz as well but did't change the results... Still crackling... Same by trying different combination of period size and sample rate.
- I tried -S (for synchronous) and Force 16-bit mode (why not... I'm ready to try anything at that stage)... Same results here, still crackling...

I have in fact this issue with any software using Jack (reported with Ardour, Hydrogen, etc...).

I'm gonna try now to compile the 2.6.36 kernel - I hope than by having more things working in 2.6.36 compared to 2.6.35 (last kernel working for me) I will be able to find more details as to what causes this problem.
User avatar
kaimerra
Established Member
Posts: 91
Joined: Sun Jan 04, 2009 9:41 am
Location: Minnesota, USA

Re: Crackling noise on USB interface in certain apps

Post by kaimerra »

The only thing that seemed to help was to turn off KMS in my grub boot options. I have a Radeon x1600 and have always had video issues, so I would think this a likely culprit. My guess is it is prioritizing some video process higher than the USB ports.

Looking at the IRQs on my machine the video card is higher than all my USB ports after the RTC. I could solve this by running a realtime kernel and using rtirq script to prioritize by module, but all the RT kernels available are old(.31-.33) and either don't boot on my laptop or get really funky when booted.

I have had the time to thoroughly test out my Jack apps with no KMS, but from the few minutes I tried it out the crackling seemed to be severely reduced.

If you have a radeon try adding "radeon.modeset=0" to the end of your kernel line in grub, or I think its "nomodeset" for other cards. Also, I use the opensource radeon driver as FGLRX ended support for my card a while back.
blablack
Established Member
Posts: 22
Joined: Sun Feb 22, 2009 7:18 pm

Re: Crackling noise on USB interface in certain apps

Post by blablack »

Hi Kaimerra,

Did you see this?
http://ardour.eu/node/4340

2.6.39 enables the use of rtirq scripts.

I'mm going to try that straight away
blablack
Established Member
Posts: 22
Joined: Sun Feb 22, 2009 7:18 pm

Re: Crackling noise on USB interface in certain apps

Post by blablack »

Ok, so here we go.

2.6.39 compiled and running, grub modified to use 'threadirqs'.
Everything is running ok.

The script RTIrq is working (I can compare with the same kernel not started with threadirqs, and in that case RTIrq just doesn't do anything)...

So so far so good... And it does improve things... but unfortunately doesn't fix them all...

If RTIrq is not started (and the priority of the USB ports not increased) I get way more crackling sound... With RTIrq, the situation improves but doesn't get fixed...

Conlusion, it seems to do with IRQs of the USB ports...

@Kaimerra: Can you give more details as per the hardware you run?
blablack
Established Member
Posts: 22
Joined: Sun Feb 22, 2009 7:18 pm

Re: Crackling noise on USB interface in certain apps

Post by blablack »

Oh, another thing I have done is to compile a 2.6.39 especially for music:
- deactivated the Wifi modules
- deactivated the xhci modules
- the usual lowlatency options

But it didn't help much.

Deactivating KMS at boot didn't help either.

I'll try the IRQPoll option this evening (at that stage, I'm just gonna try everything I can...)

To be continued...
blablack
Established Member
Posts: 22
Joined: Sun Feb 22, 2009 7:18 pm

Re: Crackling noise on USB interface in certain apps

Post by blablack »

Hi Kaimerra,

All right, after upgrading to the kernel 2.6.39, used irqthread, used the rtirq script and upgraded jack, it seems to have reduced the problem a lot.

I am running the git version of Alsa as well in debug mode, and every tine the crackling happen, I get this in dmesg:
ALSA urb.c:480: frame 5 active: -18

Do you report the same thing?

Another info is the type of usb port I have:
EHCI
USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05)

Do you have the same ones?
User avatar
kaimerra
Established Member
Posts: 91
Joined: Sun Jan 04, 2009 9:41 am
Location: Minnesota, USA

Re: Crackling noise on USB interface in certain apps

Post by kaimerra »

I just grabbed 2.6.39-rc4 from the Ubuntu mainline repo to try out the "threadirqs" boot option with rtirq.

My usb controllers are of type: USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #1 (rev 02)
My USB device: ID 0582:00a3 Roland Corp. EDIROL UA-4FX

Not sure what other hardware you are curious about...I have a old Intel Core Duo laptop with a Radeon x16000.

I'll post later with my results of the new kernel.
User avatar
kaimerra
Established Member
Posts: 91
Joined: Sun Jan 04, 2009 9:41 am
Location: Minnesota, USA

Re: Crackling noise on USB interface in certain apps

Post by kaimerra »

So, running 2.6.39 with threadirqs and rtirq helps, but there was still some minor crackling.

This page was helpful in getting my jackd priority just right: http://subversion.ffado.org/wiki/IrqPriorities

That kernel with threadirqs and radeon.modeset=0 to turn on KMS and I and getting NO crackling. I have only done a minute or two of audio testing, but this seems promising.
User avatar
kaimerra
Established Member
Posts: 91
Joined: Sun Jan 04, 2009 9:41 am
Location: Minnesota, USA

Re: Crackling noise on USB interface in certain apps

Post by kaimerra »

For those interested, the issue is only with radeon KMS enabled. I filed a bug with Alsa: https://bugtrack.alsa-project.org/alsa- ... hp?id=5408
Post Reply