Dual Audio Support

    • Official Post


    There where builds for openelec that supported dual audio. So you can select in kodi the analog and the hdmi at the same time. There is a thread on kodi.tv forum about this at this url:
    [Project] Dual Audio Output support (Krypton/Jarvis/Isengard/Helix/Gotham/Frodo)

    This option is keeping me on the openelec build but i like to go to libreelec.

    On the RPi/RPi2 you can do this natively already in Kodi.

    On Generic you could do it using pulseaudio, but it would take some setting up.


  • I am trying to do it with PulseAudio, I read the wiki page but nothing is documented: Pulseaudio - LibreELEC

    Is it possible to add some example on how to do it for dual audio output?

    Best regards.

    stop kodi

    Code
    systemctl stop kodi


    load the udev module

    Code
    pactl load-module module-udev-detect


    list available sinks

    Code
    pactl list short sinks


    load combined sinks module with specified sinks

    Code
    pactl load-module module-combine-sink <sink1-name> <sink2-name>


    start kodi

    Code
    systemctl start kodi


    then select the relevant pulseaudio output from the kodi audio output selection.

  • Thanks!

    I will try it.

    Best regards.

  • Hello,

    It doesn't work for me:

    Code
    # pactl list short sinks
    1 alsa_output.pci-0000_01_00.1.hdmi-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
    2 alsa_output.pci-0000_00_1b.0.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED


    Code
    # pactl load-module module-combine-sink alsa_output.pci-0000_01_00.1.hdmi-stereo alsa_output.pci-0000_00_1b.0.analog-s
    tereo
    Failure: Module initialization failed
    Code
    # pactl load-module module-combine-sink hdmi-stereo analog-stereo
    Failure: Module initialization failed

    Am I doing something wrong?

    Best regards.

  • The tutorial is working for me (libreelec 8.0.0) - with little changes:

    stop kodi

    Code
    systemctl stop kodi

    load the udev module
    ...

    list available sinks
    (this command doesn't show all my sinks (Intel NUC DN2820)

    list available outputs from alsa

    Code
    aplay -l

    add sinks for the alsa devices

    Code
    pactl load-module module-alsa-sink device=hw:<CARD>,<DEVICE>


    (you must replace CARD and DEVICE with the correct values from the previous command)

    list available pulseaudio sinks

    Code
    pactl list short sinks

    load combined sinks module with specified sinks (I have changed the command a little bit - the old one generates only errors)

    Code
    pactl load-module module-combine-sink sink_name=combined slaves=<sink1-name>,<sink2-name>

    start kodi

    Code
    systemctl start kodi

    then select the relevant pulseaudio output from the kodi audio output selection. (the last one in my case)

    I added the three pactl lines to my autostart.sh to setup the combined audio output on every startup...

    It's working perfect! Thanks for the great idea!

    Edited once, last by mraction (February 28, 2017 at 10:17 AM).


  • Thanks! It works!

    One question: is possible to manage the volume just for one sink?

    I want to fix the analog outputt always with same volume, and when I change the volume or put mute just affect to HDMI output.

    Is this possible?

    Thanks and regards.

  • Working 8.2.0 build (not mine, just happy with it):

    Forum post at kodi.tv: [Project] Dual Audio Output support (Krypton/Jarvis/Isengard/Helix/Gotham/Frodo)

    Direct Dropbox download: LibreELEC-Generic.x86_64-8.2.0.tar?dl=1



    The manual pulseaudio setup (from mraction's post #15) also kinda works for me, but this is easier :) In case anyone wants a pulseaudio setup for Intel NUC 6CAYH:

    /storage/.config/autostart.sh:

    Bash
    #!/bin/sh
    pactl load-module module-alsa-sink device=hw:0,0
    pactl load-module module-alsa-sink device=hw:0,3
    pactl load-module module-combine-sink sink_name=combined slaves=1,2

    Also not sure if needed, but it definitely won't hurt to make the file executable: chmod +x /storage/.config/autostart.sh