Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: AC3 with -a



On Fri, Dec 13, 2002 at 05:09:08PM +0100, Harald Milz wrote:
> Dr. Werner Fink <werner@suse.de> wrote:
> > underrun problem of the sound buffer of the CMI 8738 sound chip (the
> > reference clock is about 150ppm faster than the rate of the live
> > AC3 stream from Pro7).
> 
> Huh - is there no way to "slave" the clock to the stream? Like SPDIF
> reception? 

I've worked on the CMI driver of ALSA, read the docs and have
one connection with people of C-Media  ... No way.
Some high price cards like RME96 can switched into slave mode 
on the internal S/P-DIF connector ... but you need 250 Euro
for such a card ... together with a DVB card having a S/P-DIF out.

The problem is, that the AC3 stream is read from the DVB
card via PCI and put (after warping it into PCM) to a
sound card by using ALSA interface.  Now if the clock of
the sound card can not switched to slave mode with the
S/P-DIF out of the DVB card you'll hear all few minutes a
reset done by the ALSA driver ...

It was a hard work to solve this problem for the underrun
case (now I'm using an upper and lower boundary for checking
the buffer fill grade ... in the case of crossing the lower
boundary my LiveAC3 thread send every fourth AC3 frame twice
upto the upper boundary where the first frame has the error
bit set in the magic PCM start header ...).

In case of an overrun you lose ;^)
... this because every AC3 frame represents 1536 16bit audio samples
(32ms at 48kHz).  No sample can be dropped/added or the decoder of the
A/V receiver will lose the sync with the S/P-DIF rate.  The S/P-DIF
rate is the bi mark phase stream composed out of a 32bit data
stream (preamble + aux + padding + 16bit data + validity+user+status+parity bit)
and the doubled clock reference (96kHz) ...


     Werner


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index