Kodi Community Forum

Full Version: XBMC.EjectTray() not working?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys!

Sorry to bother you with my next question, but I'm kind of puzzled over here...
I've got XBMC Live nearly perfectly running (installed on an HDD) with my MCE Remote working out of the box. Now all I wanted to do is to add one button to eject my DVD drive's tray as I can't do this on the PC itself (it's a PC built into a PowerMac G4 case, so no possibility to press the eject button on the drive).

Well, I studied the Wiki and for my understanding I would have to add these to lines:

<eject>DVD</eject> (in /usr/share/xbmc/system/Lircmap.xml)

<eject>XBMC.EjectTray()</eject> (in /usr/share/xbmc/system/keymaps/remote.xml)

Well, doesn't work. The name of the button (DVD) is correct, as i can use it for other actions. The combination of Lircmap.xml and remote.xml therefor must be correct too, right? And remote.xml only is an extension for keyboard.xml, which hasn't got any remote control information in it.

So, long story short: What am I doing wrong now?

Kind regards,
Rick
Is the account running xbmc in the cdrom group?
Sorry, I absolutely have no idea what you are talking about. I guess xbmc has to have rights to open the cd drive, right? Could you please give me a hint what I should change?
Go to console and check name of current user:

Code:
$ whoami

Since you are running live version more likely the answer to whoami will be xbmc.
That means that user xbmc is running XBMC.
No check if this user is in cdrom group:

Code:
$ groups xbmc

The answer should be
xbmc : ...(group names)
So you will get group names that user xbmc belongs to. Group named cdrom should be on that list. If it is not then you need to add user xbmc to cdrom group. Google on how to do that Smile
Thanks a lot!
Did that and - surprise - xbmc is in the cdrom group.

Code:
xbmc : xbmc adm dialout cdrom floppy sudo audio video plugdev games users fuse lpadmin sambashare admin

I can open the drive tray with
Code:
eject -T
but XBMC won't do anything with XBMC.EjectTray(). Sad
As a work around you can try using irxevent and exec "eject -T" command whenever you press DVD button.
Just had this problem last night, I mapped my eject button to my zoom key, the key works for other functions but not eject when a dvd is present. I found a thread that pointed me to do this:

Code:
sudo nano /etc/sysctl.conf

add this at the bottom of the file and save (make sure it is not commented)
Code:
dev.cdrom.lock=0
I gotta look like a big question mark here...
This line already is in this config file (looks like with XMBC Live 9.11 it is there by default) and still it doesn't work. Sad
One thought: Is XBMC.EjectTray() in any way depending on the used skin? Because I am using (Aeon) Showmix and not Confluence or MediaStream...
...or, another thought: Can I somehow execute commands like eject -T from within lirc?
Do some research on irexec.
Very easy to accomplish your goal with the help of this program.
TheHazel3yes Wrote:One thought: Is XBMC.EjectTray() in any way depending on the used skin? Because I am using (Aeon) Showmix and not Confluence or MediaStream...

I thought that eject was limited to certain skins at one point but the eject button on my remote works in 4 skins (PM3-HD, Confluency, Transparency and Shade) so I just assume it works in all of them.

So the problem is a bit "simpler". On my system at least (Veris RM200 Remote, Antec Multimedia Station Elite which is the same as a Soundgraph imon apparently...xbmc-live 10, 2.6.38 kernel, lirc, lcdproc all working), the <eject> tag is non-functioning. I don't know if it's been deprecated or just inadvertently removed or what.

I was able to get the eject button working on my remote by mapping the EjectTray() to an open tag in remote.xml:

<blue>EjectTray()</blue>

And then mapping that to my remote's eject tray button in Lircmap.xml:

<blue>KEY_EJECTCD</blue>

The other option would be to set up the universal remote section which goes in the global area.

<universalremote>
<obc1>XBMC.ActivateWindow(Weather)</obc1>
<obc2>EjectTray()</obc2>
<obc3>PlayDVD</obc3>
<obc4>OSD</obc4>
</universalremote>

And then mapping that to the remote's eject tray button in Lircmap.xml:

<obc2>KEY_EJECTCD</obc2>

Both of these methods work for me so hopefully they'll work for you too. I know what it's like to have these little issues that you REALLY want to work and spend days searching outdated references. Smile
TheHazel3yes Wrote:Hey guys!

Well, I studied the Wiki and for my understanding I would have to add these to lines:

<eject>DVD</eject> (in /usr/share/xbmc/system/Lircmap.xml)

<eject>XBMC.EjectTray()</eject> (in /usr/share/xbmc/system/keymaps/remote.xml)

If you're using the MCE remote from what see in your post, you'll find that there is no "specific" button on the remote for eject; so you can't really define one.

You'll have to use one of the pre-existing buttons, I use "record" - Leaving Lircmap.xml as it is.

Then in remote.xml, I have made the following:
<record>XBMC.EjectTray()</record>

I use a Harmony One remote; which I just created a button on the touch screen for eject and then mapped that to record button.
Guys, this thread is more than one year old... I got a working solution since then. And yes, the problem was I was using a name that didn't exist.