[mythtv] CD/DVD always mounted so eject fails

Nigel Pearson nigel at ind.tansu.com.au
Mon Jun 30 01:46:20 UTC 2008


> Since before Xmas (i.e. before 0.21 was released) I've been trying  
> to work
> out why the rework of the media monitor prevented my use of the eject
> button on the DVD drive.


At the moment, any disk with a filesystem will be both
locked and mounted. On Linux, if the drive and kernel
support the lock call, that means that Audio CDs can be
ejected with the button, but VCDs, DVDs and data disks
(i.e. a CD of photos) cannot.

It might be possible to (add a setting to) unmount/unlock
after the media type detection, but ejecting a volume that
is being used can cause problems, which is why most OSes lock it.



http://svn.mythtv.org/trac/ticket/4877

Your ticket seemed to indicate that you _could_ eject the tray,
but that shouldn't be possible because the media monitor locks it.
As I said in there, I need '-v media' output, to work out why.
(not that the current verbose output doesn't actually
  list when the lock occurs, only the unlock,
  but I'm hoping I can work it out)



Here is the relevant output for me:

$ mythfrontend --version | head -3
Please include all output in bug reports.
MythTV Version   : 17450M
MythTV Branch    : branches/release-0-21-fixes

$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda1              4757760   2197232   2316368  49% /
tmpfs                   499508         4    499504   1% /dev/shm
/dev/sda1            244076732 117988568 126088164  49% /media/sda1
/dev/hda3             13166816  11749484   1417332  90% /myth

$ mythfrontend -v media
...
2008-06-30 10:40:06.005 Creating MediaMonitor, SendEvents=false
2008-06-30 10:40:06.005 IgnoreDevices=
2008-06-30 10:40:06.013 MediaMonitorUnix::AddDevice() - Added /dev/cdrom
2008-06-30 10:40:06.014 MediaMonitorUnix::GetCDROMBlockDevices()  
returning hdd
2008-06-30 10:40:06.018 MediaMonitorUnix::AddDevice() - not adding / 
dev/hdd
                         because it appears to be a duplicate of /dev/ 
cdrom
2008-06-30 10:40:06.020 Initial device list...
/dev/cdrom->/dev/hdd (SONY CD-RW CRX140E)
2008-06-30 10:40:06.020 Registering MythGallery Media Handler 2/2 as  
a media handler for MEDIATYPE_MGALLERY, ext (gif,jpg,png)
...
2008-06-30 10:40:06.142 /dev/cdrom Tray open or no disc
2008-06-30 10:40:06.143 MythMediaDevice::isMounted() - mount of '/dev/ 
cdrom' not found.
                  Device name/type | Current mountpoint
                  -----------------+-------------------
                         /dev/hda1 | /
                         /dev/hda1 | /dev/.static/dev
                         /dev/sda1 | /media/sda1
                         /dev/hda3 | /myth
                  =================+===================
2008-06-30 10:40:06.659 /dev/cdrom Tray open or no disc
...
2008-06-30 10:40:35.576 /dev/cdrom Tray open or no disc
2008-06-30 10:40:42.104 /dev/cdrom Disk OK, type = MEDIATYPE_UNKNOWN
2008-06-30 10:40:42.105 /dev/cdrom Current status MEDIASTAT_OPEN
2008-06-30 10:40:42.106 Found a data disk
2008-06-30 10:40:42.809 MythMediaDevice::isMounted() - mount of '/dev/ 
cdrom' not found.
                  Device name/type | Current mountpoint
                  -----------------+-------------------
                         /dev/hda1 | /
                         /dev/hda1 | /dev/.static/dev
                         /dev/sda1 | /media/sda1
                         /dev/hda3 | /myth
                  =================+===================
2008-06-30 10:40:42.810 MythMediaDevice::isMounted() - mount of '/dev/ 
cdrom' not found.
                  Device name/type | Current mountpoint
                  -----------------+-------------------
                         /dev/hda1 | /
                         /dev/hda1 | /dev/.static/dev
                         /dev/sda1 | /media/sda1
                         /dev/hda3 | /myth
                  =================+===================
2008-06-30 10:40:42.811 Executing '/usr/bin/pmount /dev/cdrom'
2008-06-30 10:40:43.310 Probable VCD/SVCD detected.
2008-06-30 10:40:43.312 Detected MediaType MEDIATYPE_VCD
2008-06-30 10:40:43.313 Media status changed, but not sending event  
(MEDIATYPE_VCD, MEDIASTAT_NOTMOUNTED -> MEDIASTAT_MOUNTED)
2008-06-30 10:40:44.353 /dev/cdrom Disk OK, type = MEDIATYPE_VCD



after pressing the eject button in Videos (classic menu theme):

2008-06-30 10:44:50.762 MediaMonitor::selectDrivePopup(Select  
removable media to eject or insert) - One suitable
  device
2008-06-30 10:44:50.763 Disk MY_CD is mounted? Unmounting
2008-06-30 10:44:50.763 Executing '/usr/bin/pumount /dev/cdrom'
2008-06-30 10:44:50.771 MythMediaDevice::isMounted() - mount of '/dev/ 
cdrom' not found.
                  Device name/type | Current mountpoint
                  -----------------+-------------------
                         /dev/hda1 | /
                         /dev/hda1 | /dev/.static/dev
                         /dev/sda1 | /media/sda1
                         /dev/hda3 | /myth
                  =================+===================
2008-06-30 10:44:50.771 Unlocking disk MY_CD, then eject()ing
2008-06-30 10:44:53.405 /dev/cdrom Tray open or no disc
2008-06-30 10:44:53.405 MythMediaDevice::isMounted() - mount of '/dev/ 
cdrom' not found.
                  Device name/type | Current mountpoint
                  -----------------+-------------------
                         /dev/hda1 | /
                         /dev/hda1 | /dev/.static/dev
                         /dev/sda1 | /media/sda1
                         /dev/hda3 | /myth
                  =================+===================
2008-06-30 10:44:53.405 Media status changed, but not sending event  
(MEDIATYPE_VCD, MEDIASTAT_MOUNTED -> MEDIASTAT_OPEN)
2008-06-30 10:44:53.909 /dev/cdrom Tray open or no disc



or, after pressing the manual eject button:

2008-06-30 11:26:34.442 /dev/cdrom Disk OK, type = MEDIATYPE_VCD
2008-06-30 11:26:38.498 /dev/cdrom Tray open or no disc
2008-06-30 11:26:38.498 MythMediaDevice::isMounted() - mount of '/dev/ 
cdrom' not found.
                  Device name/type | Current mountpoint
                  -----------------+-------------------
                         /dev/hda1 | /
                         /dev/hda1 | /dev/.static/dev
                         /dev/sda1 | /media/sda1
                         /dev/hda3 | /myth
                  =================+===================
2008-06-30 11:26:38.498 Media status changed, but not sending event  
(MEDIATYPE_VCD, MEDIASTAT_MOUNTED -> MEDIASTAT_OPEN)
2008-06-30 11:26:39.002 /dev/cdrom Tray open or no disc

--
Nigel Pearson, nigel at ind.tansu.com.au|"Now the world has gone to bed.
Telstra Net. Eng., Sydney, Australia | Darkness won't engulf my head.
Office: 9202 3900    Fax:  9261 3912 | I can see by infrared.
Mobile: 0408 664435  Home: 9792 6998 | How I hate the night." -Marvin



More information about the mythtv-dev mailing list