tags:

views:

36

answers:

1

I have a USB headset which I occasionally plug into my laptop. When I do so, I have to put the following in ~/.asoundrc to get it to work:

defaults.ctl.card 1
defaults.pcm.card 1
defaults.timer.card 1

This causes a couple of problems. Firstly, any running programs which are using ALSA continue to use the laptop's internal sound card. Secondly, if I remove the USB headset, I have to edit ~/.asoundrc again, and restart applications using sound.

So this is really a two-part question:

  1. How can I configure ALSA so that it allows me to state 'use sound device 1 if available, else use sound device 0'?
  2. How can I configure ALSA to move output from one device to another if one of the devices disappears (or a preferred device appears)?
A: 

You're looking for functionality similar to provided by PulseAudio.

dottedmag