Any ALSA experts around that can help me with the following setup?

I want to create a virtual device that does the following:

  • send the audio data to my regular onboard sound devices
  • when I plug in some USB audio device, send it there as well OR just there

The difficult part is the plugging part. There is an example in the Wiki how to use two cards as one. This works, but only if the USB audio device was plugged in before starting the audio application and it is not unplugged either.

Obviously, switching the configuration files on plug events is another possibility, but again this requires applications to be restarted. :-(

What I want to achieve is simple: when I plug in the USB device, I want to switch my music playback there (since it will be connected to my stereo). System events, voice calls etc. however should remain on the system audio.

If you have any solution, please send me an email at erich AT debian DOT org.

(And yes, I know about PulseAudio, and I use it. But only on top of ALSA)