Swith audio output to another USB device
|Operating System||Debian 7|
I've recently bought an Enermax keyboard (Caesar) and have input and output audio directly on the keyboard ! That's great and better when it works. Unfortunately, as I have a minimal OS, it doesn't work out of the box. So here is how I could achieve it.
I will purpose 2 way to make it work and I personally use the manual way.
2 Manual way
First of all, you need to see if you could find your USB Audio device (normally there is no reasons why you shouldn't see it) :
> lsusb [...] Bus 003 Device 004: ID 0d8c:0105 C-Media Electronics, Inc. CM108 Audio Controller [...]
Then check this module is loaded :
> lsmod | grep snd_usb_audio snd_usb_audio 84836 2
If it's not the case, add it to your module list and load it :
echo "snd_usb_audio" >> /etc/modules modprobe snd_usb_audio
Now find the corresponding card ID (you could also have it in AlsaMixer) :
> aplay -l [...] card 1: Device [USB Multimedia Audio Device], périphérique 0: USB Audio [USB Audio] Subdevices: 0/1 Subdevice #0: subdevice #0 [...]
My card number is 1 ! Nice, now let's add to our personal configuration (replace 1 at the end of the lines by your card number) :
defaults.ctl.card 1 defaults.pcm.card 1
Now reboot to make it work !
3 Automatic way
For the automatic rules, we're going to play with udev. Simply create a rule for it :
Udev will do the work to make it automatically work :-)