xfmedia: wakeups per second in idle, play time

Kok, Auke sofar at foo-projects.org
Thu May 31 20:02:46 CEST 2007


Brian J. Tarricone wrote:
> On Thu, 31 May 2007 10:39:41 -0700 Kok, Auke wrote:
> 
>> I started looking with powertop at some multimedia apps, which is
>> highly interesting since those generally need to poll to keep buffers
>> filled and thus are suspect of having lots of wakeup events.
>>
>> xfmedia is doing rather poorly at 200 wps in idle mode. I suspect this
>> is due to a gfx/display update ticker. When not playing songs this can
>> be completely eliminated...
> 
> Yeah, that kinda sucks.  I'm not really sure why, though.  It only
> updates the time counter once per second (I feel like this is disabled
> when idle, but I don't remember).  xine-lib must be doing a bunch of
> crap for some reason.
> 
>> During songplay (audio only) the wps rises to 2000 per second. That's
>> just way too much :)
> 
> Sounds pretty normal to me.  Not much I can do about it anyway.
> xfmedia itself should only be doing the same stuff as in idle, plus
> a once-per-second time counter update, plus whatever xine-lib is doing.
> 
>> Then ogg123/mpg123 kick everyones butt, getting down to about 40 wps
>> during songplay. I suspect that even that is really a lot higher than
>> needed, as generally you can buffer more than a second or two before
>> needing to refill it, so technically we should be able to listen to
>> audio with 1wps :)
> 
> I really feel like this is kinda useless here.  The media player is
> shoving data at the sound card, and the sound card is probably
> generating interrupts like mad.  If you're actually *doing stuff*, what
> do you expect?  The CPU has to do work.  I think using powertop to
> examine computers that are idle is useful, but not so much when
> applications are actually doing things.  Obviously you can use powertop
> to find applications that you'd rather aren't doing things, but a media
> player kinda defeats that.  While it's playing, it's *always* doing
> stuff.

the difference between 40 wakeups per second to play audio (results in 25 
MILLISECONDS of sleep time in between) and 2000 (at which point the CPU *never* 
goes into C3 sleep) is gigantic, that probably doubles your battery life.

I'm not even looking at the audio interrupts, those are actually not accounted 
for on xfmedia/audacious behalf at all, and nowhere near as high as 2000 (about 
40 per second when playing with xfmedia). I suspect that xfmedia or xine is just 
monitoring the buffer level at those insane intervals, instead of just having 
the hardware do it's thing and going to sleep for (say) half a second.

Yoru argument about 'using powertop to profile activity being useless' is 
stupid, and by switching to a media player that achieves *the exact same thing* 
with much less work (and getting an hour extra battery life or so) I obviously 
prove my point..

>> I've pinged the audacious folk and they might look at it. perhaps
>> Brian or someone else interested can look at xfmedia.
> 
> Perhaps... I hardly have time to work on xfmedia at all these days.  If
> you don't file a bug, I'll likely forget about it in about an hour.

that's fine. I think xine itself is largely to blame for the playback wps, so I 
might drop them a bug. Meanwhile
> 
> 	-brian
> 
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> http://foo-projects.org/mailman/listinfo/xfce4-dev



More information about the Xfce4-dev mailing list