2010-05-31, 16:27
I have an old AV receiver that doesn't have a HDMI input. Until I can afford the upgrade, I wanted my Linux XBMC set-up to be able to output system sounds and all audio to the HDMI and the SPDIF/Optical simultaneously.
Why would you want to do this? ... Well, I wanted to be able to watch a movie or listen to music through my TV without having to switch on the AV Receiver. Ideal for when you don't want to wake the family in the middle of the night or just want to quickly watch something.
Here is my /etc/asound.conf file :
Now in XBMC audio settings :
Audio Output Device : "ALSAtereo"
Passthrough Device : "ALSA:digital"
Also ensure that you select any audio formats that your AV receiver is capable of decoding e.g. DTS, AC3 etc... Otherwise you will not be able to hear any files with DTS or AC3 etc.
Result
Menu sounds : Heard through TV and SPDIF
Stereo Music/ Audio : Heard through TV and SPDIF (Any sample rate will work)
DTS/AC3 : heard through SPDIF only.
Problems
There is only one problem I can think of with this setup (but I am working on it) and that is that DTS / AC3 (basically any of the options ticked in the audio settings) will not be down-mixed and sent out the HDMI. The only option at the minute is to go into the audio settings and disable the AC3 or DTS option for the duration that you want to watch a movie with a AC3 or DTS soundtrack through the TV.
I'm hoping to find a way of getting alsa to do a AC3 / DTS decode and down mix to stereo before piping out of the HDMI whilst still maintaining the bitstream for the SPDIF output.
Thanks,
Anand
Why would you want to do this? ... Well, I wanted to be able to watch a movie or listen to music through my TV without having to switch on the AV Receiver. Ideal for when you don't want to wake the family in the middle of the night or just want to quickly watch something.
Here is my /etc/asound.conf file :
Code:
# Control device (mixer, etc.) for the card
ctl.!default {
type hw
card 0
}
pcm.!default {
type plug
slave {
pcm multi
rate 48000
}
ttable.0.0 1.0
ttable.1.1 1.0
ttable.0.2 1.0
ttable.1.3 1.0
}
pcm.stereo {
type plug
slave {
pcm multi
rate 48000
}
ttable.0.0 1.0
ttable.1.1 1.0
ttable.0.2 1.0
ttable.1.3 1.0
}
ctl.stereo {
type hw
card 0
}
pcm.multi {
type multi
slaves.a.pcm "tv-hw"
slaves.a.channels 2
slaves.b.pcm "digital-hw"
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
}
ctl.multi {
type hw
card 0
}
pcm.tv {
type plug
slave.pcm "tv-hw"
}
ctl.tv {
type hw
card 0
}
pcm.digital {
type plug
slave.pcm "digital-hw"
}
ctl.digital {
type hw
card 0
}
pcm.tv-hw {
type hw
card 0
device 3
}
ctl.tv-hw {
type hw
card 0
}
pcm.digital-hw {
type hw
card 0
device 1
}
ctl.digital-hw {
type hw
card 0
}
Now in XBMC audio settings :
Audio Output Device : "ALSAtereo"
Passthrough Device : "ALSA:digital"
Also ensure that you select any audio formats that your AV receiver is capable of decoding e.g. DTS, AC3 etc... Otherwise you will not be able to hear any files with DTS or AC3 etc.
Result
Menu sounds : Heard through TV and SPDIF
Stereo Music/ Audio : Heard through TV and SPDIF (Any sample rate will work)
DTS/AC3 : heard through SPDIF only.
Problems
There is only one problem I can think of with this setup (but I am working on it) and that is that DTS / AC3 (basically any of the options ticked in the audio settings) will not be down-mixed and sent out the HDMI. The only option at the minute is to go into the audio settings and disable the AC3 or DTS option for the duration that you want to watch a movie with a AC3 or DTS soundtrack through the TV.
I'm hoping to find a way of getting alsa to do a AC3 / DTS decode and down mix to stereo before piping out of the HDMI whilst still maintaining the bitstream for the SPDIF output.
Thanks,
Anand