After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 355491 - be nice with IDLE_HZ
be nice with IDLE_HZ
Status: RESOLVED DUPLICATE of bug 399012
Product: rhythmbox
Classification: Other
Component: general
0.9.5
Other Linux
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-09-11 20:34 UTC by Benoît Dejean
Modified: 2007-02-07 11:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Benoît Dejean 2006-09-11 20:34:50 UTC
In order to save more power, it's nice to avoid useless context switches. 
Stracing RB shows two main patterns :

1) As far as i understand, RB starts a child process for each new track. Stracing this process shows that it loops like this :

- poll on /dev/snd/timer, for 500ms
- timeout, nothing to do
- semop
- shmctl IPC_STAT
- semop

2) The main process itself loops :
- poll for 35ms
- timeout, nothing to do

It would be nice if RB could wake up less frequently.
Comment 1 Jonathan Matthew 2006-09-11 22:36:31 UTC
(In reply to comment #0)
> 1) As far as i understand, RB starts a child process for each new track.
> Stracing this process shows that it loops like this :
> 
> - poll on /dev/snd/timer, for 500ms
> - timeout, nothing to do
> - semop
> - shmctl IPC_STAT
> - semop

This is what alsa does when dmix is enabled.

> 2) The main process itself loops :
> - poll for 35ms
> - timeout, nothing to do

A lot of this will be due to gnome-vfs file monitoring (which is easy to disable).  Rhythmbox has a few timeouts longer than one second, for which we could use g_timeout_add_seconds (if available), and it also has a 5Hz timer for updating the elapsed time (even when not playing, which is kind of dumb).  We could probably remove this by using a gstreamer pad probe to watch the timestamps on buffers being fed into the audio sink.
Comment 2 Jonathan Matthew 2007-02-07 11:44:28 UTC
There are more useful details on bug 399012, so I'm marking this one as a duplicate.

*** This bug has been marked as a duplicate of 399012 ***