https://bugs.winehq.org/show_bug.cgi?id=49615
jswinebz@kanargh.org.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jswinebz@kanargh.org.uk
--- Comment #7 from jswinebz@kanargh.org.uk --- Created attachment 69843 --> https://bugs.winehq.org/attachment.cgi?id=69843 cdrom access demo
(I've just noticed this myself.)
wine is asking to read from a disc which does not exist (none is inserted into the drive.) The request is passed down to the drive, which quite correctly throws back an error. (What else could it do?) This error is logged to dmesg - often such messages are useful and interesting. Most causes of such errors are things like actual surface corruption. (Or attempting to access a protected DVD without first authenticating.) This error - not so much as it is due to an obviously unsatisfiable but perfectly avoidable request from the application.
Note that if you just try to open the device in the usual way, the open attempt fails immediately with ENOMEDIUM, but no error is logged to dmesg. You have to specifically request O_NONBLOCK (an odd thing to do for a disc device, since they don't really do non-blocking I/O) to defeat that check. You are then expected to proceed very carefully... (Since wine triggers a kernel message, it is clearly doing the former and not the latter.)
You can use such access to query the drive itself for capabilities and current status. You shouldn't proceed to disc access unless the drive reports this is possible.
Attached is a short program that demonstrates the correct sequence.
$ g++ cdromstatus.cpp -o cdromstatus $ ./cdromstatus 0 open("/dev/sr0") returned error (123) No medium found $ ./cdromstatus 1 open("/dev/sr0") returned fd 3 $ ./cdromstatus 2 open("/dev/sr0") returned fd 3 read() returned error (5) Input/output error $ ./cdromstatus 3 open("/dev/sr0") returned fd 3 CDROM_DRIVE_STATUS returned (1) CDS_NO_DISC $
And with a disc inserted:
$ ./cdromstatus 3 open("/dev/sr0") returned fd 3 CDROM_DRIVE_STATUS returned (4) CDS_DISC_OK read() returned 2048 bytes $