You are not logged in.

#1 2014-04-15 09:00:12

indianahorst
Member
Registered: 2008-08-23
Posts: 133

USB Soundcard: kernel log flooded with messages

Hello,

I'm using a Behringer UCA 222 as external and primary soundcard.

Since I use this soundcard, the kernel log (dmesg) is flooded with messages of this kind:

[51674.301682] delay: estimated 336, actual 96
[51674.301687] delay: estimated 336, actual 48
[51675.315706] delay: estimated 288, actual 48
[51675.315726] delay: estimated 336, actual 96
[51695.342281] delay: estimated 288, actual 96
[51695.342296] delay: estimated 336, actual 48
[51697.355345] delay: estimated 288, actual 96
[51697.358339] delay: estimated 192, actual 48

I have already understand that this problem is connected with ALSA and the configuration in /etc/asound.conf.
My /etc/asound.conf looks like this (mostly copied from http://wiki.ubuntuusers.de/.asoundrc#Softwaremixing):


defaults.pcm.rate_converter "samplerate_medium"

pcm.!default {
	type plug
	slave.pcm "dmixer"
}


# Das dmix-Plugin wird definiert.
pcm.dmixer {
    type dmix
    ipc_key 1024
    ipc_perm 0666       # Andere Benutzer können ebenfalls dmix gleichzeitig nutzen
    slave.pcm "snd_card"
    slave 
    {
    	# pcm "hw:0,0"
	period_time 0
	period_size 1024
	buffer_size 4096
        channels 2
	# rate 44100
    }
   
    
    # bindings are cool. This says, that only the first
    # two channels are to be used by dmix, which is
    # enough for (most) oss apps and also lets 
    # multichannel chios work much faster:
    bindings {
        0 0 # from 0 => to 0
        1 1 # from 1 => to 1
      }
}


pcm.snd_card {
        type hw
        card 0
        device 0
}

ctl.snd_card {
        type hw
        card 0
        device 0
}

My /etc/modprobe.d/sound.conf:

options snd-usb-audio nrpacks=1 index=0

I have already tried different configurations of asound.conf, but with no luck.

Does anybody have a similar problem of flooded kernel logs and how did you solve it?

Offline

#2 2014-04-23 23:27:24

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: USB Soundcard: kernel log flooded with messages

Try increasing nrpacks to 2 or 4.

Offline

#3 2014-04-28 00:21:02

indianahorst
Member
Registered: 2008-08-23
Posts: 133

Re: USB Soundcard: kernel log flooded with messages

Thank you for your answer, I have increased the option nrpacks to 2 and then to 4, but the problem persists.

Any other suggestions?

Offline

#4 2014-04-28 02:32:39

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: USB Soundcard: kernel log flooded with messages

Did the values change? They correspond to 48 kHz, but I doubt that setting buffer size to 7 (7*48=336) times period size for that sample rate (7168) would eliminate them. You could try increasing nrpacks further (it goes up to 20 if I recall correctly) if they did change. Do messages appear when playing sounds, or all the time? Is some action triggering them?
Takashi Iwai posted a patch, which should have taken care of this. Disabling that snd_printk line in sound/usb/pcm.c would stop the flooding, but not solve the actual problem. If you cannot pinpoint what causes this or this is permanent, then alsa-user mailing list might be more appropriate.

By the way, your whole alsa configuration can be reduced to:

defaults.pcm.rate_converter "samplerate_medium";

Since you set modprobe to load snd-usb-audio as default card (index 0), the global configuration that alsa comes with takes care of dmix and dsnoop (they refer to whatever defaults.pcm.card points to and its default value is 0).

Last edited by emeres (2014-04-28 02:33:47)

Offline

#5 2014-04-29 16:36:14

indianahorst
Member
Registered: 2008-08-23
Posts: 133

Re: USB Soundcard: kernel log flooded with messages

emeres wrote:

Did the values change? They correspond to 48 kHz, but I doubt that setting buffer size to 7 (7*48=336) times period size for that sample rate (7168) would eliminate them. You could try increasing nrpacks further (it goes up to 20 if I recall correctly) if they did change.

Yes they seem to have changed after altering the nrpacks option:

Apr 29 18:19:14 zeus kernel: delay: estimated 265, actual 44
Apr 29 18:19:58 zeus kernel: delay: estimated 265, actual 44
Apr 29 18:19:58 zeus kernel: delay: estimated 264, actual 0
Apr 29 18:19:58 zeus kernel: delay: estimated 265, actual 0
Apr 29 18:19:58 zeus kernel: delay: estimated 264, actual 44
Apr 29 18:19:58 zeus kernel: delay: estimated 309, actual 44
Apr 29 18:19:58 zeus kernel: delay: estimated 309, actual 45
Apr 29 18:19:58 zeus kernel: delay: estimated 309, actual 44
Apr 29 18:19:58 zeus kernel: delay: estimated 265, actual 0
Apr 29 18:19:58 zeus kernel: delay: estimated 264, actual 0
Apr 29 18:19:58 zeus kernel: delay: estimated 265, actual 44
Apr 29 18:19:58 zeus kernel: delay: estimated 309, actual 45
Apr 29 18:19:58 zeus kernel: delay: estimated 309, actual 44
Apr 29 18:19:59 zeus kernel: delay: estimated 265, actual 44
Apr 29 18:19:59 zeus kernel: delay: estimated 265, actual 0
Apr 29 18:20:00 zeus kernel: delay: estimated 221, actual 0
Apr 29 18:20:00 zeus kernel: delay: estimated 220, actual 0
Apr 29 18:20:05 zeus kernel: delay: estimated 220, actual 44
Apr 29 18:20:05 zeus kernel: delay: estimated 309, actual 44
Apr 29 18:20:05 zeus kernel: delay: estimated 308, actual 44
Apr 29 18:20:05 zeus kernel: delay: estimated 265, actual 0
Apr 29 18:20:05 zeus kernel: delay: estimated 265, actual 1
Apr 29 18:20:05 zeus kernel: delay: estimated 177, actual 44
emeres wrote:

Do messages appear when playing sounds, or all the time?

They seem to appear only when playing any kind of audio.

Another interesting fact: The messages only appear when the system is resumed at least once from hibernation.
When I shutdown the system in the evening and start it up next morning, then there are no messages, even when I play audio.
Seems to be associated with an uncomplete reload / initializing of the USB Soundcard.


emeres wrote:

By the way, your whole alsa configuration can be reduced to:

Thanks for this hint. In the meantime I have reduced the /etc/asound.conf to this:

# high quality sample rate converter:
defaults.pcm.rate_converter "samplerate_best" 

# resampling to 44.1 KHz:
defaults.pcm.dmix.!rate 44100

and the /etc/modprobe.d/sound.conf looks like this:

alias char-major-116 snd
alias snd-card-0 snd-usb-audio
options snd-usb-audio nrpacks=4

Offline

#6 2014-04-29 17:39:35

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: USB Soundcard: kernel log flooded with messages

Either unload sound modules for sound before hibernating/suspending and load them after resume, or just reload modules after resume. Nothing should be using sound before hibernation/suspending.

fuser -v /dev/snd/*

Test also if physically removing the usb device before changing power state helps. There are a number of threads on this.

alias char-major-116 snd
alias snd-card-0 snd-usb-audio
options snd-usb-audio nrpacks=4

I am curious: what do you use those aliases for exactly? If you still want to use UCA 222 as default card, I recommend putting index=0 back in there. If you also have other usb audio hardware it might be even better to use vid and pid.

Offline

Board footer

Powered by FluxBB