Playing CDs: EjectTray() not working anymore?

Hello everyone,

First, I’d like to thank you all for the great work done on OSMC. I just started my first mediacenter project with it, and it’s great!
So… As a noob, I hope my question will not appear to be too dumb here :confused:
It is about my optical disc drive, which is plugged through a self-powered USB hub. Few weeks ago I was able to open the tray and play CDs with my Yatse app and everything was great. But now, I only can play the disc, as the EjectTray command doesn’t work anymore :cry:
I thought first it could be related to Yatse, but after trying with OSMC (through VNC Viewer), the problem appeared too, maybe an update problem?
I’m a beginner, and hope my english will not be too bad… Thank you in advance for your help!

Hi there,

Sorry to be insisting, but does anyone got this same problem with the EjectTray command ? I searched a bit, but without success till now… :frowning:

Thank you in advance for your help!

Does ejecting a Disk from Kodi work ?

Hi,

Thank you for answering.
Well, I tried to eject disk from Kodi/OSMC, and no it does’nt work. Started looking in the Github repository if there were some changes on keynames, maybe, but I couldn’t see anything yet :frowning:

Did you try through Video->Files, using the context menu to choose “Safely Remove” ?

If it will not eject then most likely the drive is locked and in use - for example a Samba client may have connected to the share that was automatically created for the drive.

We would need to see full debug logs after a failed attempt to eject to be sure though.

Hi,

Thank you for your quick answer. I’ll try it asap, and paste debug logs tomorrow I think!

HI,

Sorry for not being able to answer earlier… So, I just made a few tries today and here is the summary:

1. [CD inside, with Yatse] > Power on > play disc > stop > eject => fail (logs here)
2. [no CD inside, with Yatse] > Power on > eject(ok) > insert disc/autoplay > stop > eject => fail (logs here)
3. [CD inside, with OSMC interface] > Power on > eject(images/files/drive) => fail (logs here)
4. [no CD inside, with OSMC interface] > eject => not possible as there is no mounted drive then, apparently…

I am not sure to understand the “Samba thing”, as I do not use it for NAS connexion (I use webdav…), I’ll search on this topic, but any help is still welcome! :slight_smile:

Again, sorry for the delay in my answer, and thx for the time and help!

From number 3:

Mar 28 13:04:02 localhost udisks-glue[259]: Device /dev/sr0 did not match any rules.
Mar 28 13:04:02 localhost udisks-glue[259]: brw-rw---- 1 root cdrom 11, 0 Mar 28 13:03 /dev/sr0

The contents of the disk are not recognised by udisks-glue, therefore trying to eject through the Kodi interface (or using Yatse) will not work. You should still be able to eject using the eject button on the drive though.

Mar 28 13:04:02 localhost kernel: sr 0:0:0:0: [sr0] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
Mar 28 13:04:02 localhost kernel: sr 0:0:0:0: [sr0] tag#0 Sense Key : 0x5 [current] 
Mar 28 13:04:02 localhost kernel: sr 0:0:0:0: [sr0] tag#0 ASC=0x64 ASCQ=0x0 
Mar 28 13:04:02 localhost kernel: sr 0:0:0:0: [sr0] tag#0 CDB: opcode=0x28 28 00 00 00 00 00 00 00 02 00 00 00
Mar 28 13:04:02 localhost kernel: blk_update_request: I/O error, dev sr0, sector 0
Mar 28 13:04:02 localhost kernel: Buffer I/O error on dev sr0, logical block 0, async page read

The drive cannot read sector 0 on the disk (the very first sector) - without this it doesn’t know what kind of disk it is and can’t do anything with it.

Mar 28 13:04:02 localhost udisks-glue[259]: usage:
Mar 28 13:04:02 localhost udisks-glue[259]: type:
Mar 28 13:04:02 localhost udisks-glue[259]: version:
Mar 28 13:04:02 localhost udisks-glue[259]: uuid:
Mar 28 13:04:02 localhost udisks-glue[259]: label:

This is reporting that the disk label and type cannot be read - again, because the disk is unreadable.

In short, there is a fault either with the disk, or the drive causing the disk to be unreadable - nothing we can do about that in software.

By the way, you will not be able to eject the drive when it is empty using the Kodi GUI or Yatse - you can only eject an empty tray (or a tray containing an unreadable disk) by pressing the button on the drive - and it may require two presses.

HI,

FIrst, thanks a lot for your quick answer :slight_smile:

After that, I tried with 2 other discs, and the same problems occur (didn’ catch the logs). This looks strange to me: in any case (disc or drive fault), wouldn’t be more logical that the tray automatically open, in order to not block the drive?
Anyway, maybe this is a drive problem (it is a brand new one… s**t happens :confused: ), I’ll have to try with another one.
Finally, about your last remark, is this the normal behavior with Kodi/OSMC? Yet it seems normal to me, to expect that the tray (not the drive) could be in any case managed, through Yatse and/or OSMC interface, or not?

No, because how does the operating system tell the difference between a disk that cannot be read and a tray that is empty ? With your suggestion every time you close an empty tray the tray would open again.

It is normal with DVD drives that they will not automatically open just because the disk might be blank or unreadable. It’s up to you to press the eject button on an unreadable disk.

Kodi does not issue an eject command when you chose safely remove or “eject” in the interface, it tries to unmount the drive. When the drive is unmounted udisks-glue then attempts to eject the disk for you.

If the disc is blank or unreadable there is no volume for Kodi to unmount - keep in mind that Kodi only displays the Eject disk option if a readable DVD Movie disk is detected.

At all times the physical eject button on the drive will work.

I too am having trouble ejecting a disk from my drive.

OSMC sees the disc as a DVD,even though it is a music cd, and plays the disc fine.However when attemoting to use the Eject Disc command under the PLAY DVD menu or through the File Manager it does nothing and the disc won’t eject.My drive also does not actually have a physical ‘Eject Button’ so consequentially the disc is now stuck inside the drive and unable to be ejected via OSMC.

I’ve never come across a drive with no eject button - what make/model is it?

It used to be that you could eject wirh the eject commad from a terminal session - have you tried that? (you might need to specify the dev for the device - probably /dev/sr0)
Derek

There is usually a pinhole eject button that doesn’t need power to open, Just insert a needle there and push, you will get a manual opening of the CD/DVD-rom device.

Thanks,unfortunately the device is a Superdrive from my MacbookPro in a chassis which doesn’t have a pinhole eject.

To eject it I just plugged it into my laptop and ejected it from there.Wierd though that the OSMC eject function doesn’t seem to be operating properly.

By the way,you’re the guy behind the Chromium desktop addon right?

I scripted the installer, just a bit of cut and paste :slight_smile: