decibel-audio-player wakes up more than necessary, causing power consumption

Bug #144034 reported by Emilio Pozuelo Monfort
4
Affects Status Importance Assigned to Milestone
Decibel Audio Player
Invalid
Undecided
Anonym25712

Bug Description

Hello François.

I've started powertop (sudo aptitude install powertop) to see how was my system going, and if it was possible for me to improve it, so it consumes less power, and the battery last more time.

And looking there, I've seen decibel has this:
   5.2% ( 10.1) python : schedule_timeout (process_timeout)

(the process is python, since /usr/bin/decibel-audio-player is a symlink, but that doesn't affect the result or the usability).

That means that it has ~ 10.1 wakeups per second. Although that's not a big number, it could be improved, and I won't be entirely happy until it doesn't have more than ~ 2 wakeups per second.

Take a look at http://www.linuxpowertop.org/ for more information.

For animate you, know that liferea (a feed reader) had ~ 200 wakeups per second, because of an error. There was a function where the unit was microseconds, and the number was 5000 (thinking in miliseconds). But it was 500 microseconds, and that meant every second it waked up 200 times.

That was changed to 500, so it now wakes up ~ 2 times per second, which is Ok.

Maybe decibel is checking the library or something every 100 miliseconds... hope you know it!

Cheers,
Emilio

Revision history for this message
Anonym25712 (anonym25712) wrote :

Hi,

Can you try to see if this isn't caused by GStreamer itself? You can use GStreamer from the CLI by using a command like this one:

gst-launch playbin uri=file:///home/ingelres/Music/track.ogg

Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote :

I don't think so, since decibel is stopped (just after startup).

If I start playing a song, it becomes:
   7.5% ( 13.5) python : schedule_timeout (process_timeout)

If then I pause it:
   9.3% ( 12.0) python : schedule_timeout (process_timeout)

and if then, stop it:
   5.7% ( 10.1) python : schedule_timeout (process_timeout)

So gstreamer seems to increase it, but not much.

We should try to get decibel at a lower rate when stopped, and that will also benefit when it's playing.

Revision history for this message
Anonym25712 (anonym25712) wrote :

Then I have absolutely no idea about what can cause this, since the only timer used in Decibel is created when playing a song, and it times out every 500ms. I'm sure the rate is correct because if I try to print something in the handler, I get 2 lines per second. When no song is played, Decibel simply does nothing and no timer is used.

Are you sure that powertop does not group all Python processes in one line? I can't use it because it needs a 2.6.21 kernel and I'm still using an Ubuntu Edgy (it has a 2.6.20 kernel).

Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote : Re: [Bug 144034] Re: decibel-audio-player wakes up more than necessary, causing power consumption

> Are you sure that powertop does not group all Python processes in one
> line?

Good point. I'll have to disable the symlink and call
decibel-audio-player via shell-script.

Changed in decibel-audio-player:
assignee: nobody → athropos
Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote :

Sorry for the delay, but I finally have it.

Playing a song:
   3.9% ( 13.3) decibel-audio-p : schedule_timeout (process_timeout)

When stopped:
   3.9% ( 10.0) decibel-audio-p : schedule_timeout (process_timeout)

So I guess the other results were right. Do you have any idea on what can be causing this?

Revision history for this message
Anonym25712 (anonym25712) wrote :

Currently not, but maybe I'll try to install the new Ubuntu Gutsy this week-end, and then I should be able to use powertop.

Revision history for this message
Anonym25712 (anonym25712) wrote :

This is caused by the call to gobject.threads_init(), which is needed to use threads together with PyGTK:

http://www.pygtk.org/docs/pygobject/gobject-functions.html#function-gobject--threads-init

The wakeups are not caused by the threads themselves, they are solely caused by this call. So, if there's an issue, it's in PyGTK.

Changed in decibel-audio-player:
status: New → Invalid
Revision history for this message
Anonym25712 (anonym25712) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.