[vlc-devel] aout: push vs pull

Artem Baguinski artm at v2.nl
Thu Nov 15 12:45:44 CET 2007


I have implemented my OpenAL aout as a push plugin: there is Play
function which is being called when vlc decides that it has to be.

I had to play around with buffer size on OpenAL side AND with OpenAL
backend settings until I got it sound OK. OpenAL doesn't have any
callback or synchronization mechanism to inform the API user that it
is done playing a buffer - you've got to ask it when you think it's
about time.

Now, under some conditions, the sound starts to "chop", I'm not sure
why - I'm not getting buffer underrun messages from my plugin. To
stress test the plugin I make it play, then execute 'make -j2 clean
all' in some source tree and chopping seems to correlate with linking
(any idea what is it about the linker that makes it such a good stress
simulator? I'd like to write/find an utility to do just that then).

I've noticed that ....XXX.... other aout plugins don't play back in
Play, but either keep it empty or use it to communicate with the
actual playback thread. Also someone told me on #videolan that such
pull-from-output-thread behaviour is preferred to push, but I'd like
to understand why. I'm going to imlement pull playback anyway - it
will allow multiple instances of OpenAL aout plugin to share a single
output thread and make it easier to streamline/synchronize access to
OpenAL API. But I would like to understand this push vs pull business



More information about the vlc-devel mailing list