No HD Audio passthrough on Pi4

  • Hi,

    i have a Pi4 with fresh installed LE 10.0.2. connected to a Samsung Soundbar. DTS,DD and DD+Atmos are working fine.

    When enabling TrueHD and DTS-MA and playing a file with that sound, the video is lagging and there is no sound.

    Error log says this:

    2022-10-06 11:35:02.231 T:946 INFO <general>: Creating audio stream (codec id: 86060, channels: 8, sample rate: 48000, pass-through)

    2022-10-06 11:35:02.232 T:798 INFO <general>: CActiveAESink::OpenSink - initialize sink

    2022-10-06 11:35:02.406 T:798 INFO <general>: CAESinkALSA::Initialize - Attempting to open device "hdmi:CARD=vc4hdmi0,DEV=0"

    2022-10-06 11:35:02.410 T:798 INFO <general>: CAESinkALSA::Initialize - Opened device "hdmi:CARD=vc4hdmi0,DEV=0,AES0=0x06,AES1=0x82,AES2=0x00,AES3=0x09"

    2022-10-06 11:35:02.415 T:798 WARNING <general>: CAESinkAlsa::InitializeHW - Using default alsa values - set failed

    2022-10-06 11:35:02.416 T:798 INFO <general>: CAESinkALSA::Initialize - Attempting to open device "default"

    2022-10-06 11:35:02.418 T:798 INFO <general>: CAESinkALSA - Unable to open device "default:AES0=0x06,AES1=0x82,AES2=0x00,AES3=0x09" for playback

    2022-10-06 11:35:02.420 T:798 INFO <general>: CAESinkALSA::Initialize - Opened device "default"

    2022-10-06 11:35:02.426 T:798 WARNING <general>: CAESinkAlsa::InitializeHW - Using default alsa values - set failed

    2022-10-06 11:35:02.427 T:798 ERROR <general>: CActiveAESink::OpenSink - no sink was returned

    2022-10-06 11:35:02.427 T:797 ERROR <general>: ActiveAE::InitSink - returned error

    2022-10-06 11:35:02.427 T:797 WARNING <general>: CActiveAE::StateMachine - signal: 11 from port: OutputControlPort not handled for state: 2

    2022-10-06 11:35:02.427 T:797 WARNING <general>: CActiveAE::StateMachine - signal: 12 from port: OutputControlPort not handled for state: 2

    2022-10-06 11:35:02.936 T:797 ERROR <general>: CAEStreamInfo::GetDuration - invalid stream type

    2022-10-06 11:35:02.965 T:792 INFO <general>: Skipped 277 duplicate messages..

    Someone got an idea what could be wrong?

  • How are pi, tv and soundbar connected? (e.g. pi<-hdmi->TV<-optical->soundbar).

    Make/model of TV and soundbar could be useful.

    Can you run:

    Code
    edid-decode /sys/devices/platform/gpu/drm/card?/card?-HDMI-A-1/edid | pastebinit

    and paste the url?

  • eLr0n can you please test with the latest LE10 nightly build from here:

    https://test.libreelec.tv/10.0/RPi/RPi4/ - just copy the latest img.gz (currently 20221005) to the update share/folder and reboot.

    If this doesn't help add "drm.debug=0x04" to the end of /flash/cmdline.txt (it must all be on a single line, immediately after "quiet", just separated by a blank), then reboot, reproduce the problem and upload a full log (either with the upload log file option in LibreELEC settings or via ssh with the "pastekodi" command) - just post the URL here.

    The log should give more hints why it fails.

    so long,

    Hias

  • Its the same with new nightly. Log upload didnt work, i think the file is too big.

    I modified it and uploaded it here:

    Kodi.log:

    External Content pastebin.com
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

    system:

    External Content pastebin.com
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

  • Thanks a lot for the logs and also your edid!

    I could reproduce the issue here, it comes from the speaker allocation block in your edid - it reports left, right and LFE (which is not totally wrong but a bit weird as your soundbar only support 2 channel PCM) - and then the hdmi audio driver and kodi trip over that.

    The easiest workaround is to simply remove the offending speaker allocation block from the edid (you don't need it, it's only needed for multi-channel PCM output which your soundbar doesn't support)

    You can do this eg with AW EDID Editor (there are other programs available but I found that to be the most reliable and easy to use one and it also runs fine under Wine)

    AW EDID Editor | Analog Way
    Powerful solution to create and edit EDID files for an optimal compatibility between your sources and displays.
    www.analogway.com

    First ssh in and run getedid create. This will dump your current edid, save it to /storage/.config/firmware/edid/edid-HDMI-A-1.bin

    Then copy this file over to your PC, open it in AW EDID Editor, change to the "CEA Extension" tab and remove the "Speaker Allocation" entry in "Instantiated Blocks", and save the changed edid.

    You can also use the modified edid in the attached zip (I used the edid you posted) but keep in mind that if you change the TV, HDMI ports etc it might not match anymore and you could run into CEC issues etc - in that case you have to do the steps above.

    Now copy the modified edid back to your RPi, overwriting the existing /storage/.config/firmware/edid/edid-HDMI-A-1.bin file.

    Then run create-edid-cpio on your RPi - this will update /flash/edid.cpio so the edid is available early during boot as well.

    Now reboot and HD passthrough should work fine.

    Note: if you switch to a different TV / soundbar / AVR / ... you have to remove the edid changes first - simply run getedid delete on your RPi and reboot to do that.

    so long,

    Hias