Enabling sound in xine on certain alsa device (0.3 for HDMI)?
I'd like xine v0.99.6 to output my sound through alsa device 0.3 (my HDMI output). This is, as always :), Ubuntu 11.04 on a small Atom box with the NVIDIA ION chipset, just in case anyone would like to know.
ALSA is configured and working,
mplayer -ao alsa:device=hw=0.3 -vo xv some-video.mkv
plays fine (audio and video). The reason I do not stay with mplayer is that mplayer switches back to the desktop between videos, which is not wanted in this case.
My commandline for starting up xine so far is
xine --video-driver xv -audio-driver alsa --auto-play fh --fu开发者_开发问答llscreen --hide-gui --no-gui --no-mouse --no-logo --no-splash --network
from whereon I control the playback of different videos using a ruby script (through the network connection on port 6789).
Any ideas would help tremendously,
thanks in advance,
Christian.
Ok, finally got it myself ;)
Edit /etc/asoundrc
to add a new, virtual device hdmi
as so (I had to reboot
after this step, you might be smarter and be able to somehow re-start ALSA
):
pcm.!hdmi {
type hw
card 0
device 3
}
ctl.!hdmi {
type hw
card 0
device 3
}
Then edit .xine/config
to include these lines (or alter your entries if they already exist); this will tell xine
to using the new "named device" hdmi
for it's sound output:
audio.device.alsa_default_device:hdmi
audio.device.alsa_front_device:hdmi
Voilà, done. Remember this only works if your HDMI output is actually enabled, I had to use alsamixer
to enable my SPDIF output first. Use my mplayer
-line from above to test your output first (having no xine running, it blocks ALSA
).
精彩评论