Mailing List archive

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

[vdr] Re: bitstreamout-0.48pre5



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 30 October 2003 12:31, Dr. Werner Fink wrote:
> On Thu, Oct 30, 2003 at 02:56:47AM +0100, Sven Goethel wrote:

> > and you are right .. usleep distorts audio out ..
>
> Simply by adding/setting a calcuated offset to setup.opt.delay.
>

good .. thx.

> > +++
> >
> > hmm .. or else ;-)
>
> First of all, the channel owner on transponder 11837 (ARD group)
> has to be informed that their audio setup is broken and cause
> shuttering audio.
>
> For the 1-2ms decoding time: this should not be a problem
> because you get MP2 audio in blocks (0.5ms), decode them (1-2ms),
> put them into the hw buffer of the sound card (0.5ms) ... and the
> block takes some _more_ ms ... that means we've enough time if we
> switch from 32ms PCM buffer to a buffer size fitting the _minimal_
> MP2 audio block size used by the libmad,  I guess its less than 32ms
> if not the SPDIF_BURST_SIZE has to be increased and a new
> cpp macro AC3_BURST_SIZE has to introduced with the old value of
> SPDIF_BURST_SIZE.
>

thats a good point .. incr. the responsiveness ..

well, since decoding on the player side (pre6),
the responsiveness is allready increased ..

so i try out the 32ms buffer size paradigma with skipping pcm
samples .. against an accumulated delay.

hopefully this ain't ghost hunting, and the stc value isn't insane 
at all ;-)

so the next sync trial migth be:

t0 - Receive
	- player/receiver call/thread
	- delay_sum += stc-pts
t1	- optional mp2 -> pcm decoding
t2		- delay_sum += t2-t1
t3	- if buffer zero and t3_mark zero 
		then set time mark t3_mark
t4	- store data in buffer

t10 - Forward (bo.action thread)
	- if t3_mark 
		then delay_path = t10-t3_mark, zero t3_mark
	- delay_sum += delay_path
	- skip as much data/samples to reach delay_sum->0
		delay_sum -= skipped_samples*samples/time
	- if delay_sum<0 setup.opt.delay=delay_sum*-1
	- play rest
... ??

> And ... then we may see a timing problem between the normal time
> used by the channel and the quart of the sound card, normally
> those are NOT in sync.  This leads to underruns or overruns.  With
> my setup I get underruns (the quart of the CMI8738 is about 100ppm
> faster then the clock of Pro7).  To avoid underruns the bitstreamout
> plugin repeats on the lower hw sound buffer boundary every fourth
> frame upto the upper sound buffer boundary.  In the case of overruns
> the plugin simply skips frames.  This works very well with AC3.
>
> Maybe for plain PCM it is better to repeat or skip a few stereo
> samples (one stereo sample are two unsigned shorts).  This should
> be done before the data is stored into pcm stream scanner. The
> best point for repeating or skipping is a part where left and
> right channel has similar values and this value is used a longer
> time (e.g. silence).
>

will keep this in mind for the next sync trial
>
>       Werner

thx a lot

sven
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/oRxoHdOA30NoFAARAutaAJ450RQvTEaWB3S0lGMDVZrmvrxCxQCgk5Q3
zsv0HsOWkpntTOXcP3MOes0=
=cuud
-----END PGP SIGNATURE-----



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



Home | Main Index | Thread Index