kworker is working overtime

When I play audio on my Beaglebone via a USB sound card, I get some
static in the sound which seems to correlate with activity on the
system. 'top' indicates that kworker/0:1 hovers around 97% CPU. This
happens on both Angstrom and Gentoo. Caching audio to memory before
output helps but does not completely fix it. Does anyone have advice
for dealing with this?

- Grant

Could be related to DMA not being activated for USB. I think DMA isn’t activated by default for USB due some bugs.

Could be related to DMA not being activated for USB. I think DMA isn’t activated by default for USB due some bugs.

That’s great, can you point me in the right direction as far as the kernel config? Maybe just the USB driver name?

  • Grant

Haven’t my BB with me now. As soon I have I’ll give you the kernel config option.

But I’m using Robert Nelson kernel and there is activated by default.

Haven't my BB with me now. As soon I have I'll give you the kernel config
option.

But I'm using Robert Nelson kernel and there is activated by default.

OK, so if I switch to the following kernel I won't have to change the
config to enable USB DMA?

I've read about the Arago kernel too:

http://www.bradfordembedded.com/2012/05/building-arago-kernel-for-beaglebone/

Are there kernel releases for the Beaglebone besides the TI, Arago,
and Robert Nelson?

- Grant

Haven't my BB with me now. As soon I have I'll give you the kernel config
option.

But I'm using Robert Nelson kernel and there is activated by default.

OK, so if I switch to the following kernel I won't have to change the
config to enable USB DMA?

Ah, why not just enable it?

Disable:
CONFIG_MUSB_PIO_ONLY=y

Enable:
CONFIG_USB_TI_CPPI41_DMA_HW=y
CONFIG_USB_TI_CPPI41_DMA=y

Then hope your usb device will still work! :wink: As some do, some don't..

GitHub - beagleboard/kernel: Kernel for the beagleboard.org boards

This is what ^ we (community) are all basing our patches on..

Regards,

Could be related to DMA not being activated for USB. I think DMA isn't
activated by default for USB due some bugs.

I enabled USB DMA on the 3.1 kernel and it looks like kworker still
hogs the CPU during playback, but there is no static in the sound
unless I do heavy stuff at the same time like move files onto the SD
card. Could a newer kernel improve things or is there anything else I
can do to further prevent static?

- Grant

Have you tried with a better power supply ?

That static is high or low frequency ? You may have some crosstalk due lack of hump on your power supply.

Robert,

Then hope your usb device will still work! :wink: As some do, some don’t…

Robert could you elaborate on that please ? I saw the patch comments and they didn’t have much info.

For example I’ve been using USB (with DMA on your Kernel) with 3G HSPA+ modems moving about 10-12Mbps download rates and haven’t had any problem. But most USB Wifi adapters I’ve tried are as stable as a ball :slight_smile: (but that could be related to other stuff since on Angstrom I saw the same and it seems Angstrom kernel disables DMA).

I’m even now with your 3.2.28 kernel in preempt mode (not PREEMPT_RT) and haven’t had any issues besides Ethernet needs an extra ifup/ifdown after boot (but I it seems to be related to last wheezy ARMHF stuff).

The USB DMA “bugs” and PREEMPT are big questions for me, specially on PREEMPT there is little info saying why isn’t recommended.

Thanks !

Have you tried with a better power supply ?

That static is high or low frequency ? You may have some crosstalk due lack
of hump on your power supply.

I've experimented a lot and it's definitely not power supply noise,
it's audio dropouts due to lack of oomph for sure. I'm not doing any
resampling. I think I just need to increase performance a bit to fix
it. I'm working on slimming down the 3.1.0 kernel I'm using. Should
switching to 3.2 or 3.6 increase performance?

- Grant

Then hope your usb device will still work! :wink: As some do, some don't..

Robert could you elaborate on that please ? I saw the patch comments and
they didn't have much info.

For example I've been using USB (with DMA on your Kernel) with 3G HSPA+
modems moving about 10-12Mbps download rates and haven't had any problem.
But most USB Wifi adapters I've tried are as stable as a ball :slight_smile: (but that
could be related to other stuff since on Angstrom I saw the same and it
seems Angstrom kernel disables DMA).

I'm even now with your 3.2.28 kernel in preempt mode (not PREEMPT_RT) and
haven't had any issues besides Ethernet needs an extra ifup/ifdown after
boot (but I it seems to be related to last wheezy ARMHF stuff).

I tried CONFIG_PREEMPT and neither USB nor ethernet would work. Maybe
I needed to do a ifup/ifdown for ethernet. USB wouldn't even provide
power to the USB sound card. With CONFIG_VOLUNTARY_PREEMPT, ethernet
worked, but still not USB. This is on 3.1.0.

The USB DMA "bugs" and PREEMPT are big questions for me, specially on
PREEMPT there is little info saying why isn't recommended.

I'm also very curious about this.

- Grant

Right now, there's no info, since we can't really say one way or
another... There's a group of devices that usb/dma works just fine and
there's another group of devices where it doesn't (and thus disabling
it makes it work.).. My feeling, leave it enabled, as it should by
it's nature "dma" give your cpu more free cycles to do other things..

Regards,

yuck, retry with 3.2.. that 3.1.x arago tree was so experimental..

Regards,