[vlc-devel] [remi at remlab.net: Re: [PATCH] sndio: Updated sndio backend which actually works.]
Alexandre Ratchov
alex at caoua.org
Wed Jun 27 19:24:34 CEST 2012
On Wed, Jun 27, 2012 at 03:05:22PM +0300, Rémi Denis-Courmont wrote:
> > >
> > > This cannot possibly work. The buffer might have underrun a million times
> > > before Pause(..., false, ...) is called.
> >
> > I don't understand. Once Pause(true) is called, playback is stopped
> > until enough data is written and buffered. Since Play() is not called
> > during pauses, I don't understand what buffer would underrun.
>
> That's exactly why it will underflow.
Sorry, I don't understand. Which buffer are you talking about?
Would some internel VLC buffer overrun? or would sound card DMA
buffer underrun? The sound card DMA buffer can't underrun because
DMA remains stopped all the time. And I see no code to tweak VLC
buffers in other audio modules. Am I missing something?
Anyway Pause works AFAICS.
> > > > -static void Pause (audio_output_t *aout, bool pause, mtime_t date)
> > > > +static void Flush (audio_output_t *aout, bool wait)
> > > >
> > > > {
> > > >
> > > > - struct sio_hdl *sio = (void *)aout->sys;
> > > > + struct aout_sys_t *sys = (struct aout_sys_t *)aout->sys;
> > > > +
> > > > + sys->delay = 0;
> > > > + (void)wait;
> > > > +}
> > >
> > > Doing nothing in Flush() cannot be right.
> >
> > IIRC, if playback is stopped (i.e. sio_stop() is called, which is
> > non-blocking), then sound doesn't work at all: Flush() keeps being
> > called continuously. Doing nothing in Flush() keeps audio smooth.
>
> The point of flush is to stop streaming immediately. Without flush, the sound
> would continue until the buffers are empty, up two seconds after the Stop,
> Prev or Next button press... That's terrible user experience.
I agree. But I still don't understand why Flush() is called
continuously; this makes audio stutter, which is yet more terrible
user experience.
Any hints on how to debug & fix this?
Thanks
-- Alexandre
More information about the vlc-devel
mailing list