Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#4126 closed defect (fixed)

Eject does not work if drive in IgnoreDevices for monitoring

Reported by: derliebegott@… Owned by: Nigel
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: medium Keywords: eject media monitoring IgnoreDevices
Cc: Ticket locked: no

Description

When I put a blank DVD in the drive, I got this in /var/log/messages:

Nov  3 21:08:58 mythbox kernel: cdrom: This disc doesn't have any
tracks I recognize!
Nov  3 21:09:29 mythbox last message repeated 61 times
Nov  3 21:10:30 mythbox last message repeated 122 times

I disabled media monitoring, but I still got this message. A bug?

I put /dev/cdrom,/dev/dvd,/dev/hdc (dvd and cdrom are symlinks to hdc) in the IgnoreDevices? and the monitoring finally stopped. But eject media does not work is monitoring is disabled.

And also ejecting DVD after burning it with MythArchive? does not work when /dev/dvd is in the IgnoreDevices? (MonitorDrives? is disabled all the time (0)). I get this in mythburn.log:

1916898 extents written (3743 MB)
/dev/dvd: flushing cache
/dev/dvd: updating RMA
/dev/dvd: closing disc

Traceback (most recent call last):
 File "/usr/share/mythtv/mytharchive/scripts/mythburn.py", line 4657, in main
   processJob(job)
 File "/usr/share/mythtv/mytharchive/scripts/mythburn.py", line 4462,
in processJob
   BurnDVDISO()
 File "/usr/share/mythtv/mytharchive/scripts/mythburn.py", line 2183,
in BurnDVDISO
   r = ioctl(f,CDROM.CDROMEJECT, 0)
IOError: [Errno 5] Input/output error

Change History (7)

comment:1 Changed 16 years ago by Nigel

1) Since [13882], disabling media monitoring just prevents the frontend jumping to a plugin when you insert media. Inserting strange media (e.g. blank CD-Rs) will still cause kernel messages like those you list. It might be possible to detect this - I will think about it
2) Yes, if you tell MythTV to ignore a drive, then you won't be able to do anything with it (like eject). You could add another button that did EXEC eject, or you could just get up and press the eject button under the tray
3) A later version of mythburn.py (e.g. [14809] or newer) should fix (or at least ignore) that error

comment:2 Changed 16 years ago by Nigel

Owner: changed from Isaac Richards to Nigel
Status: newaccepted

I haven't been able to reproduce 1). I suspect it is something like a Linux desktop file manager?
There is actually a 4) in there. The need to add cdrom and hdc into IgnoreDevices is a bit wasteful, but because devices are looked up in several places, currently necessary. e.g.

2008-01-09 20:22:56.393 Mediamonitor: Adding /dev/cdrom
2008-01-09 20:22:56.405 Ignoring device: /dev/cdrom
2008-01-09 20:22:56.412 MediaMonitorUnix::GetCDROMBlockDevices() returning hdc

I suspect that the MediaMonitor should check if any of IgnoreDevices is a symlink, and if so, match the target also.

comment:3 Changed 16 years ago by Nigel

(In [15406]) Improve disc eject when MythMediaMonitor is disabled, by first checking if the disc is mounted. See #4126. It will not work on Mac OS X, and will only know about the devices that were plugged in when you started the frontend, but it is much better than nothing - particularly in multi-CD/DVD setups.

Reverts [15404] - it turns out that there is a good reason to generate device lists, even if they are un-monitored!

comment:4 Changed 16 years ago by Nigel

(In [15407]) MediaMonitor? now also ignores devices that are symlinks. See #4126.

comment:5 Changed 16 years ago by Nigel

Resolution: fixed
Status: acceptedclosed

(In [15423]) Detect blank media to prevent the kernel spewing messages like "cdrom: This disc doesn't have any tracks I recognize!" in the logs. Closes #4126. Will also use later in MediaMonitor::defaultWriter().

comment:6 Changed 16 years ago by Nigel

Ma, the original problem should now be fixed. I have only tested on one machine, but there should now be exactly one kernel message each time you insert a piece of blank media.

comment:7 Changed 16 years ago by derliebegott@…

thanks. you got it. great.

Note: See TracTickets for help on using tickets.