Saturday, October 29, 2011

Linux: Flash: Sound doesn't work because a USB webcam is default playback device

A new USB webcam appears as the default audio playback device, this makes sound stop working for everything. Initially tried adding a ~/.asoundrc file like described here but this doesn't work because nothing can share the sound device anymore once the first program that uses sound places a lock on the device. There seems to be some variations (using dmix) of this thought as well, but they don't work either (or I couldn't get them to).

When you cat the sound device modules as so:

$ cat /proc/asound/modules
 0 snd_usb_audio
 1 snd_hda_intel
 2 snd_hda_intel


Then one can see that the USB device is the default, or at least the first, and changing the order might be helpful. This comment from here provided the solution:


Chuck Ebbert 2007-06-06 15:07:16 EDT
One thing to try is adding the line:

 options snd-usb-audio index=1

to /etc/modprobe.conf

The comment is old, probably, as there is no modprobe.conf in Slackware (or Redhat uses a different init standard?), but there is a modprobe.d/ folder with a collection of .conf files, so I added a snd-usb-audio.conf with the single line:

options snd-usb-audio index=2

Reboot and then the list of sound modules now looks like:

$ cat /proc/asound/modules
 0 snd_hda_intel
 1 snd_hda_intel
 2 snd_usb_audio 

Which makes audio work again, and it can be shared among several applications at once.

No comments:

Post a Comment