[mythtv] Digital audio passthrough

mythtv at meric.id.au mythtv at meric.id.au
Tue Sep 14 06:47:22 UTC 2010

> I've confirmed that the non-audio flag is set correctly, but gets unset by the snd_pcm_hw_params() call in AudioOutputALSA::SetParameters().  
> I'm assuming this isn't normal ALSA behaviour, as everyone else would be complaining about it?

Disclaimer: I'm not an expert on ALSA... The comments below are based on examination of the code for the ALSA libraries, mythtv and mplayer.  I may be totally wrong with my conclusions.

As it stands, the mythtv audio code enables the non-audio flags (AES0) on the sound device via some code which appears to have been lifted from the iecset utility.  As this flag cannot be changed once the device is open, the code does the equivalent of an "iecset audio off" call prior to opening the output device.

In my installation, this doesn't work, as the AES0 flag is reset during the hw_params initialisation of the audio device.  This appears to be by design in my version of ALSA (1.0.21), as the ctl_elems are initialised from the default config (rather than from whatever config happened to be running at the time).

Older versions of mplayer created a custom ALSA config with the appropriate flags set and used this to open the audio device.  The current version appears to have done away with this code and simply adds the AES0 flags to the device name before opening.

I've made a crude change to audiooutputalsa.cpp to replicate the current mplayer behaviour, and this seems to have fixed my problems with enabling passthru mode on the sound device without requiring the use of the alternate device name in advanced settings.


More information about the mythtv-dev mailing list