Enabling 7.1 audio passthru in 14.04 for Kodi
To enable audio passthrough from Ubuntu running PulseAudio and Kodi we need to make several settings:
Using Pulse Audio
-
Enable passthrough for our audio output device
This is done using pavucontrol where we can enable passtrough in advanced settings for our digital output through HDMI, or S/PDIF resp.:The profile used for our audio devices is defined in the Configuration tab. For passthough mode we need to set pulseaudio to 2.0 channels.
-
Enable audio passthrough from Kodi system audio output settings:
- Choose a digital output device (HDMI or S/PDIF) in the output configuration
- Tick enable passthrough
- Select which output device to use in case there are more than one
- Tick what encodings our AVR is capable of decoding
Please note that S/PDIF is only capable of providing 5.1. audio. For 7.1. audio we'd need a HDMI connection.
For further limitations on using Pulse Audio for passthrough and for indepth additional hints read the great tutorial from the Kodi team. There you will also find an extremely helpful table for setting to be made under various conditions.
Using ALSA
Sadly Pulse Audio currently does not support passthrough of DTS-HD or TrueHD audio. To get this working we therefore can not use Pulse Audio as a sound server for Kodi.
- We need to start Kodi with ALSA instead (
AE_SINK=ALSA kodi
). To avoid unwanted side effects with Pulse Audio it is recommended to remove it completely, or suspend it using pauspender before starting Kodi.
-
Both can be achieved by a startup script for Kodi:
#! /bin/bash pasuspender AE_SINK=ALSA kodi
In case we always want to start Kodi with ALSA and to always suspend Pulse Audio just link to this script in our kodi.desktop file giving the full path to the (executable) script in its
Exec
line.-
Then the passthrough device will point to the ALSA device:
Thanks for the tip, I have always used ALSA, (removed pulseaudio) but this is problematic because I have no sound outside of Kodi. I tried to use the ALSA sink when running pulse audio. This works but it have the side effect on my setup, that I can't figure out. I am running Ubuntu 14.04 LTS. It is hooked up to a AVR that support DTS ma etc.
If I run the AE_SINK=ALSA kodi
from the terminal or use it in a .desktop
file it works perfectly pushing the dts-ma
out to the AVR, even when pulse audio is the default. This is good :)
The problem I am facing is in conjunction with xautomation
and lirc
My setup is a bit complex because I use a harmony to control everything.
This is extremely smart, because it makes it wife proof :) she can't hit one button and both TV, AVR, PC, speakers start on the correct channels. and she can control a fully fledged PC as was it a smart TV.
SIMEREC pcs2 is installed in the media center to control on/of via hw switch. But from within Ubuntu it uses xautomation
and lirc
to make things happen.
This add the feature to script everything like starting Kodi, closing Kodi, navigation in the system. Because this is its own service, if something freezes or crashes, with a push of one button Kodi is force closed and started again. you can also force restart the desktop environment, but this is rarely a problem. I have used this setup since LTS 12.04
The side effect I am experiencing is when I set the parameter AE_SINK=ALSA kodi
on the .desktop
file or I the startup script and uses xautomation
to execute it. This makes irexec
crash. When I try to restart irexec -d
the service don't start. Until I remove AE_SINK=ALSA
line
Not Working:
#!/bin/bash
killall -9 kodi.bin
AE_SINK=ALSA kodi &
Working:
#!/bin/bash
killall -9 kodi.bin
kodi &