[pulseaudio-discuss] Dynamic growth of buffer size
kurt.taylor at linaro.org
Mon Jan 24 07:21:51 PST 2011
On 20 January 2011 16:45, pl bossart <bossart.nospam at gmail.com> wrote:
> > Along with increasing the buffer size, the tsched wakeup watermark will
> > 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
> > underruns before using powertop. On my PC, it seems like the process for
> > decreasing the watermark is very aggressive, maybe to the point of
> > more underruns than needed.
> > I plan on doing more testing, but on an ARM based platform, obviously, I
> > looking for a buffer growth tuning for ARM that will reduce CPU wakes.
> > dynamic growth, I am thinking that with the check_left_to_play
> > when woken by a timeout, it would be a good time to try to increase
> > size and hopefully allowing ARM to go to a lower power state on long
> > 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
> 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.
Thanks for your reply Pierre.
I am still learning and so I spent some time this weekend experimenting. I
tried again to show larger buffer size would help, but there was really very
little difference, just as you suggested. I then tried to change the buffer
size during a playback, when we woke on_timeout in alsa_sink.c and
snd_pcm_hw_params failed. In fact, due to the failure, the module was
I will do more experimentation on watermark reduction and auto-timing update
with relationship to latency and learn that code better. I was wondering if
you could elaborate on what you had on your TODO list for this area with
regards to smoother parameters.
I am following the dynamic sample rate discussion as that also may help CPU
on ARM. Any other comments and suggestions of areas to look at would also
Kurt Taylor (irc krtaylor)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pulseaudio-discuss