Ticket #114 (closed enhancement: fixed)

Opened 5 years ago

Last modified 4 years ago

Reduce the wakeups for the audio hardware (powertop profiling)

Reported by: coling Owned by: lennart
Milestone: 0.9.7 Component: daemon
Keywords: Cc:

Description

While incidentally discussing pulseaudio with someone (Amaranth) on IRC on #compiz-fusion-dev he mentioned the killing effect on battery life with pulseaudio.

Using the tool "powertop" I profiled pulseaudio.

The largest culprit seems to be the sound device:

  33.5% (250.4)       <interrupt> : uhci_hcd:usb2, HDA Intel

Killing pulseaudio and those 250 wakeups disappear off the register!

Amaranth reckons it would be hard to get it below 48/second due to 48KHz audio but still 250 seems pretty high.

Is there anything that can be done?

Col

Change History

Changed 5 years ago by cjvdb

You can decrease the interrupt rate by adjusting the fragments and fragement_size parameters to the module-alsa-sink/-source modules (Which means you have to load them manually instead of using module-hal-detect or module-detect). That increases latency though, so it might not be a good thing if you are using pulseaudio in combination with realtime audio applications (like voip for example). There is no other workaround for this at the moment because alsa doesn't allow applications to dynamically change fragment sizes on the fly, so pulseaudio has no option but to pick a default fragment_size value that works well for the most applications.

In addition to that, unfortunately, pulseaudio causes interrupts even when idle because it plays silence (to avoid audio hardware popping whenever the device is opened). That is a known problem and AFAIK a workaround is on Lennart's todo list. Until that workaround is avaliable the only other option is to use pulseausdio's autoload feature to load/unload the sink/source modules on demand.

Changed 4 years ago by lennart

  • status changed from new to assigned

The "lennart" branch of PulseAudio now contains a module "module-suspend-on-idle" which closes all audio devices when they are idle. This brings the number of interrupts to zero when nothing is played.

Changed 4 years ago by lennart

  • milestone set to 0.9.7

Changed 4 years ago by lennart

  • status changed from assigned to closed
  • resolution set to fixed

Commited to trunk.

Note: See TracTickets for help on using tickets.