[Odroid C2] No Audio Passthrough

  • The log snippet looks OK to me. Only 2 channels are used for PCM, even if you have 8 audio output channels enabled in the settings.

    Read here about the difference between passthrough and non-passthrough: Click!

    Try passthrough with only 2 audio output channels. As mentioned, multiple channels will be encoded into 2 (FL, FR), so you'll get all 6 DTS channels with only 2 audio output channels in the settings.

  • Well, at this point - no, it don't look OK. I understand difference between passthrough (where both channels are RAW) and PCM output (where you should have one PCM track for each channel). In passthrough mode my problem is with frames (whatever it means - and, what is more important, how to change it), in PCM mode problem is with system configuration.

    If everything would work OK, then I could test my speakers with speaker-test, and hear noise from every speaker, repeatly. What is happening? Well...

    ... yes, again, it works in stereo mode. Four unknown channels gives no sound. The question is: how to change channel number/mapping to make it work? I don't have much ALSA knowledge, so everything I try is copying/mixing what I've found in Internet.

  • OK, then I think the missing data formats (post #14) are the issue. I already had an internal team discussion about this. Unfortunately nobody has the skills to fix it. So you can only wait for updates. /shrug

  • I don't know - format used in Raspberry Pi is present on Odroid too.

    I've tried many configuations in /storage/.config/asound.conf - without success. Trying to force more than 2 channels causing speaker-test not working anymore.

    Maybe this could be another clue - error during reloading ALSA configuration (seems to be kind of bug/issue in LibreELEC):

    Code
    Kodi:~ # alsactl restore
    alsactl: load_state:1689: Cannot open /var/lib/alsa/asound.state for reading: No such file or directory
    alsa-lib /build/build.LibreELEC-AMLGX.arm-11.0.3/build/alsa-lib-1.2.8/src/ucm/main.c:1541:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -2
    Found hardware: "gx-sound-card" "" "" "" ""
    Hardware is initialized using a generic method
  • LE is not a conventional Linux distro, so /var/lib/alsa exists inside the read-only SYSTEM file and there is no asound.state file there because it is not required (sound is configured on each boot). There is also no need to create alsa.conf files since PCM and PT work fine with the default board based conf that we embed in the image (the "error" message that you post shows "Found hardware: gx-sound-card" which proves this is loaded). All GXBB devices have the same alsa.conf and this is proven with a large number of box/board devices, and C2 is the most-used device with the AMLGX image. I have no idea what the issue is, but I'm highly confident it's local to your iLE nstall or more people would be complaining (and it works fine here). Have you gone through the normal routine of checking cables, ports?

  • I know what LE works, and after experiences with OSMC I think it's pretty good idea.

    If problem is local to me, then only thing I haven't checked is situation where system check what is connected to HDMI and configures sound device to use TV capabilities (don't know if that's even possible). Well, maybe I have to disconnect Odroid C2 from TV and reboot it. Cables, ports, TV and speakers are good, beause it worked well with Raspberry Pi and OSMC (where eg. Boblight doesn't work - on Odroid C2 and LibreELEC Boblight works fine). Problem with software (or drivers) is shown by speaker-test (only two channels detected).

    Here is an output from Raspberry Pi (well, this one is not connected to any TV):

    All channels are detected (I should connect it to something to check if it really works).

    Why more people don't complain? I don't know, but how many of them are using 5.1 sound configuration (stereo runs out of the box)? More, how many of them can hear the diffrence between passthrough sound and stereo streched to 5.1 by speakers (what my speakers is doing by now and it sounds... well, not bad, but it's definitely not DTS 5.1)? Maybe I'm the first one who wants clear sound on this board :/

  • You mean output channels in Kodi System settings? I've tried 5.1 and 2.0 with same result. At this moment it is 5.1.

    I've tested it without TV connected (rebooted board after disconnecting HDMI). Same result - speaker-test recognizes only stereo channels.

    Why bother about cables and receivers (which work with another source), when system don't even try to output 5.1?

  • I've tried 5.1 and 2.0 with same result. At this moment it is 5.1.

    Thanks. The test with 2.0 output channels was important to me.

    Why bother about cables and receivers (which work with another source), when system don't even try to output 5.1?

    We don't know that. HDMI negotiation is first, selecting a codec for the resulting connection is second.

  • This is the current also conf we embed: https://github.com/chewitt/alsa-l…sound-card.conf

    This is an older version: https://github.com/chewitt/alsa-l…sound-card.conf

    The older conf has all the analogue device pcm extras needed for speaker-test to work with multiple channels. In the absence of all of them (as per the current conf) speaker-test will only output stereo since this is all the default pcm device supports/exposes. This is 100% same on my system; which happily outputs multi-channel PCM and PT on the HDMI connection (which is not the analogue pcm device). So kudos for playing "spot the difference" .. but this difference is not the thing you are looking for.

    NB: The only reason the older conf exists was an earlier attempt to work around a driver not-technically-a-bug where alsa does not pass mixer controls correctly. This patch hacks a fix: https://github.com/chewitt/linux/…702a070dc71c133

    I'd ask that you play with cables and AVR/TV ports. Multi-channel output depends on the ELD data read from EDID/HDMI and the usual "but it works in the legacy image!" claim means little due to a) the upstream codebase being 100% different, and b) the amount of hideous stuff the legacy kernel ignores/overrides/fakes to work around TVs and monitors that provide bad/broken EDID data.

    And yes the greatest percentage of AMLGX users are probably using default 2-channel output. However, enough folks have complained about the earlier multi-channel state (that the kernel patch resolved) that I know people are using multi-channel output.

    /shrug

  • Multi-channel output depends on the ELD data read from EDID/HDMI and the usual "but it works in the legacy image!" claim means little due to a) the upstream codebase being 100% different, and b) the amount of hideous stuff the legacy kernel ignores/overrides/fakes to work around TVs and monitors that provide bad/broken EDID data.

    Probably this is the problem - drivers on Odroid can't "talk" to my TV - either because bad data from TV or some bugs within them.

    For another test I've installed last LibreELEC on Raspberry Pi 3 and again - it worked out of the box. Log (for comparison) is here. So - drivers on Raspberry Pi recognize (or do some workaround?) my TV properly. What was surprise to me - boblight is working too (not worked on OSMC), but only with DRM PRIME disabled (what disables hardware decoding too X( ).

    Maybe I sould stay on Raspberry Pi 3... or give a try with Raspberry Pi 4. More testing needed :-/

  • Code
    2023-08-30 18:37:01.357 T:910      info <general>: ffmpeg[0x3cb1230]:   Stream #0:1(por): Audio: ac3, 48000 Hz, stereo, fltp, 384 kb/s (forced)
    2023-08-30 18:37:01.357 T:910      info <general>: ffmpeg[0x3cb1230]:   Stream #0:2(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)

    ^ Have you selected the right audio stream? .. it looks like the Portugese audio is stereo, and English is 5.1.

  • Code
    2023-08-30 18:37:01.357 T:910      info <general>: ffmpeg[0x3cb1230]:   Stream #0:1(por): Audio: ac3, 48000 Hz, stereo, fltp, 384 kb/s (forced)
    2023-08-30 18:37:01.357 T:910      info <general>: ffmpeg[0x3cb1230]:   Stream #0:2(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)

    ^ Have you selected the right audio stream? .. it looks like the Portugese audio is stereo, and English is 5.1.

    Use the gear icon on the playback bar to check it.

  • Wow, that would be extreme shame :P

    I've selected right stream. But after checking it once again (who knows - sometime complex problems has very easy solutions) I've found that stereo AC3 tracks work in passthrough mode. Not changing much.

  • Nothing changed in sound playing - "crack" then no data when passthough enabled, stereo when disabled.

    Your version has broken my GPIO script started from autostart.sh (power on speakers when TV is on etc.), so I've turned back to official one.

  • Nothing changed in sound playing - "crack" then no data when passthough enabled, stereo when disabled.

    Your version has broken my GPIO script started from autostart.sh (power on speakers when TV is on etc.), so I've turned back to official one.

    Can you please go back to chewitt build, activate debug logging, replicate the issue, and post a link to the log?

    I'm curious whether the missing data formats are available on that build:

    • AE_FMT_S24NE3
    • AE_FMT_S32NE
    • AE_FMT_S16BE
    • AE_FMT_U8