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 330716 - CD support isn't very smart
CD support isn't very smart
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: Removable Media
0.9.3
Other All
: Normal enhancement
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-02-10 19:51 UTC by Bill Nottingham
Modified: 2006-10-09 13:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to polling of playing drive (5.21 KB, patch)
2006-02-15 08:23 UTC, James "Doc" Livingston
committed Details | Review
fix compilation (2.47 KB, patch)
2006-02-17 08:44 UTC, James "Doc" Livingston
committed Details | Review

Description Bill Nottingham 2006-02-10 19:51:27 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.
Comment 1 James "Doc" Livingston 2006-02-11 12:27:03 UTC
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.
Comment 2 William Jon McCann 2006-02-13 16:33:16 UTC
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.
Comment 3 Bill Nottingham 2006-02-13 16:41:07 UTC
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.
Comment 4 James "Doc" Livingston 2006-02-14 08:41:57 UTC
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.
Comment 5 Bill Nottingham 2006-02-14 17:09:46 UTC
Yeah, I have the cdparanoia one installed.
Comment 6 James "Doc" Livingston 2006-02-15 08:23:26 UTC
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.
Comment 7 James "Doc" Livingston 2006-02-17 03:08:17 UTC
Patch committed to cvs.

Using the monitoring from libnautilusburn 2.13 sounds good.
Comment 8 Alex Lancaster 2006-02-17 05:59:20 UTC
(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.

Comment 9 James "Doc" Livingston 2006-02-17 08:44:26 UTC
Created attachment 59559 [details] [review]
fix compilation

Oops, I forgot to check when the function was added. This should fix it.
Comment 10 Alex Lancaster 2006-02-17 10:02:28 UTC
Works for me.
Comment 11 James "Doc" Livingston 2006-02-17 10:22:54 UTC
Committed to cvs.
Comment 12 Fredrik Tolf 2006-05-20 20:47:55 UTC
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?
Comment 13 William Jon McCann 2006-06-07 20:33:02 UTC
This polling is disabled in RB HEAD when used with libnautilus-burn >= 2.15.3.  So I think this can be considered fixed.
Comment 14 James "Doc" Livingston 2006-10-09 13:22:37 UTC
Marking FIXED as per last comment.