[mythtv] Digital audio passthrough

James Courtier-Dutton james.dutton at gmail.com
Tue Sep 14 13:52:27 UTC 2010


On 14 September 2010 09:10,  <mythtv at meric.id.au> wrote:
>> I am an ALSA developer.
>> From your description of how myth works, I am amazed that AC3
>> passthrough ever worked.
>> The "device" open will override any mixer controls, so the iecset will
>> be forgotten once you open the device.
>>
>> The correct way to do AC3 passthrough is by opening the device with
>> the device name:
>> iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2
>> and not using any "iecset" utility.
>>
>> This is how xine does it, and it has always worked. I wrote the source
>> code in xine to do it.
>> When switching from non-audio to PCM, one has to close and open the
>> device again.
>
> Hmmm.. well, in my case it didn't work.
>
> The funny thing is that the device open doesn't actually clear the
> non-audio flag.  It isn't until you set the hw_params (and prepare the
> device), that it gets wiped out.
>
> Jean-Yves, if you happen to be making changes at some point in the
> future, I think that the snd_pcm_prepare() call in SetParameters() can
> be removed.  My understanding is that the snd_pcm_sw_params() call does
> this implicitly.
>

Using the device name I describe above is the only way to cover all
hardware types.
For example, some sound card hardware requires sample rate converters
switched off, and a different data path through the hardware in
addition to the correct iec bits being set.
Use of the iecset method does not cover these other requirements to
get AC3 passthrough working correctly on all sound card hardware
variants.

I consider open, hw_params and sw_params all part of the "open" task.
Until you have done all three, you cannot send sound samples to the card.

Kind Regards

James


More information about the mythtv-dev mailing list