GNOME Bugzilla – Bug 355491
be nice with IDLE_HZ
Last modified: 2007-02-07 11:44:28 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.
(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.
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 ***