[alsa-devel] [PATCH 0/2] alsa-lib: dynamically adapt the avail_min on the slave

Takashi Iwai tiwai at suse.de
Fri Nov 11 12:10:02 CET 2016


On Thu, 10 Nov 2016 08:34:41 +0100,
Jiada Wang wrote:
> 
> When configuring avail_min to multiple of slave period size it can happen
> that user waits one slave period longer than needed for available data. 
> Root cause is implicit grabbing of slave samples in avail_update operation. 
> On next entering poll, the slave will wait for the avail_min threshold 
> reached again, as he is not aware that there are already pending samples 
> in the above layer which are not yet provided to user. 
> Solution is to dynamically adapt the avail_min on the slave. 

Can you give a test case?  Then it's easier to check what's going on.

In general, I prefer having this only in the rate plugin, as the rate
plugin is the only one that suffers from the problem for now.
If the issue is really reproduced on other plugins, make it generic in
the plugin code later.

About your fix: the dynamic changing sw_params is hackish, so I wonder
whether it's the best solution.  Let's see.

Last but not least, please try to fit within 80 chars like kernel
patches.  It's not strictly required for alsa-lib codes, but still the
too long lines like in your patches are difficult to read.


thanks,

Takashi


More information about the Alsa-devel mailing list