Kodi Community Forum

Full Version: Eject not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi all,
seems I can't get the optical drive to eject cd's or dvd's. The GUI does say "mounted removable harddrive" upon insertion and "Successfully removed device [disc label]" when wanting to eject but the tray just doesn't eject. Have searched the forums and the wiki but the few fixes didn't solve my problem. Updated the system to Ubuntu 12.04. Running XBMC 11 Eden final.
Any ideas?
Same here. However, Close Tray works well
Thx for your quick help.

The parameter dev.cdrom.lock =0 does not make any difference, only executing the command "eject -i" after inserting the dvd and closing tray helps. I added this in my already existing udev rule which executes some commands if the tray is opened or closed.
(2012-04-30, 01:21)nanouk76 Wrote: [ -> ]Hi all,
seems I can't get the optical drive to eject cd's or dvd's. The GUI does say "mounted removable harddrive" upon insertion and "Successfully removed device [disc label]" when wanting to eject but the tray just doesn't eject. Have searched the forums and the wiki but the few fixes didn't solve my problem. Updated the system to Ubuntu 12.04. Running XBMC 11 Eden final.
Any ideas?
Same here Confused . System updated to Ubuntu 12.04 with XBMC Eden. And adding
Code:
dev.cdrom.lock = 0
to /etc/sysctl.conf doesn't do a thing.

Hi
Not sure if its any help but what I did was change the record button on my remote (which was set for print screen function by default)
to the eject dvd command
from console
Code:
cd /usr/share/xbmc/system/keymaps

sudo nano remote.xml

under the global listing look for the record tabs and change it to

<record>XBMC.EjectTray()</record>

cheers
Wozza



I had the exact same problem and when this solution did not work I stumbled across this: http://forum.xbmc.org/showthread.php?tid=130309
Peeps, I had the same issue and here is what I did to get it to work:

I was having no luck making the slot loading cdrom eject on:
LG CAN10 firmware A110 (dell BDROM). This puppy has no eject button whatsoever. I still am running my setup on ZOTAC AD02.

sudo nano /etc/sysctl.conf
added: dev.cdrom.lock=0
sudo sysctl dev.cdrom.lock=0

optional:
cd /usr/share/xbmc/system/keymaps/
sudo nano remote.xml
-- set <record> button to do XBMC.EjectTray()
This does not solve the problem, but My MCE remote has no eject button. I find it convenient to be able to eject the dvd at anytime, not just under the "Play Disc" submenu.

This is what did the trick (Ubuntu12.04):
cd /lib/udev/rules.d/
nano 60-cdrom_id.rules
---scan the section:
# import device and media properties and lock tray to
# enable the receiving of media eject button events
---comment this:
#IMPORT{program}="cdrom_id --lock-media $tempnode"
---add this:
IMPORT{program}="cdrom_id $tempnode"

Also, I had connected several external usb cdroms, so the one I am using now is not really labeled /dev/cdrom, instead it was /dev/cdrom1. Doing 'eject /dev/cdrom1' would spit out the disc, so:

ll /dev (look for all the '->sr0' entries)
Ejectable cdrom as CDROM1(or higher)?
Then lets clean up the cd rules:

nano /etc/udev/rules.d/70-persistent-cd.rules
relabel your cdrom as 'CDROM', erase or re-assign previously connected device definitions not in use.
The file will id your CD rom with the manufacturer string for easier identification.

reboot.

eject should work from now on.

On This last step, I am not sure if XBMC.Eject calls either /dev/cdrom, /dev/cdrom* or /dev/sr0. If it is the latter, then the cd-rules mod is moot. Also, I do not know if you can coerce XBMC and re-compile to have it modify rules.d/ to not place that cdrom lock.
@Peter

Thanks, the udev rules solved the non-eject issue for me on a MacMini running XBMCbuntu (the sysctl changes mentioned above are already in place as part of the distribution and made no difference) Smile
When I go to edit the nano 60-cdrom_id.rules

It says:

# do not edit this file, it will be overwritten on update

What to do?

Also I am not sure about this part?

ll /dev (look for all the '->sr0' entries)
Ejectable cdrom as CDROM1(or higher)?


