Can't eject DVDs
#1
I've setup XBMC on my Debian box using Debian's package, and all is working very nicely. The only problem I have is that when I click on the "Eject/Load" button (under the big "PLAY DISC" button) to eject the disk, nothing happens.

Playing the DVD works fine. And typing "eject" at a command line running under the same user ("xbmc") also works fine. Any idea what I might be doing wrong?

[ SOLVED: the solution appears to be to remove "--lock-media" from the "cdrom_id" command in the udev rules. The relevant file is usually named something like /lib/udev/rules.d/60-cdrom_id.rules, and contains a line like

IMPORT{program}="cdrom_id --lock-media $devnode"

which should be changed to:

IMPORT{program}="cdrom_id $tempnode"

Note that editing this file is probably not a great idea, so instead you should create a new file /etc/udev/rules.d/60-cdrom_id.rules which will hide the original file. This new file should have the same content as the original except for the above one-line change. Thanks to uNiversal for this solution. ]
Reply
#2
Probably need a debug log (wiki)
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#3
If I remember correctly, this is due to sysctl locking the optical drive and only allowing system commands to eject.
On an Ubuntu system, and I think on a Debian system, run the following in terminal:

Code:
sudo echo dev.cdrom.lock=0 >>/etc/sysctl.conf

Then

Code:
sudo sysctl -p

This will add the line dev.cdrom.lock=0 to the end of the /etc/sysctl.conf file.

Reboot, and test.
Anti-Fascist◾Artist◾Atheist◾Barefoot◾Cis-male◾Cyclist◾Gay◾Geeky◾Introverted◾Likes weird stuff◾Living with depression & anxiety◾Naturist◾Pierced◾Socialist◾He/him
Reply
#4
(2015-05-26, 01:09)StefanMonnier Wrote: I've setup XBMC on my Debian box using Debian's package, and all is working very nicely. The only problem I have is that when I click on the "Eject/Load" button (under the big "PLAY DISC" button) to eject the disk, nothing happens.

Playing the DVD works fine. And typing "eject" at a command line running under the same user ("xbmc") also works fine. Any idea what I might be doing wrong?

Yes, nothing offered here so far will work.

Do this https://gist.github.com/uNiversaI/9290192 and it will be fixed.

Please mark thread as solved also Wink
Reply
#5
@dnairb: thanks for the suggestion, but I already have dev.cdrom.lock=0 in my sysctl and as mentioned "eject" from the command line works, so it must be something else.

@uNiversal: I'll give it a try, but it doesn't look very promising, since it seems to assume that some "DISK_EJECT_REQUEST" will be sent to udev, which I don't think is happening here.

BTW, the machine is a MacMini, so there's no "eject" button on the drive itself, hence the importance of XBMC's "Eject/Load" button working.

@nickr: The logs don't seem to contain anything very telling other than the fact that they don't contain anything (which might be very telling). More specifically, even after enabling all the extra verbose categories, when I press the "Eject/Load" button the only thing that shows up in the log are entries of the form

13:59:49 T:63623168 DEBUG: ProcessMouse: trying mouse action leftclick

If I click several times, this message is repeated without anything in-between (unless of course there's some other activity in the background happening at the same time)
Reply
#6
Well, either you try it and it works or it doesn't. Where Debian is concened never tried it as they often break standard behaviours in favour of their own flavour of madness.

Just dont tell me it doesn't work before you actually tried it. Smile

FYI this is a known issue and what I suggested has solved it for many other before me and after me.
Reply
#7
Using the 60-cdrom_id.rules method suggested by uNiversal will work, as this would have been my next suggestion as my first did not help you.
Anti-Fascist◾Artist◾Atheist◾Barefoot◾Cis-male◾Cyclist◾Gay◾Geeky◾Introverted◾Likes weird stuff◾Living with depression & anxiety◾Naturist◾Pierced◾Socialist◾He/him
Reply
#8
I'm noticing similar problems while reworking the automounter system (udisks-glue.conf) in OSMC - Kodi doesn't seem to be able to unmount some types of DVD's.

My test case is an external USB DVD drive testing both an actual DVD movie disk, and a standard DVD data disk. Both are in UDF format.

With a DVD Movie disk I can unmount the disk using the eject option on the main menu, or the "remove safely" option in Video->Files. (The latter of which also works for hard drives)

However when I insert a DVD data disk neither option does anything at all - it doesn't even log anything in the debug log, so no attempt whatsover is made. Debug log:

http://paste.osmc.io/azaribodud.vhdl

An additional problem I have noticed that is in --standalone mode Kodi is automatically closing the DVD tray as soon as it opens.

So I choose eject when a DVD movie disk is in (which does work) - this calls udisks to unmount the disk, we have a udisks-glue.conf line which calls eject to eject the disk, however as soon as the disk ejects Kodi then immediately attempts to remount the disk again, thus closing the tray. Why ?

I can work around this using

Code:
<advancedsettings>
<handlemounting>0</handlemounting>
</advancedsettings>

However it seems kind of bizarre that Kodi would see a freshly ejected DVD drive as something that should be automatically mounted, especially when it was Kodi that just asked for it to be unmounted ? Wink

Debug log of this happening:

http://paste.osmc.io/eponucekur.vhdl

Of particular interest are these two lines, which occur at the moment Kodi decides to remount the drive thus closing the tray:

Code:
10:15:56 T:1956245504   DEBUG: UDisks: Mounting /org/freedesktop/UDisks/devices/sr0
10:15:58 T:1956245504   ERROR: DBus: Error org.freedesktop.UDisks.Error.FilesystemDriverMissing - Error mounting: mount: no medium found on /dev/sr0

Anyone have any ideas on these two strange behaviours ? (Not able to unmount standard data disks, and trying to automatically remount a just ejected optical disk)
Kodi 18.3 - Mid 2007 Mac Mini, 4GB, 2TB HD, Windows 7 SP1
Kodi 18.3 - Vero4k, Raspberry Pi 2. OSMC.
Reply
#9
(2015-05-27, 17:44)uNiversal Wrote: Well, either you try it and it works or it doesn't.

OK, I tried it, and it works! Thanks and sorry for doubting you!

Now I'd like to know what it does. AFAICT this file will shadow the file /lib/udev/rules.d/60-cdrom_id.rules and if I compare the two it seems the main difference is that it replaces

IMPORT{program}="cdrom_id --lock-media $devnode"
with
IMPORT{program}="cdrom_id $tempnode"

It also drops a bunch of symlink-aliases, but I guess this is an accidental side-effect, right? Or is there more to it?
Reply
#10
I cant speak for whatever other aliases dropped as Ive no idea what your original 60-cdrom_id.rules file is like (Debian pff), but the idea is to remove --lock-media from your file and copy it to the new directory /etc/udev/rules.d/60-cdrom_id.rules so that it survives reboots and udev upgrades. Then reload udev with udevadm control --reload-rules ; udevadm trigger and profit.

Mark thread solved by full editing main post Smile
Reply

Logout Mark Read Team Forum Stats Members Help
Can't eject DVDs0