rubenvb Posted May 25, 2020 Posted May 25, 2020 Hi everyone, I have been playing a lot (too much maybe) with my NanoPi M4. It seems that most of what I need will be working "soon" (yay for hardware decoding), except HDMI audio bitstream passthrough. Whatever kernel I try, I always get this output from Kodi: Device 1 m_deviceName : default m_displayName : Default (hdmi-sound ff8a0000.i2s-i2s-hifi i2s-hifi-0) () m_displayNameExtra: m_deviceType : AE_DEVTYPE_PCM m_channels : FL, FR, LFE, UNKNOWN1, FC, BC, BL, BR, BLOC, BROC, FLOC, FROC m_sampleRates : 32000,44100,48000,88200,96000,176400,192000 m_dataFormats : AE_FMT_S24NE4,AE_FMT_S32NE,AE_FMT_S16NE,AE_FMT_S16LE m_streamTypes : No passthrough capabilities And PCM audio works just fine of course, but Kodi shows an empty "Audio Passthrough" section. The most functional OS I have seen for HDMI audio passthrough was Joern-p's custom branches: https://github.com/Joern-P/LibreELEC.tv/releases This gave me functional passthrough for DD and DTS and some of the HD formats (I think it was DTS-HD that worked, but Dolby Atmos gave sharp noise). I tried extracting the changes he applied, and also tried various 4.4 kernels, but none of them seem to be enough to enable the passthrough options. I wonder if I'm looking for this in the wrong place, and this needs to be configured somewhere higher-level (ALSA?) than the kernel. I'm used to everything working out of the box with the right kernel, but I may be spoiled by x86 systems. Does anyone have any idea how to enable HDMI audio passthrough on the NanoPi M4 with Kodi? Thanks!
@lex Posted May 31, 2020 Posted May 31, 2020 Check out this info about Pulseaudio, secion 2 PulseAudio Output Configuration and pavcontrol https://kodi.wiki/view/PulseAudio 10:14:54.339 T:547838738576 WARNING: Pulseaudio module module-allow-passthrough not loaded - opening PT devices might fail
rubenvb Posted May 31, 2020 Author Posted May 31, 2020 9 hours ago, @lex said: Check out this info about Pulseaudio, secion 2 PulseAudio Output Configuration and pavcontrol Thanks for the information. I have tried PulseAudio but it didn't seem to like my sound card: pavucontrol didn't show any devices it could configure so I couldn't even try setting it up correctly. I'd also like to pass through the two HD audio formats that can't be handled by PulseAudio as described in the linked page. I'm guessing the same underlying reason prevents PA from approaching the device, I just don't know what it is, nor could I figure out any meaningful differences at runtime on the LibreElec images. I have taken the collection of ALSA configuration files of LibreELEC (which seemed to include IEC915 options): asound.conf In the dmesg log I always saw this [ 4.422051] ALSA device list: [ 4.422324] No soundcards found. But that never prevented Kodi from outputting PCM audio. With the aforementioned asound.conf, aplay -l shows this: **** List of PLAYBACK Hardware Devices **** card 0: hdmisound [hdmi-sound], device 0: ff8a0000.i2s-i2s-hifi i2s-hifi-0 [ff8a0000.i2s-i2s-hifi i2s-hifi-0] Subdevices: 0/1 Subdevice #0: subdevice #0 And "alsamixer" shows the device has no controls ("amixer scontrols" gives no output at all).
@lex Posted June 2, 2020 Posted June 2, 2020 You should have something like this if all devices are enabled: aplay -l **** List of PLAYBACK Hardware Devices **** card 0: realtekrt5651co [realtek,rt5651-codec], device 0: ff890000.i2s-rt5651-aif1 rt5651-aif1-0 [ff890000.i2s-rt5651-aif1 rt5651-aif1-0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: ROCKCHIPSPDIF [ROCKCHIP,SPDIF], device 0: ff870000.spdif-dit-hifi dit-hifi-0 [ff870000.spdif-dit-hifi dit-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: hdmisound [hdmi-sound], device 0: ff8a0000.i2s-i2s-hifi i2s-hifi-0 [ff8a0000.i2s-i2s-hifi i2s-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0 Ignore the message: [ 4.422324] No soundcards found. You don't have alsamixer controls for hdmi-sound. I am not able to test 4K and i have just fixed my mistakes with hantro and rkvdec so i can try Kodi on 5.7.0 and see what i get when time permits. But i think to fix the problem you have to enable module-allow-passthrough in PulseAudio config. see if you have: /usr/lib/pulse-13.0/modules/module-allow-passthrough.so Try adding load-module module-allow-passthrough to /etc/pulse/system.pa and restart PulseAudio or reboot. I Hope this helps you.
rubenvb Posted June 3, 2020 Author Posted June 3, 2020 9 hours ago, @lex said: You should have something like this if all devices are enabled: aplay -l **** List of PLAYBACK Hardware Devices **** card 0: realtekrt5651co [realtek,rt5651-codec], device 0: ff890000.i2s-rt5651-aif1 rt5651-aif1-0 [ff890000.i2s-rt5651-aif1 rt5651-aif1-0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: ROCKCHIPSPDIF [ROCKCHIP,SPDIF], device 0: ff870000.spdif-dit-hifi dit-hifi-0 [ff870000.spdif-dit-hifi dit-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: hdmisound [hdmi-sound], device 0: ff8a0000.i2s-i2s-hifi i2s-hifi-0 [ff8a0000.i2s-i2s-hifi i2s-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0 I don't have the ROCKCHIPSPDIF entry. What did you do to get it? It doesn't pop up with any unpatched kernel 5.6 or 5.7. The realtek5651co I can get by editing the device tree with a patch you sent my some time ago, but that's not really important as it's the analog 3.5mm jack if I'm not mistaken. 9 hours ago, @lex said: Ignore the message: [ 4.422324] No soundcards found. You don't have alsamixer controls for hdmi-sound. OK, thought as much as HDMI PCM audio worked without it. 9 hours ago, @lex said: Try adding load-module module-allow-passthrough to /etc/pulse/system.pa and restart PulseAudio or reboot. I Hope this helps you. I'll try with PulseAudio again next time I play with this. I'd really like to get this working without PulseAudio though. I do think the missing ROCKCHIPSPDIF device might have something to do with all this, so any information you have about its origins would be helpful. Thanks for the input.
Recommended Posts