[mythtv] [mythtv-commits] Ticket #6569: ac3 level is low for 5.1 source

Jean-Yves Avenard jyavenard at gmail.com
Thu May 6 07:42:06 UTC 2010


On 6 May 2010 16:33, Mark Spieth <mark at digivation.com.au> wrote:
> this is an error in decoding AC3 frames. My current ac3 fixup uses the CRC
> checking code and it doesnt happen any more. Ill send you my ac3 patch
> directly for review.

interesting..

On that particular recordings that lead to checking how often the
stream changed, I don't recall seeing AC3 decoding error...

Don't you have commit access ?
I thought I had seen stuff from you earlier..

For those kind of fixes, I'm probably not the best person to review
them. Janne is the one mainly dealing with avfd

>
> with this code mono cant be upmixed to 6ch (old stuff anyway)

Actually, mono is only ever *upmixed* to stereo. When I say upmix, all
I do is copy it to both left and right channel.

Previously, playing mono stream was broken.
aobase would try to open the audio card as mono, which would fail for
more device and you then get no sound at all, or garbage

So when I get a mono stream, I make it look like a stereo one.

> AddSamples pushes data to dataflow chain. only when all processing elements
> have done their jobs is it put into the sound buffer. the sound buffer is
> only in native outputchannel format. any other buffering due to
> insufficiency of data is stored in each of the processing elements. this is
> true of freesurround and soundtouch. format conversion is done by
> freesurround if necessary so that anything put into soundtouch is already
> what it should be. on an input #channel change (assuming all other params
> remain the same i.e. rate etc) freesurround would flush its input buffer
> through the processing and append new data appropriately. no hiccups.

Have you had a look at the hdaudio branch code ?

the outputchannel format can change.. It used to only be S16 (well, it
could be U8, but no one used it).

I guess some examples can speak better ..

So you are playing mp3 audio, 16 bits 2 channels, 44.1kHz.
this is upmixed

audio buffer contains what the audio card states to accept
so it opens the card, 6 channels, FMT_S16, 44.1kHz

Now you get to play a 6 channels AAC track, 48kHz
so it's still 6 channels.
but you need to reconfigure the card from 44.1 to 48

Now you play E-AC3 track
6 channels, FMT_S32, the card reports FMT_FLOAT
you have to reconfigure the card for that.
as aobase will select FLOAT if available , so there's no
downconversion happening.

So when there is a format change, we do an unconditional reset of the
audio settings and recalculate them.

Sure enough, if there's no changes as to what the audio card will
ultimately see we could do things differently.
By the time Reconfigure is called, the audio buffer has already been reset.

And the call to reconfigure the audio output occurs outside the audio
code btw...


More information about the mythtv-dev mailing list