[MPlayer-dev-eng] About the future - libao2

Arpi arpi at thot.banki.hu
Wed Nov 7 03:23:36 CET 2001


Hi,

> > no. my plan:
> > video codec -> libvo2 core -> libvo2 driver

> I think that your idea of having a conversion layer before the output
> layer is very good and that it should be extended to libao2 as well:
> 
> audio codec -> libao2 core -> libvo2 driver
you mean libao2, right? :)

> What to do with sync (I tried to read the source but gave up (didn't
> know where to start))? I have a few suggestions though.
most (all :) libao2 drivers has some buffering (usually in hardware or dma
buffers in kernel) which cause some delay. this delay is usually around 0.3
sec for 44khz audio, but in some extreme cases (alsa driver with fixed 192k
buffer, low audio samplerate, mono) it can be up to many seconds.
mplayer's A-V sync code requires this value for correct timing.
currently, it asks libao2 driver how many bytes are in the buffer, and
divides by bytes/sec (sh_audio->o_bps) to get delay in secs.
But, if you change playback rate of soundcard, it will calc false delay
(bytes divided by input srate). yes, it can be fixed of course ;)

btw, thinking about libao2 (triggered by this mail :)) i've found that i'm
silly :)
get-delay() should return seconds (in float or millisec), so mplayer
shouldn't care about libao2 resampling and stuff.

> With support I could start making the guidelines for how libao2 could
> look? If anyone else is working on this already just tell me, I don't
> want to start a fight :)
afaik, nobody is working (or thinking) about libao2.
so, feel you free to help us designing and implementing it!

the only thing i expect: keep current buffering method, i mean:
- provide a method which returns how many bytes (or samples?) can be
  played without blocking (required for singlethreaded design)
  (currently it's get-space())
- provide a method to query current delay (both your buffers (for resampling
  or other effects) and soundcard's buffering)
- use the general, extendable control() interface for driver-specific things.
  it's like ioctl()'s.
- thinking about: some codecs (mp3lib, ffmpeg?) can do some work about
  effects, resampling (1:2, 1:4 for mp3), mono<->stereo.


A'rpi / Astral & ESP-team

--
mailto:arpi at thot.banki.hu
http://esp-team.scene.hu



More information about the MPlayer-dev-eng mailing list