[mythtv] (no subject)

maxpower44@tiscali.fr maxpower44 at tiscali.fr
Mon Jun 7 09:09:04 EDT 2004


Dev list don't receive my last mail !!!?

never mind, i made other attempts.

When i put a cd in drive and watch the log i can see :
Failed to open device, CDROM try will remain locked.

Then i try to open device when cdrom is mounted, and open function 
return always -1.
If i try :
system("mount /mnt/cdrom")
int handle = open("/dev/cdrom",O_RDONLY | O_NONBLOCK | O_EXCL)
int stat = ioctl(handle,CDROM_LOCKDOOR,0);

it's failed because handle = -1

If i try :
int handle = open("/dev/cdrom",O_RDONLY | O_NONBLOCK | O_EXCL)
system("mount /mnt/cdrom")
int stat = ioctl(handle,CDROM_LOCKDOOR,0);
it's work.


I have add cout message in opendevice and close device.here is the log :
2004-06-07 13:15:09 Mediamonitor: Adding /dev/cdrom
openDevice m_devicepath /dev/cdrom handle = 11
close device
2004-06-07 13:15:09 Starting media monitor.
openDevice m_devicepath /dev/cdrom handle = 10
close device
openDevice m_devicepath /dev/cdrom handle = 10
2004-06-07 13:15:10 Media status changed...  New status is: 
MEDIASTAT_OPEN old status was MEDIASTAT_NOTMOUNTED
close device
openDevice m_devicepath /dev/cdrom handle = 10
close device
...
openDevice m_devicepath /dev/cdrom handle = 10
close device
2004-06-07 13:16:53 Executing '/bin/mount /dev/cdrom'
2004-06-07 13:16:53 Looking for: '/mnt/cdrom/VIDEO_TS'
2004-06-07 13:16:53 Looking for: '/mnt/cdrom/vcd'
openDevice m_devicepath /dev/cdrom handle = -1
2004-06-07 13:16:53 Failed to open device, CDROM try will remain locked.
close device
2004-06-07 13:16:53 Media status changed...  New status is: 
MEDIASTAT_MOUNTED old status was MEDIASTAT_OPEN
2004-06-07 13:16:53 Posting MediaEvent
close device
Found a handler
openDevice m_devicepath /dev/cdrom handle = -1
...

the problem is that you close device before mount it then handle device = -1

then is watch performMountCmd function in mythmediadevice
and i can see that you made this :
    if (isDeviceOpen())
        closeDevice();
before mount the device

Can you explain why ?

I remove the both lines then i can eject my cdrom but mediamonitoring never umount this device and never send other event for this driver after this.

>>> You might want to look at the media
>>> monitoring code and see about routing the information about the disk
>>> as part of the event, that way you don't need to ask about a mount
>>> point.  Alternatively, parse the /etc/fstab yourself and figure out
>>> where to mount the disk.

send information by an event object will be a solution except if we are 
more than one cdrom device.
if you put in the first one, mediahanlder can receive information about 
this drive
if you put in the second one, mediahanlder can receive information only 
about the second drive, except the both have cdrom inserted then .... 
any idea  about that ?
Parse fstab can be the solution, but it will be better if only 
mediamonitor do that.

Xavier

******ADSL Tiscali, le Haut débit au meilleur prix ******
Avec Tiscali, profitez de l'ADSL au meilleur prix partout en France !
Pour profiter de cette offre exceptionnelle, cliquez ici : http://register.tiscali.fr/adsl
Sous réserve d'éligibilité à l'ADSL.




More information about the mythtv-dev mailing list