HDMI Passthrough RPi4 - AVR detection

  • I've tested a few nightly releases and everywhere I have to have my AVR turned on during LE start. If it is only in stand by mode then LE will not detect it sees my IT connected to the AVR instead. If I reboot owing to whatever reason I will not have high DTS options available. My AVR is not very typical because it is coming from SONY MDR-HW700DS 9.1ch Digital Surround Wireless Headphone.


    Currently I have LibreELEC-RPi4.arm-9.80-nightly-20201231-b257060.img.gz on Pi4+ HiFiBerry Digi+. I can switch passthrough easily between HiFi and HDMI. I've tested also CEC functions to put more pressure on AVR but it doesn't matter even with dissabled CEC LE sees my TV.

  • It probably won't help but just FYI - it's possible to turn on / off HDMI outputs on RPi 4B:


    HDMI display_power ON ALL HDMI ports:

    vcgencmd display_power 1


    HDMI display_power OFF ALL HDMI ports:

    vcgencmd display_power 0


    HDMI display_power ON HDMI port 0:

    vcgencmd display_power 1 2


    HDMI display_power OFF HDMI port 0:

    vcgencmd display_power 0 2


    HDMI display_power ON HDMI port 1:

    vcgencmd display_power 1 7


    HDMI display_power OFF HDMI port 1:

    vcgencmd display_power 0 7



    HDMI ports connection status:

    cat /sys/class/drm/card0/*HDMI*/status



    Also regarding to HDMI devices (re)detection just stopping / starting Kodi should be enough, it also take long time but it's still more quick than whole LE reboot.

    systemctl stop kodi

    systemctl start kodi


    (or systemctl restart kodi)

  • Thanks for you feedback, I will try to test both of your suggestions because it might be helpful in the future. My LE is turned on all the time and restart is required very rarely. I have thought that it might be good to mention about it in terms of further development.

  • I want to refresh this topic. Once I disconnect the hdmi out cable from my avm and boot libreelec I have my avm detected as hdmi device instead of my TV. Can I somehow set this setting as a default to be always loaded, even if TV will be connected to avm out hdmi during system start-up?

  • I have tried to play around with edid file (hdmi_edid_file=1). I generated the file while AVR was turned on and pass through settings were fine. Unfortunately after reboot I still have the wrong settings and TV with only AC3 and DTS support has been detected (when AVR off).


    Is there any chance to have settings from guisettings.xml forced on startup:

    <setting id="audiooutput.passthroughdevice">ALSA:hdmi:CARD=vc4hdmi0,DEV=0</setting>

    <setting id="audiooutput.ac3passthrough" default="true">true</setting>

    <setting id="audiooutput.ac3transcode">true</setting>

    <setting id="audiooutput.eac3passthrough">true</setting>

    <setting id="audiooutput.dtspassthrough">true</setting>

    <setting id="audiooutput.truehdpassthrough">true</setting>

    <setting id="audiooutput.dtshdpassthrough">true</setting>

  • hdmi_edid_file won't work on LE10, this was for the legacy (firmware) graphics drivers. With LE10 you have to use the standard linux kernel KMS approach (as used eg on x86 builds).


    The info in our wiki only describes how to do this for x86 builds, on RPi you need to use a slightly different approach:


    First dump your edid to the firmware/edid directory, name it eg "myedid.bin":

    Code
    mkdir -p /storage/.config/firmware/edid
    cat /sys/class/drm/card0-HDMI-A-1/edid > /storage/.config/firmware/edid/myedid.bin

    Then create a cpio archive so the file is also available in the very early boot stage:

    Code
    mount -o remount,rw /flash
    rm -rf /tmp/cpio
    mkdir -p /tmp/cpio/usr/lib/firmware
    cp -r /storage/.config/firmware/edid /tmp/cpio/usr/lib/firmware
    cd /tmp/cpio
    find usr -print | cpio -ov -H newc > /flash/edid.cpio
    cd /storage
    rm -rf /tmp/cpio

    Add the following line to /flash/config.txt to load the edid.cpio as an initramfs

    Code
    initramfs edid.cpio

    And add the following option to the end of /flash/cmdline.txt (in the same line, separated by a space from the options before) to use your myedid.bin file for the first HDMI port:

    Code
    drm.edid_firmware=HDMI-A-1:edid/myedid.bin

    Then reboot. To verify everything worked fine run "dmesg | grep EDID", you should see the following lines indicating your myedid.bin is used:

    Code
    LibreELEC:~ # dmesg | grep EDID
    [ 3.142571] [drm] Got external EDID base block and 1 extension from "edid/myedid.bin" for connector "HDMI-A-1"
    [ 3.153272] [drm] Got external EDID base block and 1 extension from "edid/myedid.bin" for connector "HDMI-A-1"
    [ 13.281974] [drm] Got external EDID base block and 1 extension from "edid/myedid.bin" for connector "HDMI-A-1"
    [ 17.737414] [drm] Got external EDID base block and 1 extension from "edid/myedid.bin" for connector "HDMI-A-1"
    [ 17.751318] [drm] Got external EDID base block and 1 extension from "edid/myedid.bin" for connector "HDMI-A-1"

    so long,


    Hias

  • One more question, is there any chance to passthrough the music?

    AC3 and DTS music files should just work if you have passthrough enabled. Just checked with an .ac3 file and a WAV containing DTS - kodi log showed that as being passed through.


    so long,


    Hias

  • I have had passthrough enabled in audio setting and mp3 was not working, I was wondering if there is any other option to be activated in music directly. Something like we see for videos, enable disable pass through.

  • The passthrough options in audio settings apply to music as well. But mp3 passthrough isn't supported.


    The IEC 61937 series includes standards for MPEG-1, MP3, AAC (and a few other niche formats) passthrough, but I'm not aware of any AVR supporting those formats and it's definitely not implemented/supported in kodi.


    so long,


    Hias