[vlc-devel] [PATCH] ALSA: set periods before setting buffer time

Rémi Denis-Courmont remi at remlab.net
Mon Mar 12 17:54:10 CET 2012

Le lundi 12 mars 2012 18:41:04 Edward Sheldrake, vous avez écrit :
> 2012/3/11 Rémi Denis-Courmont <remi at remlab.net>:
> > Le dimanche 11 mars 2012 17:16:04 Edward Sheldrake, vous avez écrit :
> >> Fixes "cannot set buffer duration near 3000000 us: Invalid argument"
> >> error, resulting in no sound, with HDA audio hardware and 44100Hz
> >> sources.
> > 
> > Err? Is this really correct and not a driver bug? This reorder seems to
> > put an extra constraint before selecting the buffer size. This may cause
> > a smaller buffer size to be selected than would be available with more
> > periods, if I read the documentation correctly.
> Perhaps it should be an ALSA bug - without the patch, ALSA chooses a
> buffer time of (3000090 3000091) which it then finds unacceptable
> (alsa fails to refine the remaining parameters), with the patch it
> chooses a buffer time of (2999727 2999728).

Well that is OK in that acse. But if the hardware has a small maximum period 
duration, then your proposal will end up selecting a smaller total buffer 
duration instead of more periods.

I mean the case where:
 minimum_periods * maximum_period_time < maximum_buffer_time

At the very least, a minimum buffer duration should be enforced before the 
first period value is selected, I'd say. But ALSA is so well documented...

Rémi Denis-Courmont

More information about the vlc-devel mailing list