Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closing disc tray should only happen when supported #615

Open
hadess opened this issue Apr 26, 2024 · 4 comments
Open

Closing disc tray should only happen when supported #615

hadess opened this issue Apr 26, 2024 · 4 comments

Comments

@hadess
Copy link

hadess commented Apr 26, 2024

Using whipper-0.10.0-11.fc39.x86_64

WARNING:whipper.program.utils:command 'eject -t /dev/sr0' returned with exit code '1' (b'eject: CD-ROM tray close command failed: No such file or directory')

My CD drive is a Hitachi-LG BU40N blu-ray drive that doesn't have a tray that can be programmatically closed.

image

Ideally, whipper could detect that the device doesn't support closing the tray, and would set drive_auto_close for the drive itself rather than globally.

Copy link

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing instructions.

@MerlijnWajer
Copy link
Collaborator

I suppose we might be able to use the CDC_OPEN_TRAY flag, presuming that is set correctly for the CDROM_GET_CAPABILITY ioctl. Maybe you could check if that's set correctly for your drive?

@gwuen
Copy link

gwuen commented Jan 14, 2025

I have the same "No such file or directory" error on eject -t with my disk drive. While I don't know how to check the exact capability flags @MerlijnWajer mentioned, cd-info (from the libcdio utils) seems to get the capabilities wrong:

Drive: /dev/cdrom
Vendor                      : Lenovo
Model                       : USB_DVD_Burner5
Revision                    : 2L31
...
Can eject                                 : Yes
Can close tray                            : Yes

I'd be happy to do some more investigation if someone could point me in the direction of where the capabilities are stored/checked.

@hadess
Copy link
Author

hadess commented Jan 14, 2025

Not sure cd-info returns useful info in this case:

Vendor                      : HL-DT-ST
Model                       : BD-RE BU40N     
Revision                    : 1.04
Hardware                                  : CD-ROM or DVD
Can eject                                 : Yes
Can close tray                            : Yes

I don't think that the kernel can reliably track whether the drive can close itself, as there were presumably too many that lied:

        /*else    I don't think it can close its tray
                cd->cdi.mask |= CDC_CLOSE_TRAY; */

The only thing we get is an error when asking the drive to do it:

openat(AT_FDCWD, "/dev/sr0", O_RDWR|O_NONBLOCK) = 3
ioctl(3, CDROMCLOSETRAY, 0)             = 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants