[MPlayer-dev-eng] [RFC] hack around desync on OSS pause

Sven Gothel sgothel at jausoft.com
Sun Apr 29 10:03:48 CEST 2007

On Sunday 29 April 2007 at 01:28, Reimar Döffinger wrote:
> Hello,
> On Sat, Apr 28, 2007 at 09:02:58PM -0400, Rich Felker wrote:
> [...]
> > The functionality is not needed in the driver. Just make ao_oss keep a
> > copy of whatever audio it's submitted, and on pause, check the current
> > delay/position in the buffer, then resubmit those samples after
> > unpause.
> Um. Normally you don't advocate code bloat and waste of
> memory and CPU time (> 2MB/s is a possible value even if you disregard
> the really insane audio sampling rates and channel counts that are
> actually possible and in (rare) use), esp. for something that in my
> uneducated eyes seems almost trivial to do in the driver (though it
> would conflict with closing the device on pause).

Well, last time I programmed an QNX a/v out driver thread using ALSA 0.5 ;-),
it was possible to get the number of digested samples from the soundcard,
which allowed us to stay in sync with the other components.

I have learned, that you need to keep track of the DTS (Decoding Time Stamp),
the time when it has to be decoded,
and the PTS (Presentation Time Stamp), 
the time where the audience receive the data (incl. the time the sound reaches your ear ;-).
PTS and DTS shall be available through the diplexer, 
which shall receive it through the stream.

Having the number of digested samples by the hardware
is necessary to respond reasonable to the diplexer.
No under/overflows .. and we can avoid huge buffers.

IMHO .. this must exist in the current ALSA version as well.

Just my 2 cents ..

Cheers, Sven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070429/4b6a08cb/attachment.pgp>

More information about the MPlayer-dev-eng mailing list