[mythtv] Mythfrontend hang with CVS

Xavier Hervy maxpower44 at tiscali.fr
Wed Jun 9 11:02:10 EDT 2004


Leo Weppelman wrote:

> On Wed, Jun 09, 2004 at 02:26:34PM +0200, Leo Weppelman wrote:
> 
>>On Tue, Jun 08, 2004 at 06:11:24PM -0500, Stacey Son wrote:
>>
>>>OK, Looking at the 0.15 release code the loop was introduced by a change 
>>>in MythCDROM::openDevice():
>>>
>>>In 0.15 release:
>>>
>>>  MythCDROM::openDevice()
>>>  {
>>>     if (MythMediaDevice::openDevice())
>>>     {
>>>        ...
>>>       if (m_AllowEject)
>>>           ioctl(m_DeviceHandle, CDROM_LOCKDOOR, 0);
>>>
>>>was changed to:
>>>
>>>  MythCDROM::openDevice()
>>>  {
>>>     if (MythMediaDevice::openDevice())
>>>     {
>>>        ...
>>>       if (m_AllowEject)
>>>           unlock();
>>>
>>>Your patch should fix the looping problem but I don't see right off why 
>>>it is not sensing media changes now.    You could try changing the above 
>>>back and see if that, for some reason, fixes this.
>>
>>Yes, putting back de ioctl makes myht see the media changes again... I
>>haven't figured out why yet.
> 
> 
> I think I've got it! The ioct() -> unlock() change caused the following
> calltree on opening the device:
> 
> MythCDROM::openDevice()
>   MythMediaDevice::openDevice()) {
>       MythCDROMLinux::unlock {
>           m_DeviceHandle, CDROM_LOCKDOOR, 0)
>           MythMediaDevice::unlock {
>              MythMediaDevice::closeDevice()   <----- !!!!!
>           }
>       }
>   }
> }
> 
> Notice that open reports that it successfully opened the device while by
> calling unlock() it indirectly closed the device right after opening it :-(
> 
> Leo.
> 

I have made a patch to fix unlock bug before the freeBSD patch was apply.
as i say here : 
http://www.gossamer-threads.com/lists/mythtv/dev/71771?search_string=mediamonitor;#71771
Mediamonitor should not close device after mount it, because open 
function failed if device is already mount and return -1 in place of 
correct handle. then mediamonitor can detect when a device change state 
from "mounted" to "tray open" and can umount it.

Then if someone find why mediamonitor failed, please keep in mind this.

Xavier







More information about the mythtv-dev mailing list