libcdio-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libcdio-devel] Miscellaneous questions, primarily on design


From: Rocky Bernstein
Subject: Re: [Libcdio-devel] Miscellaneous questions, primarily on design
Date: Sat, 21 Mar 2020 07:52:10 -0400

On Sat, Mar 21, 2020 at 7:34 AM Thomas Schmitt <address@hidden> wrote:

> Hi,
>
> Samuel May wrote:
> > > the physical button on the front of my drive stops working
>
> Rocky Bernstein wrote:
> > if you look at the GNU/Linux code in lib/driver/gnu_linux.c around line
> 80
> > you'll see the different levels of access modes. In particular there is
> > read/write (_AM_MMC_RDWR) and read/write exclusive (_AM_MMC_RDWR_EXCL)
> > and later you'll see the access-mode string that correspond to this are
> > "MMC_RDWR" and "MMC_RDWR_EXCL".
>
> Aren't those about the exclusive or shared use of the device file ?
>

I am not sure I uderstand. The "device file" can be be a device like
/dev/sr0 or /dev/cdrom with is the CD/ROM device.
I seem to recall on OS/X problems with libcdio possibly in that
commented-out code which gets exclusive access not  releasing access even
though it looks like it should. And therefore after the first use things
hang. "hang" can mean that there is another program possibly libcdio which
will wait indefinitely for exclusive access to become available which never
happens unless you resort to somehting like ejecting the medium which of
course will force whatever else has exclusive access to stop having it.


>
> I have to correct myself. It is not SCSI command 1B START/STOP UNIT but
> 1E PREVENT ALLOW MEDIUM REMOVAL which controls the possibility for
> medium removal by an operator.
>
>
> The SCSI command bytes for unlocking the drive tray are
>
>   { 0x1e, 0, 0, 0, 0, 0 };
>
> for locking the tray:
>   { 0x1e, 0, 0, 0, 1, 0 };
>
> In include/cdio/mmc.h the command is mentioned as
>
>   CDIO_MMC_GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL
>                                         = 0x1e, /**< Enable/disable Disc
>                                                    removal. (6 bytes). */
> used in lib/driver/mmc/mmc_ll_cmds.c by
>
>   mmc_prevent_allow_medium_removal()
>
> declared in
>   include/cdio/mmc_ll_cmds.h
> used by
>   mmc_eject_media()
> used (as alternative to ioctl(CDROMEJECT)) by
>   eject_media_linux()
> exposed as
>   cdio_funcs_t.eject_media
> used in high level API call
>   cdio_eject_media()
>
> I cannot spot a higher level API call which would unlock the tray without
> trying to eject it.
>


Well, that was part of my point. If there *should* be one, we can add it.


>
>
> Have a nice day :)
>
> Thomas
>
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]