Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Dev

CD/DVD always mounted so eject fails

 

 

MythTV dev RSS feed   Index | Next | Previous | View Threaded


g8ecj at gilks

Jun 27, 2008, 2:31 AM

Post #1 of 8 (686 views)
Permalink
CD/DVD always mounted so eject fails

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.

I just happened to look at the state of all the NFS mounts tonight and saw
that the frontend keeps the disk in the mounted state so of course the
button will NEVER work.

Manually unmounting doesn't stop anything from working on the frontend and
it allows the eject button to work again (much better WAF then!!) so the
question is, why does the media monitor, when it has sussed there is a
disk in the drive but its not being used (eg sitting at the main menu)
still keep it mounted?

Cheers

--
Robin Gilks


_______________________________________________
mythtv-dev mailing list
mythtv-dev[at]mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


kkuphal at gmail

Jun 27, 2008, 7:02 AM

Post #2 of 8 (661 views)
Permalink
Re: CD/DVD always mounted so eject fails [In reply to]

On Fri, Jun 27, 2008 at 4:31 AM, Robin Gilks <g8ecj[at]gilks.org> wrote:

> 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.
>
> I just happened to look at the state of all the NFS mounts tonight and saw
> that the frontend keeps the disk in the mounted state so of course the
> button will NEVER work.
>
> Manually unmounting doesn't stop anything from working on the frontend and
> it allows the eject button to work again (much better WAF then!!) so the
> question is, why does the media monitor, when it has sussed there is a
> disk in the drive but its not being used (eg sitting at the main menu)
> still keep it mounted?


I doubt media monitor is mounting your drives. Try looking into your
automount or autofs service.

Kevin


vitaminjoe at gmail

Jun 27, 2008, 7:48 AM

Post #3 of 8 (661 views)
Permalink
Re: CD/DVD always mounted so eject fails [In reply to]

On Fri, Jun 27, 2008 at 3:31 AM, Robin Gilks <g8ecj[at]gilks.org> wrote:

> Manually unmounting doesn't stop anything from working on the frontend and
> it allows the eject button to work again (much better WAF then!!) so the
> question is, why does the media monitor, when it has sussed there is a
> disk in the drive but its not being used (eg sitting at the main menu)
> still keep it mounted?

The MediaMonitor code indicates that it should try to unmount the disk
if it is already mounted. More is available through the Doxygen
manual:

http://www.miffteevee.co.uk/documentation/development/classMediaMonitor.html#5ed97f980a58a2e5035c01bd8cf46edc

Keep in mind that the function only works if the drives are known to
the MediaMonitor (i.e. they must be defined in Setup -> General ->
Page 4).

If the MediaMonitor is configured properly and still can't unmount the
drive, it might not have permission. Only the user that mounted the
drive (or root) can unmount it.

--
Joe Ripley
vitaminjoe[at]gmail.com
_______________________________________________
mythtv-dev mailing list
mythtv-dev[at]mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


pebender at san

Jun 27, 2008, 8:15 AM

Post #4 of 8 (661 views)
Permalink
Re: CD/DVD always mounted so eject fails [In reply to]

Robin Gilks wrote:
> 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.
>
> I just happened to look at the state of all the NFS mounts tonight and saw
> that the frontend keeps the disk in the mounted state so of course the
> button will NEVER work.
>
> Manually unmounting doesn't stop anything from working on the frontend and
> it allows the eject button to work again (much better WAF then!!) so the
> question is, why does the media monitor, when it has sussed there is a
> disk in the drive but its not being used (eg sitting at the main menu)
> still keep it mounted?

Some time ago, I found that I could no reliably eject disks from some
DVD drives using the MythTV eject menu item but I could eject them using
the 'eject' utility. Since I am using a completely custom distribution
that I build myself (MiniMyth), I know that there is no other software
that is keeping the drive from ejecting.

My solution has been to patch the MythTV source code. Now, the code
calls the 'eject' utility, and falls back to the original MythTV code
upon failure to find or successfully run the 'eject' utility.

I have not tried without my 'eject' utility patch for some time, so I do
not know whether or not I is still need it. Since it works, I have had
little motivation to remove it.
_______________________________________________
mythtv-dev mailing list
mythtv-dev[at]mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


g8ecj at gilks

Jun 27, 2008, 5:41 PM

Post #5 of 8 (641 views)
Permalink
Re: CD/DVD always mounted so eject fails [In reply to]

>
> I doubt media monitor is mounting your drives. Try looking into your
> automount or autofs service.
>
> Kevin
>

forgot to copy to the list...

I don't run any automount or autofs services on my system at all - never
have. Some part of mythfrontend has the drive open according to 'lsof'.

# lsof -n | grep hdc
mythfront 5637 mythtv 21r BLK 22,0 790 /dev/hdc


--
Robin Gilks


_______________________________________________
mythtv-dev mailing list
mythtv-dev[at]mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


nigel at ind

Jun 29, 2008, 6:46 PM

Post #6 of 8 (586 views)
Permalink
Re: CD/DVD always mounted so eject fails [In reply to]