I only have the one slot loading Blu-ray drive and I have not connected any other external optical drives etc.

This is how it looks currently I have not changed anything yet.

Code:
# do not edit this file, it will be overwritten on update

ACTION=="remove", GOTO="cdrom_end"
SUBSYSTEM!="block", GOTO="cdrom_end"
KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end"
ENV{DEVTYPE}!="disk", GOTO="cdrom_end"

# unconditionally tag device as CDROM
KERNEL=="sr[0-9]*", ENV{ID_CDROM}="1"

# media eject button pressed
ENV{DISK_EJECT_REQUEST}=="?*", RUN+="cdrom_id --eject-media $tempnode", GOTO="c$

# import device and media properties and lock tray to
# enable the receiving of media eject button events
IMPORT{program}="cdrom_id --lock-media $tempnode"

LABEL="cdrom_end"

Thanks
I wonder if this is related? If I use terminal and use the eject -v command, it says CD-ROM eject command failed but SCSI eject succeeded.

Code:
xbmc@xbmc01:~$ eject -v
eject: using default device `cdrom'
eject: device name is `cdrom'
eject: expanded name is `/dev/cdrom'
eject: `/dev/cdrom' is a link to `/dev/sr0'
eject: `/dev/sr0' is not mounted
eject: `/dev/sr0' is not a mount point
eject: `/dev/sr0' is not a multipartition device
eject: trying to eject `/dev/sr0' using CD-ROM eject command
eject: CD-ROM eject command failed
eject: trying to eject `/dev/sr0' using SCSI commands
eject: SCSI eject succeeded
I can confirm that editing the 60-cdrom_id.rules as described does resolve the problem, in the Confluence skin now when I select the Eject/Load menu item the disc is indeed ejected OK.

I was just a bit concerned because it said:

# do not edit this file, it will be overwritten on update

Thanks
What that means is, because its a system configuration file for UDEV if you upgrade UDEV at any time any modifications will be lost.

What you should do is make a udev rule with the modified contents in /etc/udev/rules.d/ and increase the number on the name from 60 to say 100 and your done, any rules in /etc take precedence over others in /usr.

The number is the order in which the rules get loaded the higher the number the later they get processed.

You can liken this to modifying xbmc installation files vs userdata files the later doesnt get overwritten on update.

uNi
Hi Uni

OK I changed the original "60-cdrom_id.rules" file located in the /lib/udev/rules.d/ directory back to what it was before I made the amendment.

I then created a new file called "100-cdrom_id.rules" in the different folder located at /etc/udev/rules.d/

I copied the contents of the 60-cdrom_id.rules file in to my new 100-cdrom_id.rules file and made the amendment as described earlier in the thread.

The new 100-cdrom_id.rules file looks like this:

Image

The contents of the /etc/udev/rules.d/ folder can be seen here:

Image

After a reboot the eject functionality has stopped working. Maybe the new 100-cdrom_id.rules file should be in the /lib/udev/rules.d/ folder not the /etc one.

So I deleted the 100-cdrom_id.rules file from the /etc/udev/rules.d folder and created it again in the /lib/udev/rules.d folder, after another reboot the eject function still isnt working.

Maybe I need to remove the 60-cdrom_id.rules file ?

Thanks

Oh I see you made an edit, sounds like the rule would be OK in the /etc folder as that takes precedence over other rules in /lib ?

Not sure why eject stopped working though.
I setup a keyboard shortcut of <y>XBMC.EjectTray()</y> in the keyboard.xml file and I programmed my Harmony remote to use the Green button to map to this keyboard shortcut to eject the disc etc. This was working earlier when using the amended 60-cdrom_id.rules file in the /lib/udev/rules.d/ folder.

Now after creating the new 100-cdrom_id.rules file and pressing eject button on the remote it shows this notification in XBMC.

Image

But the disc no longer actually ejects from the slot drive as it was earlier today.

Thanks

EDIT: I just deleted the 100-cdrom_id.rules file and amended the 60-cdrom_id.rules file in the /lib/udev/rules.d/ folder again and reboot and now eject is working again. Not sure whats going on?

Cheers
Pages: 1 2