Delay warnings when using USB audio on the Raspberry Pi

My kernel.log and debug log files had grown to over 2 GBytes each. This was due to log messages of this kind:


delay: estimated 0, actual 133

As another blog stated, this can be fixed by adding a parameter to the sound-usb-audio module of Alsa. So I did the same thing, creating a file /etc/modprobe.d/snd_usb_audio.conf with this content:


options snd-usb-audio nrpacks=1

After restarting Alsa or a reboot, the problems were gone, the logfiles kept small.

Attaching a USB sound card to the Raspberry Pi

Since my Raspberry Pi runs headless, and the analog audio output is not that great, I decided to add a USB sound card to my little machine. I took a Roland UA-1G, which I was using before on an OpenWRT machine. The device was immediately recognized:


Bus 001 Device 007: ID 0582:00ea Roland Corp.

However, ALSA will prohibit the card from becoming sound device #0, thus being the default. For that you have to comment out the following line in /etc/modprobe.d/alsa-base.conf:


# Keep snd-usb-audio from beeing loaded as first soundcard
#options snd-usb-audio index=-2

After rebooting or restarting ALSA, the Roland will become the default sound device:


$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: UA1G [UA-1G], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 1: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 7/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7