Enabling 7.1 audio passthru in 14.04 for Kodi

30,491

Solution 1

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 Install pavucontrol where we can enable passtrough in advanced settings for our digital output through HDMI, or S/PDIF resp.:

    enter image description here
    enter image description here

    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

    enter image description here

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:

    enter image description here

Solution 2

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 &
Share:
30,491

Related videos on Youtube

Brad Thompson
Author by

Brad Thompson

Updated on September 18, 2022

Comments

  • Brad Thompson
    Brad Thompson over 1 year

    Hardware: Gigabyte GA-A75m-d2 mobo using integrated graphics and soundcard which should be capable of passing 7.1 audio.

    Basically, I'm just looking for a way to enable passthrough audio for Kodi or Plex Home Theater in Ubuntu 14.04. I want to pass lossless audio to my AVR for decoding - I don't need my HTPC to decode anything.

    None of the tutorials or walk-thrus I've found have worked and I'm about to completely give up on Ubuntu and Linux in general out of frustration. I've tried a little over a dozen so far and am on my 6th fresh Ubuntu install.

  • Brad Thompson
    Brad Thompson about 9 years
    Thank you - I am using HDMI exclusively. If it helps, this machine will be a pure HTPC. I've followed your instructions several times and cannot get DTS-HD or TrueHD options to show. The system is a mini.iso build using Linux Radeon OSS drivers per the tutorial here: forum.kodi.tv/showthread.php?tid=174854 Also, I installed ubuntu-desktop for convenience while I'm troubleshooting and omitted the autostart scripts from the above instructions.
  • Brad Thompson
    Brad Thompson about 9 years
    More info- I have a file that MediaInfo describes with the following audio info: English, 48.0KHz, 24 bits, 8 channels, FLAC Surround 7.1. This file will only playback stereo audio in Kodi.
  • Brad Thompson
    Brad Thompson about 9 years
    My God, I think you've done it. I've spend hours upon hours trying to get this to work and that did it. Is there a way I can permanently start Kodi this way?