PDA

View Full Version : Eject doesn't work


Fry-kun
2009-01-15, 21:36
Using TRUNK in Fedora 10 gnome.
I've traced the problem to gnome automounting - since the disk is mounted, eject command fails.

What would you say is the proper way to fix this - disable automounting or send an unmount command before ejecting in xbmc?

Fry-kun
2009-01-16, 19:54
Okay, so apparently user-initiated unmount is not allowed without a suid executable. It's kind of dirty, but this calls for something ugly, like
system("umount /dev/sr0")

Fry-kun
2009-01-19, 02:48
Update: even that doesn't help, I get am I/O error. Maybe xbmc keeps some handle open on the DVD...
Interestingly, if I quit xbmc and open it up again, it can eject without a problem.

gnif
2009-02-11, 06:10
Sounds like XBMC is holding onto a FD or something.

You could try:

#echo 0 > /proc/sys/dev/cdrom/lock

That should stop the Kernel from locking the drive.

Fry-kun
2009-02-16, 06:19
gnif: thanks, that fixed it!

In the latest SVN revision, close doesn't work. Patch to fix it:

--- xbmc/Util.cpp (revision 17750)
+++ xbmc/Util.cpp (working copy)
@@ -2949,7 +2949,7 @@
}
else if (execute.Equals("ejecttray"))
{
- if (CIoSupport::GetTrayState() == TRAY_OPEN)
+ if (CIoSupport::GetTrayState() == DRIVE_OPEN)
CIoSupport::CloseTray();
else
CIoSupport::EjectTray();

Fry-kun
2009-03-15, 05:59
In r18548 the bug fix no longer applies - it appears fixed (code moved to ToggleTray in xbmc/xbox/IoSupport.cpp), but eject doesn't work

topfs2
2009-03-15, 12:31
In r18548 the bug fix no longer applies - it appears fixed (code moved to ToggleTray in xbmc/xbox/IoSupport.cpp), but eject doesn't work

You sure you are trying iso9660 CDs? Also if you are mounting the drives, gnome usually does this, this will certainly make eject not working (trying to fix this though)

A debuglog would be most helpfull, as the code worked last I tried. (Rarely use CD's :D )

kknull
2009-03-16, 00:28
I'm using xbmc svn 18466 (with --standalone option), if I try to eject a dvd/cd (with eject command) the dvd is remounted by xbmc and it isn't ejected.
is it normal?

topfs2
2009-03-16, 12:04
I'm using xbmc svn 18466 (with --standalone option), if I try to eject a dvd/cd (with eject command) the dvd is remounted by xbmc and it isn't ejected.
is it normal?

This is what Im trying to fix, have had to much in school recently but all the ground work is laid out so it should be fairly easy to fix now.

Hopefully the following days or so.

kknull
2009-03-16, 15:59
ok thanks,
another question: is there a way to remove safely (unmount) removable devices like usb pens?

topfs2
2009-03-16, 16:15
ok thanks,
another question: is there a way to remove safely (unmount) removable devices like usb pens?

Yes. In latest SVN press eject in context menu.

Fry-kun
2009-06-10, 05:39
You sure you are trying iso9660 CDs? Also if you are mounting the drives, gnome usually does this, this will certainly make eject not working (trying to fix this though)

A debuglog would be most helpfull, as the code worked last I tried. (Rarely use CD's :D )

Sorry for long reply delay, I don't check back often (need to enable email notifications)
Yeah I'm using gnome and it automounts. Also, trying mostly video DVDs but CDs give same effect.
gnif's suggestion works (though I wouldn't like it as a permanent solution). If using this, something pops up warning me about unsafe unmount. (popup bottom-right.. could be XBMC or could be gnome..)
I've also noticed that if I press the open button on the DVD drive many times in a fast succession, it ejects. Of course that's not something I want to do to eject :(