Bug 207177 - handles CD change badly
handles CD change badly
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gnome-vfs2 (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bastien Nocera
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-09-19 16:24 EDT by Bill Nottingham
Modified: 2014-03-16 23:02 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-03-05 10:02:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
CD device entry (2.94 KB, text/plain)
2007-02-21 14:37 EST, Bill Nottingham
no flags Details

  None (edit)
Description Bill Nottingham 2006-09-19 16:24:49 EDT
Description of problem:

When I manually switch CDs without using the UI, gnome-cd does not
really cope well at all - it either then errors, or leaves the
old CDDB info up, etc.

Version-Release number of selected component (if applicable):

2.16.1-2.fc6

How reproducible:

Every time

Steps to Reproduce:
1. play cd
2. switch cd
3. attempt to play again
Comment 1 Bastien Nocera 2007-02-21 13:45:10 EST
Switch CD, how?

That probably means that HAL isn't picking up that the CD changed. Does the
audio CD appear/disappear from the desktop?
Comment 2 Bill Nottingham 2007-02-21 14:09:10 EST
Right click on desktop icon, choose 'eject'.

The desktop icon remains, gnome-cd still tries to play, etc.
Comment 3 David Zeuthen 2007-02-21 14:16:10 EST
(In reply to comment #2)
> Right click on desktop icon, choose 'eject'.
> 
> The desktop icon remains, gnome-cd still tries to play, etc.

This sounds like either a gnome-vfs bug or a hal bug. Does hal notice the device
go away? lshal --monitor is your friend here...
Comment 4 Bill Nottingham 2007-02-21 14:22:12 EST
[notting@nostromo: ~]$ lshal  --monitor

Start monitoring devicelist:
-------------------------------------------------

<insert CD #1>

storage_model_UJDA745_DVD/CDRW property storage.removable.media_available = true
volume_part_1_size_357697536 added

<right click, eject>
... silence ...

<insert CD #2>

... silence ...

<hit eject button on drive>

storage_model_UJDA745_DVD/CDRW property storage.removable.media_available = false
volume_part_1_size_357697536 removed

<insert CD #2 again>

storage_model_UJDA745_DVD/CDRW property storage.removable.media_available = true
storage_model_UJDA745_DVD/CDRW property storage.removable.media_size = 640739328
(0x2630e800)
Comment 5 David Zeuthen 2007-02-21 14:31:09 EST
(In reply to comment #4)
> <insert CD #1>
> 
> storage_model_UJDA745_DVD/CDRW property storage.removable.media_available = true
> volume_part_1_size_357697536 added
> 
> <right click, eject>
> ... silence ...

Try doing 'gnome-mount -t -v -e /dev/cdrom' and post the output?
Wait. Did the disc pop out?

> <insert CD #2>
> 
> ... silence ...
>
> <hit eject button on drive>
> 
> storage_model_UJDA745_DVD/CDRW property storage.removable.media_available = false
> volume_part_1_size_357697536 removed



> 
> <insert CD #2 again>
> 
> storage_model_UJDA745_DVD/CDRW property storage.removable.media_available = true
> storage_model_UJDA745_DVD/CDRW property storage.removable.media_size = 640739328
> (0x2630e800)
> 

Something is wrong here. I'll try to reproduce it. Also, please attach output of
'lshal --long --show storage_model_UJDA745_DVD/CDRW'. Thanks.
Comment 6 David Zeuthen 2007-02-21 14:36:42 EST
Also, please try to reproduce with with gnome-cd uninstalled or moved out of the
way.
Comment 7 Bill Nottingham 2007-02-21 14:37:32 EST
Created attachment 148528 [details]
CD device entry

$ lshal --long --show storage_model_UJDA745_DVD/CDRW
lshal.c 186 : INFO: called LIBHAL_FREE_DBUS_ERROR but dbusError was not set.

Assuming the attached is what you want.
Comment 8 Bill Nottingham 2007-02-21 14:42:41 EST
Seems to work with gnome-cd killed.

$ gnome-mount -t -v -e -d /dev/cdrom
gnome-mount 0.5
Resolved device file /dev/cdrom -> /dev/scd0
libhal-storage.c 1401 : INFO: called LIBHAL_FREE_DBUS_ERROR but dbusError was
not set.
** (gnome-mount:10456): DEBUG: Ejecting
/org/freedesktop/Hal/devices/volume_part_1_size_357697536
** (gnome-mount:10456): DEBUG: in unmount_done : user_data = 0x0
Ejected /dev/scd0

and lshal --monitor shows it.

When gnome-cd is running:

$  gnome-mount -t -v -e -d /dev/cdrom
gnome-mount 0.5
Resolved device file /dev/cdrom -> /dev/scd0
libhal-storage.c 1401 : INFO: called LIBHAL_FREE_DBUS_ERROR but dbusError was
not set.
** (gnome-mount:10514): DEBUG: Ejecting
/org/freedesktop/Hal/devices/volume_part_1_size_357697536
** (gnome-mount:10514): DEBUG: in unmount_done : user_data = 0x0
Ejected /dev/scd0

So, gnome-mount works the same in either case, but hal doesn't get the notification.
Comment 9 Bill Nottingham 2007-02-21 14:43:31 EST
Actually, after ejecting, lshal --monitor gets the 'media_availabe=false'
change... as soon as I close gnome-cd.
Comment 10 David Zeuthen 2007-02-21 14:47:22 EST
I bet this one is a dupe of bug 206847 :-) 
Comment 11 David Zeuthen 2007-02-21 14:49:42 EST
Anyway, reassigning back to gnome-media. The problem is that gnome-cd, or one of
it's libraries, is keeping the fd open using O_EXCL. 

I wonder what other software (Rhythmbox, Banshee, etc.) suffer from this?
Comment 12 Bill Nottingham 2007-02-21 14:50:42 EST
In that O_EXCL locks out other things, yes. The CD isn't multisession.

I suspect if the eject process tried to open with O_EXCL and errored out if it
couldn't open it that way, things would be 'better'.
Comment 13 David Zeuthen 2007-02-21 14:53:09 EST
> I suspect if the eject process tried to open with O_EXCL and errored out if it
> couldn't open it that way, things would be 'better'.

Yah. Let me burn an audio disc (who uses these anymore? :-) ), reproduce it and
I'll fix this in HAL. Still, gnome-cd ought to be fixed to close the fd when
it's not needed.
Comment 14 David Zeuthen 2007-02-21 15:34:32 EST
OK, fix committed to HAL for this

 http://gitweb.freedesktop.org/?p=hal.git;a=commitdiff;h=ff20966d70fe8a0f23b2195ec8d6579201c0d4ba

Will be in Rawhide in a few days. With this, attempts to eject the disc will
result in this dialog

 http://people.freedesktop.org/~david/gnome-mount-busy-error.png

As a matter of fact, the eject button works is gnome-cd so I think we're all
good now and this bug can be closed.
Comment 15 David Zeuthen 2007-03-05 10:02:34 EST
This is now in Rawhide.

Note You need to log in before you can comment on or make changes to this bug.