[pulseaudio-discuss] Dynamic growth of buffer size

pl bossart bossart.nospam at gmail.com
Thu Jan 20 14:45:27 PST 2011


> Along with increasing the buffer size, the tsched wakeup watermark will need
> to be increased, although my initial prototype code did not do that. I
> waited until the watermark increased to the point where there were no more
> underruns before using powertop. On my PC, it seems like the process for
> decreasing the watermark is very aggressive, maybe to the point of causing
> more underruns than needed.
>
> I plan on doing more testing, but on an ARM based platform, obviously, I am
> looking for a buffer growth tuning for ARM that will reduce CPU wakes. For
> dynamic growth, I am thinking that with the check_left_to_play (alsa-sink.c)
> when woken by a timeout, it would be a good time to try to increase buffer
> size and hopefully allowing ARM to go to a lower power state on long plays.
> The buffer would be set back to normal default when rewinding, etc.

You can't really change the size of the buffer, it's defined when you
define the hw_params. You can only change the timer value. It think
the 'buffer growth' you want is already handled by the concept of
latency.
We've also experimented with larger buffers. It's not clear to me that
you really benefit from 8+ sec buffers. You have other wake-ups in the
system that will reduce the benefits of long sleeps. Also as you said
the timer watermark needs to take the tlength into account, a fixed
initial value isn't very good.
And last there is still a wake every 1.5s due to the auto-timing
update. It would need to be changed to depend on the latency value.
It's been on my TODO list but I still don't understand how the
smoother parameters need to be changed.
-Pierre



More information about the pulseaudio-discuss mailing list