> 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

_______________________________________________
mythtv-dev mailing list
mythtv-dev[at]mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


nigel at ind

Jul 1, 2008, 9:47 PM

Post #7 of 8 (547 views)
Permalink
Re: CD/DVD always mounted so eject fails [In reply to]

> Manually unmounting doesn't stop anything from working on the
> frontend and
> it allows the eject button to work again (much better WAF then!!)
> so the
> question is, why does the media monitor, when it has sussed there is a
> disk in the drive but its not being used (eg sitting at the main menu)
> still keep it mounted?



OK. There is a patch here which might* fix it for you
(for DVD/VCD only - other disk types are harder to fix)

http://svn.mythtv.org/trac/attachment/ticket/4877/umount-eject.patch

Index: libs/libmyth/mythcdrom.cpp
===================================================================
--- libs/libmyth/mythcdrom.cpp (revision 17685)
+++ libs/libmyth/mythcdrom.cpp (working copy)
@@ -119,7 +119,14 @@
if (MEDIATYPE_DATA == m_MediaType)
MythMediaDevice::onDeviceMounted();

+
+ // Unlock the door, and if appropriate unmount the media,
+ // so the user can press the manual eject button
if (m_AllowEject)
+ {
unlock();
+ if (m_MediaType == MEDIATYPE_DVD || m_MediaType ==
MEDIATYPE_VCD)
+ unmount();
+ }
}

Please provide -v media if it fails.




(*) I say "might," 'cause this sort of stuff is very drive and
kernel driver dependent. On two of my three test machines,
I can eject the tray while the volume is mounted!
The drive just magically disappears from df or /proc/mounts.

(There is no kernel message saying what's going on.
They are newish kernels - 2.6.18 and 2.6.23)

The third machine does exhibit the problem, but it is
currently SVN trunk, which has a broken MediaMonitor.

--
Nigel Pearson, nigel[at]ind.tansu.com.au|"I haven't tested it yet,
Telstra Net. Eng., Sydney, Australia | but it should be perfectly safe."
Office: 9202 3900 Fax: 9261 3912 |"Just a bit or harmless brain-
Mobile: 0408 664435 Home: 9792 6998 | manipulation, that's all" -
Wallace

_______________________________________________
mythtv-dev mailing list
mythtv-dev[at]mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


g8ecj at gilks

Jul 2, 2008, 2:56 AM

Post #8 of 8 (533 views)
Permalink
Re: CD/DVD always mounted so eject fails [In reply to]

>> Manually unmounting doesn't stop anything from working on the
>> frontend and
>> it allows the eject button to work again (much better WAF then!!)
>> so the
>> question is, why does the media monitor, when it has sussed there is a
>> disk in the drive but its not being used (eg sitting at the main menu)
>> still keep it mounted?
>
>
>
> OK. There is a patch here which might* fix it for you
> (for DVD/VCD only - other disk types are harder to fix)
>
> http://svn.mythtv.org/trac/attachment/ticket/4877/umount-eject.patch
>
> Index: libs/libmyth/mythcdrom.cpp
> ===================================================================
> --- libs/libmyth/mythcdrom.cpp (revision 17685)
> +++ libs/libmyth/mythcdrom.cpp (working copy)
> @@ -119,7 +119,14 @@
> if (MEDIATYPE_DATA == m_MediaType)
> MythMediaDevice::onDeviceMounted();
>
> +
> + // Unlock the door, and if appropriate unmount the media,
> + // so the user can press the manual eject button
> if (m_AllowEject)
> + {
> unlock();
> + if (m_MediaType == MEDIATYPE_DVD || m_MediaType ==
> MEDIATYPE_VCD)
> + unmount();
> + }
> }
>
> Please provide -v media if it fails.
>
>
>
>
> (*) I say "might," 'cause this sort of stuff is very drive and
> kernel driver dependent. On two of my three test machines,
> I can eject the tray while the volume is mounted!
> The drive just magically disappears from df or /proc/mounts.
>
> (There is no kernel message saying what's going on.
> They are newish kernels - 2.6.18 and 2.6.23)
>
> The third machine does exhibit the problem, but it is
> currently SVN trunk, which has a broken MediaMonitor.

That works really well for DVD and VCD so we must be on the same page
after all - probably because I'm in New Zealand :-)

As expected, picture CDs are still a problem trying to eject with the
drive button and using the MythVideo eject menu option results in the
occasional grabbing back of the tray again - something which I think is
probably specific to my diskless slow CPU setup showing up a race
condition.

With DVDs and audio CDs now interchangable the WAF will improve somewhat.
I have the system set up with a 2 line LCD and a line of 6 buttons on the
lcdproc interface (up/down/left/right/esc/select) so that the missus can
now eject a DVD that happens to be in the tray, put in an audio CD and it
will play without turning on the TV or trying to find the remote - good
result.


--
Robin Gilks



_______________________________________________
mythtv-dev mailing list
mythtv-dev[at]mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

MythTV dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.