Posts: 3
Joined: Fri Aug 31, 2018 10:57 pm

Passthrough multichannel audio over HDMI

Fri Aug 31, 2018 11:27 pm

Hi folks - I'm at my wit's end here. I've got a RPi 3 running MythTV and I'm trying to get passthrough audio working via ALSA. OpenMAX works alright but messes up the video, so I want to use ALSA.

I've been following these instructions: ... _with_ALSA. But they seem to be out of date, or I'm doing something wrong. When I create the bcm2835.conf file, no additional iec958 device appears.

I can see with aplay -l/-L that there is an apparently-unrelated IEC958/HDMI device as part of the standard driver:

bcm2835 ALSA, bcm2835 IEC958/HDMI
Direct hardware device without any conversions

But trying to use it doesn't work. Specifically, I get static and the receiver displays "PCM 2.0" rather than 2-channel Dolby Digital, which is what the file is using. The speaker test works fine with the PCM.

- Is it still required to define the device in this .conf file in order to get passthrough audio? Or should the DEV=1 device work?
- How can I convince this configuration file to be read? Or is it being read and simply not working?
- How can I test this without MythTV? I tried downloading a raw AC/3 file and playing it with mplayer, but I can't spell the output device because there are '='s in the name and that's a reserved character.

I've tried a variety of things, from config.txt settings (specifically hdmi_stream_channels=1 and no_hdmi_resample=1) to fiddling with the MythTV settings and gotten nowhere. i know this must work, but I'm clearly doing something wrong and can't find it.

Posts: 3
Joined: Fri Aug 31, 2018 10:57 pm

Re: Passthrough multichannel audio over HDMI

Sun Sep 02, 2018 12:16 am

Update: To rule out MythTV I tried just playing an AC/3 file from the internet using mplayer:

Code: Select all

$ mplayer 11sec.ac3 -ao alsa:device=hw=0.1 -ac hwac3
MPlayer 1.3.0 (Debian), built with gcc-6.2.1 (C) 2000-2016 MPlayer Team

Playing 11sec.ac3.
libavformat version 57.56.101 (external)
Mismatching header version 57.56.100
libavformat file format detected.
[ac3 @ 0x768523a8]Estimating duration from bitrate, this may be inaccurate
[lavf] stream 0: audio (ac3), -aid 0
Load subtitles in ./
Forced audio codec: hwac3
Opening audio decoder: [hwac3] AC3/DTS pass-through S/PDIF
hwac3: switched to AC3, 448000 bps, 48000 Hz

AUDIO: 48000 Hz, 2 ch, ac3be, 448.0 kbit/29.17% (ratio: 56000->192000)
Selected audio codec: [hwac3] afm: hwac3 (AC3 through S/PDIF)
[AO_ALSA] alsa-lib: conf.c:4858:(parse_args) Unknown parameter AES0
[AO_ALSA] alsa-lib: conf.c:4991:(snd_config_expand) Parse arguments error: No such file or directory
[AO_ALSA] alsa-lib: pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM hw:0,1,AES0=6
[AO_ALSA] Format ac3be is not supported by hardware, trying default.
AO: [alsa] 48000Hz 2ch ac3le (2 bytes per sample)
The hw:0,1 device is the one that says IEC958/HDMI, but it doesn't work - I assume because it doesn't understand the AES0 parameter.

I think I really have to make the iec958 device appear, but I don't know what to do. For everyone else, installing the bcm2835.conf file seems to be sufficient. How can I debug whether it's even being read?

Posts: 3
Joined: Fri Aug 31, 2018 10:57 pm

Re: Passthrough multichannel audio over HDMI

Mon Sep 03, 2018 10:38 pm

Okay I finally figured it out. I don't understand why I had to do this on top of adding bcm2835.conf as described in the wiki, but adding this line to /usr/share/alsa/cards/aliases.conf:

Code: Select all

bcm2835_alsa cards.bcm2835
and rebooting resulted in the iec958 device appearing. And working perfectly once selected.

Return to “Troubleshooting”