GNOME Bugzilla – Bug 330716
CD support isn't very smart
Last modified: 2006-10-09 13:22:37 UTC
1) Why is rhythmbox polling my drive once every second? That's what we have HAL for. 2) Why is it polling the drive *when it's playing the same drive*? It should know enough that it's playing the drive as opposed to getting multiple -EBUSYs on open every second. (Oddly, it appears to poll once per second when it's not playing, and twice per second when it is....) This is with 0.9.3.1-1, on x86_64.
a) Rhythmbox works on non-HAL systems b) whether we can use the other methods depends on whether gnome-vfs was compiled with HAL support. Also, Rhythmbox can be compiled with HAL support when gnome-vfs wasn't, and vice versa. This means that we need another method of detection that works when HAL-based methods won't. We do the same thing that that Sound-Juicer does, monitoring the state of the drive-door (using nautilus_burn_drive_door_is_open()), and checking for cds whenever it changes from open to closed. I wouldn't have thought using that would cause too many problems, but if it's causing issues we may need to re-think doing it.
sound-juicer doesn't directly poll the drive door any more. It uses n-c-b drive monitoring (which either uses HAL or does polling). g_object_set (drive, "enable-monitor", TRUE, NULL); This was added for 2.13 so we should probably use it for at least the systems that support it.
As for causing issues, I'd think that polling *while playing* the drive could certainly be disabled (as it's not going to work in any case.) I did notice rb freaking if I eject the CD while playing it; will try and get a more sane trace.
I agree about not polling the playing drive. I'll whip up a patch for RBRemovableMediaManager that does this. Bill: do you have the cdparanoia plugin installed, or the cdio one? (use "gst-inspect cdparanoia" and "gst-inspect cddasrc" to check). If you have the cdparanoia plugin, and not the cdio plugin, then Rhythmbox hanging when you eject the cd while playing is to be expected. It is a problem with the cdparanoia library, that can't be fixed with API redesign, and will affect any application using libcdparanoia.
Yeah, I have the cdparanoia one installed.
Created attachment 59395 [details] [review] patch to polling of playing drive This stops polling for the drive we are playing from. I think it should work if you remove a cd while playing on a non-HAL system, but I haven't tested it.
Patch committed to cvs. Using the monitoring from libnautilusburn 2.13 sounds good.
(In reply to comment #7) > Patch committed to cvs. Patch seems to have broken build: gcc -DHAVE_CONFIG_H -I. -I. -I.. -DGNOMELOCALEDIR=\"/usr/local//share/locale\" -DG_LOG_DOMAIN=\"Rhythmbox\" -I.. -I../lib -I../metadata -I../player -I../rhythmdb -I../widgets -I../sources -I../iradio -I../podcast -I../remote -I../remote -DPIXMAP_DIR=\"/usr/local//share/pixmaps\" -DSHARE_DIR=\"/usr/local//share/rhythmbox\" -DDATADIR=\"/usr/local//share\" -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -DORBIT2=1 -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libgnomeui-2.0 -I/usr/include/libgnome-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/libbonoboui-2.0 -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/bonobo-activation-2.0 -I/usr/include/libxml2 -I/usr/include/libglade-2.0 -I/usr/include/gnome-vfs-module-2.0 -pthread -I/usr/include/gstreamer-0.10 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -pthread -DORBIT2=1 -I/usr/include/totem/1/plparser -I/usr/include/gtk-2.0 -I/usr/include/libxml2 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/gnome-vfs-module-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/bonobo-activation-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/include/libnautilus-burn -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/config -D_XOPEN_SOURCE -D_BSD_SOURCE -I../remote/bonobo -I../daapsharing -I/usr/include/libsoup-2.2 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -O2 -Wcomment -Wformat -Wnonnull -Wimplicit-int -Wimplicit -Wmain -Wmissing-braces -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused-function -Wunused-label -Wunused-value -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wall -Werror -std=gnu89 -MT rb-removable-media-manager.lo -MD -MP -MF .deps/rb-removable-media-manager.Tpo -c rb-removable-media-manager.c -fPIC -DPIC -o .libs/rb-removable-media-manager.o cc1: warnings being treated as errors rb-removable-media-manager.c: In function 'rb_removable_media_manager_playing_uri_changed_cb': rb-removable-media-manager.c:420: warning: implicit declaration of function 'nautilus_burn_drive_new_from_path' rb-removable-media-manager.c:420: warning: nested extern declaration of 'nautilus_burn_drive_new_from_path' rb-removable-media-manager.c:420: warning: assignment makes pointer from integer without a cast rb-removable-media-manager.c:429: warning: assignment makes pointer from integer without a cast make[3]: *** [rb-removable-media-manager.lo] Error 1 make[3]: Leaving directory `/home/alex/src/remote-cvs/gnome.org/rhythmbox/shell'make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/alex/src/remote-cvs/gnome.org/rhythmbox/shell'make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/alex/src/remote-cvs/gnome.org/rhythmbox' make: *** [all] Error 2 Backing out the 1.14 version of rb-removable-media-manager.c via: $ cvs up -r 1.13 rb-removable-media-manager.c allows the build to proceed.
Created attachment 59559 [details] [review] fix compilation Oops, I forgot to check when the function was added. This should fix it.
Works for me.
Committed to cvs.
I am experiencing other symptoms from this issue. I've got a system here on which rhythmbox appears "slow" due to the CD polling. It seems that the syscall is hanging for 1/2-1 second waiting for the drive to time out, blocking the GTK thread. I can also confirm that it is because of the CD polling, because when I "chmod 000 /dev/hd{c,d}", rhythmbox starts acting normally. When I chmod them back to 600, it starts acting up again. Reading the previous comments, I don't understand why rhythmbox keeps polling on HAL-enabled systems such as this one. Shouldn't it only poll on non-HAL systems?
This polling is disabled in RB HEAD when used with libnautilus-burn >= 2.15.3. So I think this can be considered fixed.
Marking FIXED as per last comment.