How can I change where the audio is output to?
Using xine’s ALSA output pluggin, you can output to a specific device (or all devices).
Finding the names of your cards
- Find out the name of your soundcards with the command:
cat /proc/asound/cards
- In the example below, the first card (card 0) is called "Live" and the second card (card 1) called "Headset":
oliver@panda:~$ cat /proc/asound/cards
0 [Live ]: EMU10K1 - SBLive! Value [CT4832]
SBLive! Value [CT4832] (rev.8, serial:0x80271102) at 0xd000, irq 5
1 [Headset ]: USB-Audio - Logitech USB Headset
Logitech Logitech USB Headset at usb-0000:00:04.2-2, full speed
Using a specific soundcard: method 1
- Enter the word "plughw:" and the name of your card in the box labelled "device used for stereo output:" in the xine-engine configuration tab. For example:
plughw:Headset
Alternatively, I had to use this entry to make my USB headphones work.
hw:Headset,0
Using a specific soundcard: method 2
- Set up an ~/.asoundrc (user only) or /etc/asound.conf (system wide) file that aliases your hardware devices, and then insert that alias in the "device used for stereo output:" box in the xine-engine configuration tab. Alternatively, you can directly enter the alsa device (hw:0,0 or hw:1,0 and so on). If you choose this latter (alternate) method, be aware that ALSA’s corresponding plugfoo (e.g. plughw:0,0 or plughw:1,0 and so on) routing through alsa-lib is much preferred.
- Here is a sample ~/.asoundrc for a machine that has an onboard Intel AC97 codec and a usb-audio device:
pcm.intel8x0 {
type plug
slave.pcm "hw:0"
}
ctl.intel8x0 {
type hw
card 0
}
pcm.usb-audio {
type plug
slave.pcm "hw:1"
}
ctl.usb-audio {
type hw
card 1
}
- now enter "usb-audio" in the xine-engine setup screen and output should go to the usb-audio device (with alsa-lib properly handling sample rate conversion, channels, and so on).
Using all your soundcards at once
This example allows Amarok to play music through all your sound devices at the same time.
- 1. Copy the following text into the file ~/.asoundrc (change ‘Live’ and ‘Headset’ to the names of your sound devices – or you can just use the card numbers ‘0’ and ‘1’):
# This creates a 2-channel interleaved pcm stream based on
# two 2-channel slave devices.
pcm.both {
type route;
slave.pcm {
# create a virtual 4-channel device from two sound devices
type multi;
slaves.a.pcm "plughw:Live";
slaves.a.channels 2;
slaves.b.pcm "plughw:Headset";
slaves.b.channels 2;
bindings.0.slave a;
bindings.0.channel 0;
bindings.1.slave a;
bindings.1.channel 1;
bindings.2.slave b;
bindings.2.channel 0;
bindings.3.slave b;
bindings.3.channel 1;
}
# Map two channels of input to four channels of output
ttable.0.0 1;
ttable.1.1 1;
ttable.0.2 1;
ttable.1.3 1;
}
# Some programs will be unhappy if there is no mixer to talk to,
# so we set this to one of the cards.
# This could be any card (Headset or Live in this example).
ctl.both {
type hw;
card Headset;
}
- 2. Save the .asoundrc file and restart Amarok.
- 3. Edit the box labelled "device used for stereo output:" in the xine-engine configuration tab so it reads:
plug:both
Other tips
To use a dmixed virtual device, ensure that the "sound card can do mmap" checkbox is unchecked.
Read: 926