RPi4 testbuild with HD audio passtrhough (Atmos etc)

  • It seems we finally figured out all the missing bits and pieces to get HD audio passtrough working on the RPi4. Huge thanks go to popcornmix for taking care of the broadcom vc4 stuff!


    If you are in the mood for highly experimental, bleeding edge pre-alpha testing here's a build you can try:

    LibreELEC-RPi4.arm-9.80-devel-20200706110658-308adca.img.gz


    Please use a spare SD card and do a fresh install with the image. This build is based on LibreELEC master with Kodi 19, config.txt has changed and there's no easy way to go back to the stable LE 9.2 series except restoring a full backup.


    Also note that there are a couple of known limitations and issues with current RPi4 LE master builds:

    • No support for 4k output, this isn't implemented yet in the new driver. Neither is HDR output. Playing 4k HEVC files with HD output should work fine, though.
    • H264 hardware decoding is currently disabled as it can crash kodi when seeking or when playback ends.
    • Kodi 19 switched to Python 3 so be prepared that your favourite addons may not be available or work correctly.

    To get HD audio passtrough you have to enable it in Settings->System->Audio. Change the settings level to advanced or expert and then enable passthrough in general and the separate AC3, DTS, TrueHD and DTS-HD options (depending on what your AVR/TV supports).


    Also make sure you've setup your whitelist correctly and set "Adjust display refresh rate" to "on start/stop" or always in player->video settings to get smooth playback.


    As RPi4 HD audio is in a very early stage we'd be glad about any feedback - both working and non-working reports.


    so long,


    Hias

  • "No support for 4k output, this isn't implemented yet in the new driver. Neither is HDR output. Playing 4k HEVC files with HD output should work fine, though." - As you said this isn't working.

    Atmos works might fine. Actually sounds better on the Pi4 than it does on my Nuc. So I guess better audio driver?

    Only bug I had was with the scraper but that aint your fault. Probably set it up wrong.

    Everything I tried worked as expected.

    Even H265, 2160p (noticed it aint 4K since as you guys said :P)


    So I would say a success from me. I would love HDR to test as well in 4K, with this Atmos to see if they all play nice together.

    EDIT: Not sure if it's you guys or Kodi. But it mislable some Atmos as just "Dolby" but it's Atmos in the files.
    The LG SJ9 also start playing Atmos when you start it. So I guess it's a minor bug.

    Edited once, last by linuxares: Added info ().

  • Thanks a lot to all who tested (also LE staff and kodi forum users)!


    The RPi4 HD audio passthrough code has now been merged into the LibreELEC master branch so our latest (and future) nightly testbuilds on Index of / have this feature built in.


    I can't really comment on scraper / kodi label things (that's not my area of expertise), I mainly tested with various sample files in "Files" mode (not library) and that flagged both Dolby TrueHD and Atmos samples as "DOLBY-HD" (same for the DTS HD variants, that were flagged "DTS-HD").


    so long,


    Hias

  • I've been downloading the nightly versions through the week to see if I can at last get Passthrough on the HDMI2. Yesterday's brought success!! I've just installed it and now everything plays perfectly! Thank you so much for all the hard work gone into this! :)

    Edited once, last by armyofme ().

  • Hi,

    I have just installed the nighly build 20200816 and tested HDMI audio passthrough on RPi4 with my Audio decoder (Onkyo TX-NR636) and it works perfectly !

    I only tested Dolby Digital for the moment but will try other content in DTS HD and Dolby Atmos and give feedback here.


    I look forward the day when 2160p will be added to Kodi 19 alpha to have perfect sound and image at the same time ;)


    A big thank to the developpers for this long awaited come back of audio Passthrough :thumbup:

  • Hi, what is the exact version of the raspberry pi you're using? I wanna give it a try, but wanna make sure I buy the right one. Thanks in advance.

  • Thanks for the response, even an 2GB one can play 4K HEVC 30GB RIPS? I know that at this moment it won't output 4k, I just want to play it.

  • I've attempted to get audio passthrough working (with the latest nightly build) on the second hdmi port (HDMI 2) without success, the avr (Denon AVR-4308) is detected in libreelec however no audio is sent to the receiver (video is sent to HMDI 1 which is working), have I misunderstood the passthrough feature? Thank you

    Edited 4 times, last by philbio ().

  • Hias,


    I have a soundbar of: bose soundbar 700

    Just see only dolby digital and dts.


    Could not see dts hd and dolby true hd.
    is it about the soundbar or is the connection not fine?


    many thanks

  • I've attempted to get audio passthrough working (with the latest nightly build) on the second hdmi port (HDMI 2) without success, the avr (Denon AVR-4308) is detected in libreelec however no audio is sent to the receiver (video is sent to HMDI 1 which is working), have I misunderstood the passthrough feature? Thank you

    I don't think there is any suggestion that you can take video from HDMI1 and audio from HDMI2 ?


    The HD Audio passthrough option adds the option for 1080p modes (but not 2160p?) to bitstream passthrough HD Audio codecs like Dolby True HD and DTS HD Master Audio and High Resolution Audio (sending the compressed bitstream to your AVR for your AVR to decode to PCM), whereas previously on the Pi they had been decoded in software within Kodi and output as PCM 5.1/7.1 (which apart from Atmos should be lossless - other than losing metadata that some downstream AVR processing may use for loudness control etc.)

  • Hias,


    I just bought a Pi4 2GB yesterday, installed your 9.80 devel image (above), and tested playback of a few H.265/HEVC 1080p DTS HD Master Audio files. Everything worked great. I also tested playback of H.264 1080p files (none with HD audio) and those played back fine as well.


    Thank you to anyone/everyone who worked to get HD audio on the Pi 4 working!


    Since your post was from July, I tested out the latest Pi 4 release build of Libreelec, but this does not appear to have HD audio enabled.


    On a semi-related note, I copied over the Sox command line player binary from another Pi 4, and this is also working fine. I am currently playing back a 24 bit / 96 KHz FLAC file, and I wanted to see if the Pi was outputting the audio at 16 bit 96 KHz (as it does in Raspbian) or 24 bit 96 KHz. Normally I would cat /proc/asound/card0/pcm0p/sub0/hw_params to check, but w/ Libreelec I get:


    access: MMAP_INTERLEAVED

    format: IEC958_SUBFRAME_LE

    subformat: STD

    channels: 2

    rate: 96000 (96000/1)

    period_size: 1024

    buffer_size: 8192


    This confirms the rate is 96 KHz, but I'm used to the format looking like "S16_LE" (or S24_LE, S32_LE) to see the bit depth.


    Is there any way to check the bit depth on the Pi 4 w/ the audio driver used by libreelec (vc4-hdmi?)


    Thank you again!

  • Thanks a lot for testing and the feedback!


    LibreELEC 9.2 uses the old display driver so it doesn't support HBR audio passthrough.


    As the new display driver requires audio data in IEC958 format (converted from S16/24/32 etc by alsa-lib) you can't check for the actual audio format used by programs via /proc, you have to enable verbose or debug output in the programs to see what they use.


    Not 100% sure about the sox player, but IIRC kodi uses 32bit float for internal PCM audio processing and will in general use 24bit for output (enable debug logging in kodi to see the details). This gives you enough headroom to apply volume attenuation to 16bit audio data, without loosing bits, and ensures 24bit audio will be transmitted fine, too. So in general there's nothing to worry about PCM and compressed audio in kodi.


    so long,


    Hias

  • I’ve just tested this on a mates pi 4 and DTS-ma is recognised correctly as is Dolby-hd but Dolby atmos is not detected properly shows as Dolby-hd. I’ve tested these with files from the digital theatre. I’m running a denon x2300w and know atmos works with Xbox one x. Can’t get fire tv cube to work either mind but that’s off topic.

  • Ok never mind seems it was my AVR that was in the wrong. I changed the setup to 7.1 having found some old surround speakers and connected them. Now atmos is working correctly and it sounds amazing. Makes me wonder why I needed 7.1 since the Xbox doesn’t require that.