[Odroid C2] No Audio Passthrough

  • Hi! I'm new here, and I've just installed LibreELEC on my old Odroid C2.

    Everything works fine except for sound passthrough. While this feautre is disabled, sound works, but only in stereo. If I enable it, at the beginning of every video I hear "crack", and then, if sound is in format accepted by my sound system (selected in Kodi options) there is silence and sound system indicates no digital data, else - if sound has to be converted to other format - sound comes in stereo.

    Sound system configuration is fine, because it worked well with Raspberry Pi + OSMC (well, there were another things that not worked).

    Any ideas?

  • I haven't tested with a C2 board for a while, but a quick test with a WeTek Play2 (also GXBB, identical in software) and HDMI pass-through seems to work fine here (AVR shows DTS correctly). NB: If you want multi-channel PCM output (PT disabled) you'll need to set the speaker layout in Kodi to 5.1 or 7.1 etc. else it will be 2.0 (default).

  • Hi! I'm new here, and I've just installed LibreELEC on my old Odroid C2.

    Everything works fine except for sound passthrough. While this feautre is disabled, sound works, but only in stereo. If I enable it, at the beginning of every video I hear "crack", and then, if sound is in format accepted by my sound system (selected in Kodi options) there is silence and sound system indicates no digital data, else - if sound has to be converted to other format - sound comes in stereo.

    Sound system configuration is fine, because it worked well with Raspberry Pi + OSMC (well, there were another things that not worked).

    Any ideas?

    I recently had a similar issue with passthrough on RPi3B+. So if your AVR is old, then the issue could be a high sampling rate.

  • I recently had a similar issue with passthrough on RPi3B+. So if your AVR is old, then the issue could be a high sampling rate.

    Worked fine on OSMC installed in Raspberry Pi with same files. So AVR should not be a problem (it supports up to 96 kHz and 24-bit).

    If you want multi-channel PCM output (PT disabled) you'll need to set the speaker layout in Kodi to 5.1 or 7.1 etc. else it will be 2.0 (default).

    Maybe this would be a tip: this setting does nothing (whatever I set, output is stereo). More: on Odroid I have two outputs (well, three, but one is bluetooth) - HDMI and analog. Whatever I set, I get sound via HDMI.

  • Worked fine on OSMC installed in Raspberry Pi with same files. So AVR should not be a problem (it supports up to 96 kHz and 24-bit).

    Thanks for the info! Your AVR is a good one. :thumbup:

    I guess we have to dig deeper now...

    Please provide a full debug log.

    How to post a log (wiki)

    1. Enable debugging in Settings>System Settings>Logging
    2. Restart Kodi
    3. Replicate the problem
    4. Generate a log URL (do not post/upload logs to the forum)

    use "Settings > LibreELEC > System > Paste system logs" or run "pastekodi" over SSH, then post the URL link
  • Multiple audio channels can be encoded into two channels, so don't care about it.

    Looks like LE doesn't support audio passthrough on your device:

    Code
    2023-08-16 17:39:00.072 T:807     debug <general>: PulseAudio: Context authorizing
    2023-08-16 17:39:00.073 T:807     debug <general>: PulseAudio: Context setting name
    2023-08-16 17:39:00.074 T:807     debug <general>: PulseAudio: Context ready
    2023-08-16 17:39:00.074 T:807   warning <general>: Pulseaudio module module-allow-passthrough not loaded - opening PT devices might fail
  • Code
    2023-08-16 17:39:46.444 T:1079     info <general>: CAEStreamParser::SyncDTS - dts stream detected (6 channels, 48000Hz, 16bit BE, period: 512, syncword: 0x7ffe8001, target rate: 0x18, framesize 2012))
    2023-08-16 17:39:46.444 T:1079     info <general>: Creating audio stream (codec id: 86020, channels: 6, sample rate: 48000, pass-through)

    ^ shows that a DTS stream with 5.1 channels is found, and PT is enabled.

    Code
    2023-08-16 17:39:46.656 T:808     debug <general>: CActiveAESink::OpenSink - trying to open device ALSA:hdmi:CARD=ODROIDC2,DEV=0
    2023-08-16 17:39:46.656 T:808      info <general>: CAESinkALSA::Initialize - Attempting to open device "hdmi:CARD=ODROIDC2,DEV=0"
    2023-08-16 17:39:46.670 T:808      info <general>: CAESinkALSA::Initialize - Opened device "hdmi:CARD=ODROIDC2,DEV=0,AES0=0x06,AES1=0x82,AES2=0x00,AES3=0x02"

    ^ shows that the HDMI device is opened.

    ^ shows two RAW channels are opened for playback (which is correct for PT mode) and the sink is opened. The HDMI spec requires the audio to be encoded for transmission as a 'stereo' bearer signal. If Kodi is configured for PCM (no PT) output you need to set the speaker config so we can decode and re-encode 5.1 for a 5.1 layout, or perhaps decode and downmix 5.1 to 2.0 or 2.1. If Kodi is configured for PT audio then we decode the stream to detect what it is, but then use that knowledge to not modify/re-encode the original bitstream (passing it though) in the original encoded stereo format. Different HDMI specs alter how the encoding is done, but even ATMOS is still transmitted as (a more complex encoded) stereo signal.

    In short, I'm not seeing anything wrong or different from the WP2 board that I have connected here /shrug

    NB: The Pulseaudio comment from Da Flex can be ignored. This message is normal on all LE installs; we do not enable Pulse with PT support since we only use Pulse for Bluetooth audio which does not support PT modes.

  • shows two RAW channels are opened for playback (which is correct for PT mode) and the sink is opened.

    Well, I guess that Odroid send something to AVR, AVR don't undersand it and indicates no digital data (making "crack" noise at the beginning).

    If Kodi is configured for PCM (no PT) output you need to set the speaker config so we can decode and re-encode 5.1 for a 5.1 layout, or perhaps decode and downmix 5.1 to 2.0 or 2.1.

    Whatever I set here, I get stereo output.

    Do you have another microSD for LE on RPi? Then we could compare both logs.

    I can connect Raspberry Pi with OSMC that worked here and create debug log from Kodi. Maybe it will be helpful. But... tomorrow, definitely.

  • Downgrade makes no difference - on LE 11.0.1 output is always stereo, PT not working.

    Here is OSMC log running on Rasbperry Pi 3 - everything is working as expected. The only difference I can see is:

    Code
    2023-08-19 14:49:52.950 T:670     debug <general>:   Frames        : 2400

    ... indead of 2432 in Odroid C2. Any way to change it? Or problem is somewhere else?

  • Thanks. LE and OSMC receive different capabilities from the AVR.

    OSMC on RPi (working):

    Code
    2023-08-19 14:49:22.757 T:669      info <general>:     Device 4
    2023-08-19 14:49:22.757 T:669      info <general>:         m_deviceName      : hdmi:CARD=vc4hdmi,DEV=0
    2023-08-19 14:49:22.757 T:669      info <general>:         m_displayName     : vc4-hdmi (vc4hdmi)
    2023-08-19 14:49:22.757 T:669      info <general>:         m_displayNameExtra: GSM LG TV on HDMI
    2023-08-19 14:49:22.757 T:669      info <general>:         m_deviceType      : AE_DEVTYPE_HDMI
    2023-08-19 14:49:22.757 T:669      info <general>:         m_channels        : FL, FR
    2023-08-19 14:49:22.757 T:669      info <general>:         m_sampleRates     : 32000,44100,48000,96000,192000
    2023-08-19 14:49:22.757 T:669      info <general>:         m_dataFormats     : AE_FMT_RAW,AE_FMT_S24NE3,AE_FMT_S24NE4,AE_FMT_S32NE,AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_S16BE,AE_FMT_U8,AE_FMT_RAW
    2023-08-19 14:49:22.757 T:669      info <general>:         m_streamTypes     : STREAM_TYPE_AC3,STREAM_TYPE_DTSHD,STREAM_TYPE_DTSHD_MA,STREAM_TYPE_DTSHD_CORE,STREAM_TYPE_DTS_1024,STREAM_TYPE_DTS_2048,STREAM_TYPE_DTS_512,STREAM_TYPE_EAC3,STREAM_TYPE_TRUEHD

    LE on Odroid C2 (not working):

    Code
    2023-08-16 17:39:00.077 T:807      info <general>:     Device 3
    2023-08-16 17:39:00.077 T:807      info <general>:         m_deviceName      : hdmi:CARD=ODROIDC2,DEV=0
    2023-08-16 17:39:00.077 T:807      info <general>:         m_displayName     : ODROID-C2
    2023-08-16 17:39:00.077 T:807      info <general>:         m_displayNameExtra: HDMI
    2023-08-16 17:39:00.077 T:807      info <general>:         m_deviceType      : AE_DEVTYPE_HDMI
    2023-08-16 17:39:00.077 T:807      info <general>:         m_channels        : FL, FR
    2023-08-16 17:39:00.077 T:807      info <general>:         m_sampleRates     : 8000,11025,16000,22050,32000,44100,48000,64000,88200,96000,176400,192000
    2023-08-16 17:39:00.077 T:807      info <general>:         m_dataFormats     : AE_FMT_S24NE4,AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_RAW
    2023-08-16 17:39:00.077 T:807      info <general>:         m_streamTypes     : STREAM_TYPE_AC3,STREAM_TYPE_DTSHD,STREAM_TYPE_DTSHD_MA,STREAM_TYPE_DTSHD_CORE,STREAM_TYPE_DTS_1024,STREAM_TYPE_DTS_2048,STREAM_TYPE_DTS_512,STREAM_TYPE_EAC3,STREAM_TYPE_TRUEHD

    Differences are at "dataFormats" section. Missing data formats on LE:

    • AE_FMT_S24NE3
    • AE_FMT_S32NE
    • AE_FMT_S16BE
    • AE_FMT_U8

    I guess you found an LE bug. Wait for chewitt now.

  • Raspberry Pi 3B and an Amlogic S905 board are not based on the same silicon and their different drivers expose different packing techniques aka 'data formats' to achieve IEC958 output; the key thing is that they support IEC958 output. The upstream Amlogic drivers are not as mature as they could be (not on the same level as RPi) but I dug out a C2 board and tested it with the same AVR port/cable as the WP2 and both are giving me multi-channel PCM and PT output with a range of media.

    The one difference I think can see between my config and yours is that I have "adjust refresh" enabled and the mode whitelist configured for 1080p @ 60/59.94/50/24/23.976 modes and rate doubling (30/29.97/25 are deliberately omitted so interlaced media works). Your AVR is offering the same so perhaps try that.

  • The one difference I think can see between my config and yours is that I have "adjust refresh" enabled and the mode whitelist configured for 1080p @ 60/59.94/50/24/23.976 modes and rate doubling (30/29.97/25 are deliberately omitted so interlaced media works). Your AVR is offering the same so perhaps try that.

    Everything is worth checking, but... no, it doesn't work.

    Differences are at "dataFormats" section. Missing data formats on LE:

    In both cases used format is AE_FMT_S16NE, present on both platforms. What about frames, which is diffrent? Is there a way to change them?

  • In both cases used format is AE_FMT_S16NE, present on both platforms. What about frames, which is diffrent? Is there a way to change them?

    If connection breaks on a higher frame rate (only audio in your case), then it's sometimes bad HDMI cabling.

    I would check whether your HDMI cable(s) is/are conform to HDMI 2.0 or 2.1. Those cables have better shielding, so they can handle higher data rates (4K video, HD audio etc.).

  • Well, I've tried another cable, but with same result.

    Here is log with passthrough disabled - when I get stereo output. Frames is 2400, but channel layout seems to be uncofigured. Any way to change this (and, maybe, it same place where frames number can be changed)?

    Code
    2023-08-23 18:16:42.274 T:809     debug <general>: CActiveAESink::OpenSink - ALSA Initialized:
    2023-08-23 18:16:42.274 T:809     debug <general>:   Output Device : ODROID-C2
    2023-08-23 18:16:42.274 T:809     debug <general>:   Sample Rate   : 48000
    2023-08-23 18:16:42.274 T:809     debug <general>:   Sample Format : AE_FMT_S24NE4
    2023-08-23 18:16:42.274 T:809     debug <general>:   Channel Count : 8
    2023-08-23 18:16:42.274 T:809     debug <general>:   Channel Layout: FL, FR, UNKNOWN1, UNKNOWN1, UNKNOWN1, UNKNOWN1, UNKNOWN1, UNKNOWN1
    2023-08-23 18:16:42.274 T:809     debug <general>:   Frames        : 2400
    2023-08-23 18:16:42.274 T:809     debug <general>:   Frame Size    : 32