You are not logged in.
I'm building htpc with arch and xbmc. Unfortunatly, xbmc can't eject cdrom tray. It can't be done even outside xbmc. I can't use button on device, even if media present on device is not mounted. Button on device is working just fine, if no media is present.
eject command is working.
[xbmc@mediacenter ~]$ eject -v
eject: using default device `sr0'
eject: device name is `sr0'
eject: expanded name is `/dev/sr0'
eject: `/dev/sr0' is not mounted
eject: `/dev/sr0' is not a mount point
eject: checking if device "/dev/sr0" has a removable or hotpluggable flag
eject: `/dev/sr0' is not a multipartition device
eject: trying to eject `/dev/sr0' using CD-ROM eject command
eject: unlocking tray using CDROM_LOCKDOOR ioctl
eject: CD-ROM eject command succeeded
[xbmc@mediacenter ~]$
How to configure system to be able to eject cd tray if inserted media is not mounted?
It is unacceptable state for that machine, cuz xbmc supposed to be running only xbmc with rf remote unit.
Last edited by bagheera (2012-03-02 19:51:13)
arch linux user
Offline
It's udev that locks the tray. The instruction to do so is in /lib/udev/rules.d/60-cdrom_id.rules, you could mess with that. No idea about the consequences.
Offline
There is not instruction in that file that i can fully understand. What i need to change exactly?
# 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 $devnode", GOTO="cdrom_end"
# import device and media properties and lock tray to
# enable the receiving of media eject button events
IMPORT{program}="cdrom_id --lock-media $devnode"
KERNEL=="sr0", SYMLINK+="cdrom", OPTIONS+="link_priority=-100"
LABEL="cdrom_end"
I can't understand this behaviour. If media is mounted it shouldn't be ejected, drive is locked, that's ok, but why drive is locked even if media is NOT mounted? Isn't that a bug? It works just fine in hated/beloved ms windows...
arch linux user
Offline
There is not instruction in that file that i can fully understand.
That's what the comments are for.
Offline
Well, i know that, but it's not so obvious in that particular case. I'm not going to guess from zylion possibilities.
So, should i remove "--lock-media" from
IMPORT{program}="cdrom_id --lock-media $devnode"
arch linux user
Offline
I don't use xbmc media center, but I found that link for Ubuntu: http://wiki.xbmc.org/index.php?title=HO … drive_lock
In Arch, that could be running under root:
# echo dev.cdrom.lock=0 >>/etc/sysctl.conf
# sysctl -p
You could try that before editing the udev rule, as that is mentioned working in Ubuntu.
Offline
Changing
IMPORT{program}="cdrom_id --lock-media $devnode"
to
IMPORT{program}="cdrom_id $devnode"
does the trick.
Thanks for tip.
arch linux user
Offline
Similar issue reported in new thread:
https://bbs.archlinux.org/viewtopic.php?id=192574
Last edited by ambro (2015-01-22 10:04:45)
Offline