Audio passthrough not working on RPi 4 since 2021.11-1 update

Hi,

Since the 2021.11-1 update OSMC doesn’t seem to passthrough audio anymore. It did work flawlessly with the 2021.08-1 version.
Non-passthrough formats still work, but as long as any of the formats that I can normally passthrough is chosen (DTS-HD MA, TrueHD etc) it won’t.
Won’t work means not hearing any audio. Checking the info screen on my AVR also says no audio is present.
Tested with multiple media files to make sure it’s not specific to the file.

What I tried myself is trying a combination of audio settings in Kodi without any luck.
To make sure it was the update though I reinstalled the old update (2021.08-1) from scratch and moved back a copy of some essential Kodi files like advancedsettings.xml/sources.xml.
After this everything worked flawlessly again. In the meantime it downloaded the update again and rebooting caused it to be installed.
This was still on 2021.11-1. Before writing this issue I noticed 2021.11-2 was out, hoping it might fix the problem, but alas, 2021.11-2 doesn’t seem to make any difference as well.
Couldn’t find anything recent related to this issue and I couldn’t find anything in the log files pertaining to this issue. Might have overlooked something though.

Hardware:

  • AVR: Onkyo TX-NR696
  • Player: Raspberry PI 4 - 8GB
    Omitting stuff like TV as the Raspberry PI is directly connected to the AVR. If it’s somehow needed let me know and I’ll add the rest of the hardware.

Screenshots of the audio tab - although the essential bits are already present in the logs:


Full log - redacted some minor stuff and removed the ‘Kodi old log’ section which took almost 70% of the log file:
https://paste.osmc.tv/carilosoni

Steps taken:

  • Enabled debug logging
  • Rebooted
  • Settings → System Settings → Audio
  • Made 2 screenshots (attached)
  • Back to home screen
  • Directly started movie
  • Let it run for ~10 seconds with no audio.
  • Generated log file.

Let me know if more information is needed. Thanks.

Are you sure the older version was actually outputting the HD audio track and not the eAC3/ DTS core? It was my understanding that HD audio on the RPi’s are not currently an officially supported feature as it works on some AVR’s and not on others. I haven’t been following the updates on this but my understand of the situation from before the last big update release was that in order to get this outputting properly on all AVR’s then the Raspberry Pie foundation had to do more work on their end.

Rather sure it worked. I did watch some movies before and I have this addon I wrote myself for Kodi that shows a notifications on the left top of the screen when a file starts playing showing the current Audio language/codec, subtitle language and video codec, as some movies have AC3 audio as the default track sometimes. Or an English track with foreign titles.
Unless it was the right stream but it got resampled because it couldn’t passthrough it or something. Setting wise I didn’t change anything between updates.

If there aren’t any other guesses I wouldn’t mind reinstalling 2021.8-1 again from scratch and making sure the AVR shows its receiving HD audio. Can’t hurt to confirm.

Set the number of channels to 2.0.

Have got a Sonos Beam soundbar and once I did that it worked. Displays 5.1 in the Sonos app when it just wouldn’t work before.

Sound is amazing since the last update and I only have the original Beam 1 rather than the Beam 2 with Atmos.

Appreciate that it looks like you have a Onkyo AV receiver but give it a go anyway :wink:

I reverted back to 2021.8-1 and I can confirm it works with this version.

As proof 2 screenshots of the same movie file as used for the debug logging.
Screenshot of Kodi with my addon showing the info of the current streams used as described.

Picture of AVR info screen showing it’s receiving a TrueHD stream.

Somehow now the TV goes black for a few seconds every 10-15 seconds, which makes it unwatchable. :thinking: Which is new. Didn’t have that before.

I made 2 SD cards now, one with 2021.8-1 and one which I want to update to the latest version so I can debug better.
I’ll let you know when the second SD card is ready to be tested and whether that fixes it. Wouldn’t expect that though, but can’t hurt to try. Thanks.

EDIT: So on the second SD card to make sure it’s not an issue while updating, I wrote the 2021.11-2 image to the SD instead of the previous version and then updating. The issue still persists.

Set to 2.0 channel without any change. I hear no sound and the AVR info screen shows no input.

Hello everyone.
I have same problem with OSMC_TGT_rbp4_20211129.img build
I have Marantz SR6007 with DTS-HD MA / Dolby True HD support and audio passthrough works fine with build OSMC_TGT_rbp4_20210808.img and receiver shows there is DTSHD MASTER or Dolby True HD input while playing appropriate files.
But with 20211129 image there is silence with passthrough enabled. Receiver shows input audio as UNKNOWN
Same problem raises when OSMC updated from 20210808 to 2021-11-2 build using My OSMC update function.

I cannon find any critical errors in log.
Here is few lines regarding audio output with debug enabled:

2021-12-19 18:27:39.382 T:617      INFO <general>: ffmpeg[0x6b738f0X]:     Stream #0:0(eng), 4, 1/1000: Video: h264 (High), yuv420p(progressive), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
2021-12-19 18:27:39.382 T:617      INFO <general>: ffmpeg[0x6b738f0X]:     Stream #0:1(eng), 16, 1/1000: Audio: dts (DTS-HD MA), 48000 Hz, 5.1(side), s32p (24 bit) (default)
.............
2021-12-19 18:27:39.488 T:617      INFO <general>: Opening stream: 1 source: 256
2021-12-19 18:27:39.489 T:617      INFO <general>: Finding audio codec for: 86020
2021-12-19 18:27:39.489 T:617      INFO <general>: Creating audio thread
2021-12-19 18:27:39.489 T:621      INFO <general>: running thread: video_thread
............
2021-12-19 18:27:39.490 T:622     DEBUG <general>: CDVDAudio::Pause - pausing audio stream
2021-12-19 18:27:39.545 T:432     DEBUG <general>: EGL Debugging:
                                                   Error: EGL_BAD_SURFACE
                                                   Command: eglSwapBuffers
                                                   Type: EGL_DEBUG_MSG_ERROR_KHR
                                                   Message: dri2_swap_buffers
2021-12-19 18:27:39.548 T:432     DEBUG <general>: CDRMAtomic::FlipPage - Execute modeset at next commit
2021-12-19 18:27:39.568 T:618     DEBUG <general>: Thread BackgroundLoader 3964661952 terminating
...........
2021-12-19 18:27:39.649 T:621     DEBUG <general>: ffmpeg[0x6b75758X]: [h264_v4l2m2m] output set status 1074026002 (ON) OK
2021-12-19 18:27:39.649 T:621     DEBUG <general>: ffmpeg[0x6b75758X]: [h264_v4l2m2m] --- output pre VIDIOC_QBUF: index 0, ts=0.000001 count=0
2021-12-19 18:27:39.649 T:622     DEBUG <general>: CDVDAudio::Pause - pausing audio stream
2021-12-19 18:27:39.649 T:621     DEBUG <general>: ffmpeg[0x6b75758X]: [h264_v4l2m2m] --- output VIDIOC_QBUF: index 0, ts=0.000001 count=1
2021-12-19 18:27:39.650 T:621      INFO <general>: ffmpeg[0x6b75758X]: [h264_v4l2m2m] Post G selection ret=0, err=0 1920x1088
2021-12-19 18:27:39.650 T:622      INFO <general>: CAEStreamParser::SyncDTS - dtsHD MA stream detected (8 channels, 48000Hz, 16bit BE, period: 8192, syncword: 0x41a29547, target rate: 0x18, framesize 2080))
2021-12-19 18:27:39.651 T:622      INFO <general>: CVideoPlayerAudio: display reset occurred, checking for passthrough
2021-12-19 18:27:39.652 T:622      INFO <general>: Creating audio stream (codec id: 86020, channels: 8, sample rate: 48000, pass-through)
2021-12-19 18:27:39.652 T:622     DEBUG <general>: CVideoPlayerAudio:: synctype set to 0: clock feedback
2021-12-19 18:27:39.652 T:467     DEBUG <general>: ffmpeg[0x4a7c888X]: [SWR] Using fltp internally between filters
2021-12-19 18:27:39.686 T:468      INFO <general>: CActiveAESink::OpenSink - initialize sink
.............
2021-12-19 18:27:39.852 T:432     DEBUG <general>: ------ Window Init (Custom_Cache_Progress.xml) ------
2021-12-19 18:27:39.853 T:623     DEBUG <general>: Thread AlarmClock start, auto delete: false
2021-12-19 18:27:39.854 T:432     DEBUG <general>: started alarm with name: iscachingtimer
2021-12-19 18:27:39.861 T:432     DEBUG <general>: CDRMUtils::DrmFbDestroyCallback - removing framebuffer: 228
2021-12-19 18:27:39.886 T:468     DEBUG <general>: CActiveAESink::OpenSink - trying to open device ALSA:hdmi:CARD=vc4hdmi0,DEV=0
2021-12-19 18:27:39.886 T:468      INFO <general>: CAESinkALSA::Initialize - Attempting to open device "hdmi:CARD=vc4hdmi0,DEV=0"
2021-12-19 18:27:39.890 T:468      INFO <general>: CAESinkALSA::Initialize - Opened device "hdmi:CARD=vc4hdmi0,DEV=0,AES0=0x06,AES1=0x82,AES2=0x00,AES3=0x09"
2021-12-19 18:27:39.890 T:468     DEBUG <general>: CAESinkALSA::InitializeHW - Request: periodSize 4096, bufferSize 16384
2021-12-19 18:27:39.891 T:468     DEBUG <general>: CAESinkALSA::InitializeHW - Got: periodSize 4096, bufferSize 16384
2021-12-19 18:27:39.891 T:468     DEBUG <general>: CAESinkALSA::InitializeHW - Setting timeout to 86 ms
2021-12-19 18:27:39.891 T:468     DEBUG <general>: CAESinkALSA::GetChannelLayout - Input Channel Count: 8 Output Channel Count: 8
2021-12-19 18:27:39.891 T:468     DEBUG <general>: CAESinkALSA::GetChannelLayout - Requested Layout: RAW, RAW, RAW, RAW, RAW, RAW, RAW, RAW
2021-12-19 18:27:39.891 T:468     DEBUG <general>: CAESinkALSA::GetChannelLayout - Got Layout: RAW, RAW, RAW, RAW, RAW, RAW, RAW, RAW (ALSA: none)
2021-12-19 18:27:39.891 T:468     DEBUG <general>: CActiveAESink::OpenSink - ALSA Initialized:
2021-12-19 18:27:39.892 T:468     DEBUG <general>:   Output Device : vc4-hdmi-0
2021-12-19 18:27:39.892 T:468     DEBUG <general>:   Sample Rate   : 192000
2021-12-19 18:27:39.892 T:468     DEBUG <general>:   Sample Format : AE_FMT_S16NE
2021-12-19 18:27:39.892 T:468     DEBUG <general>:   Channel Count : 8
2021-12-19 18:27:39.892 T:468     DEBUG <general>:   Channel Layout: RAW, RAW, RAW, RAW, RAW, RAW, RAW, RAW
2021-12-19 18:27:39.892 T:468     DEBUG <general>:   Frames        : 4096
2021-12-19 18:27:39.892 T:468     DEBUG <general>:   Frame Size    : 16
2021-12-19 18:27:39.903 T:432     DEBUG <general>: CDRMUtils::DrmFbDestroyCallback - removing framebuffer: 229
2021-12-19 18:27:39.907 T:617     DEBUG <general>: CVideoPlayer::SetCaching - caching state 2
2021-12-19 18:27:39.907 T:617     DEBUG <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
............
2021-12-19 18:27:39.937 T:622     DEBUG <general>: CDVDAudio::Pause - pausing audio stream
2021-12-19 18:27:39.939 T:617     DEBUG <general>: CVideoPlayer::HandleMessages - player started 1
2021-12-19 18:27:39.939 T:617     DEBUG <general>: CVideoPlayer::SetCaching - caching state 3
2021-12-19 18:27:39.939 T:619     DEBUG <general>: OnAVChange: CApplication::OnAVChange
2021-12-19 18:27:39.939 T:617     DEBUG <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2021-12-19 18:27:39.939 T:617     DEBUG <general>: CVideoPlayer::SetCaching - caching state 0
2021-12-19 18:27:39.939 T:617     DEBUG <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2021-12-19 18:27:39.939 T:617     DEBUG <general>: VideoPlayer::Sync - Audio - pts: 298000.000000, cache: 364708.830901, totalcache: 685333.311558
2021-12-19 18:27:39.939 T:617     DEBUG <general>: VideoPlayer::Sync - Video - pts: 0.000000, cache: 50000.000000, totalcache: 100000.000000
2021-12-19 18:27:39.939 T:621     DEBUG <general>: CVideoPlayerVideo - CDVDMsg::GENERAL_RESYNC(-100000.000000)
2021-12-19 18:27:39.939 T:621     DEBUG <general>: CVideoPlayerVideo::CalcDropRequirement - hurry: 0
........
2021-12-19 18:27:39.947 T:622     DEBUG <general>: CVideoPlayerAudio - CDVDMsg::GENERAL_RESYNC(-100000.000000), level: 98, cache: 366755.391235
2021-12-19 18:27:39.947 T:622     DEBUG <general>: CDVDAudio::Resume - resume audio stream
2021-12-19 18:27:39.948 T:467     DEBUG <general>: ActiveAE - start sync of audio stream

Is anyone having same problem?

HD audio passthrough is not supported on Pi at this time.

Sorry to hear OSMC doesn’t support it. But I can get why.

I had to install LibreElec to get it working with 19.3. Another thing that can help is to use the first HDMI port (near the power connector). Apparently that can handle 4k/hdr/bitstream combination better.

Sam, is it bug of 20211129 ?
Because OSMC build 20210808 works with Audio passthrough just fine.

No – HD audio is not supported on OSMC for Raspberry Pi at this time. Some AV receivers are clever enough to deduce that an HD audio format is being bitstreamed without manual flagging – but this is rare and not properly supported.

Passthrough of non HD formats (i.e. Dolby Digital or DTS) will work as before.

Support will be possible when we move to Debian Bullseye, which has a newer version of ALSA and userspace libraries.

Thank you for this explanation but it still not clear to me why bitstreaming was working fine with previous build (August) and stopped working with new one (November).

This could be caused by some changes to the Raspberry Pi kernel.
But it won’t work properly until we release on Bullseye.

2 Likes

Thanx, Sam, now it is clear.
I’ll be waiting for new release based on Debian Bullseye