[PATCH] spin up drive at open

Steven Walter stevenrwalter at gmail.com
Wed May 17 02:08:48 CEST 2006


Does the read() call in Linux use a timeout?  A braindead grep for "timeout"
in the code base only showed hits in areas relevant to BSD, QNX, and another
non-Linux OS.  Another thing, looking at the strace from mplayer, I see
open("/dev/dvd") followed immediately by ioctl(DVD_READ_STRUCT); no
intervening read.  And even if there were, I see no guarantee that the read
wouldn't be filled from cache, keeping the drive spun-down.

On 5/16/06, Christophe Massiot <massiot at via.ecp.fr> wrote:
>
> At 12:57 +0200 10/05/06, Diego Biurrun wrote:
>
> >  > My DVD-ROM drive exhibits the peculiar behavior of refusing to
> properly
> >>  authenticate if the drive is not "spun up."  Previously I had worked
> around
> >>  this by starting my media player "dd if=/dev/dvd of=/dev/null; mplayer
> >>  dvd://" and just hitting Ctrl+C once the drive made enough noise :-)
> >>
> >>  However, I've found that the attached patch fixes this issue for me,
> and
> >>  allows the drive to authenticate and movie-viewing to proceed
> smoothly,
> >>  whether the drive was spinning to begin with or not.  I am not,
> however,
> >>  sure that this is the correct way to fix things.  Does this even
> belong in
> >>  libdvdcss, or in some other software component entirely?  Please
> advise.
> >
> >I suggest you to propose this on the libdvcss-devel mailing list.  Given
> >that this appears to be Linux-specific I wouldn't have high hopes of the
> >patch getting accepted.  But possibly a different solution can be found.
>
> libdvdcss is the place to put system-specific stuff, so things like
> that definitely belong here. However I'm wondering if the patch is
> correct, because from what I understand of kernel documentation,
> CDROMSTART 1. only applies to drives capable of reading CD audio 2.
> instructs the drive to play the first audio track, which is
> definitely not what we want. So I'm wondering 1. whether it wouldn't
> yield problems with some other type of DVD drive than yours, and 2.
> whether the positive effect you're seeing isn't just a side-effect of
> the fact that CDROMSTART waits for the drive to spin up before
> returning. In that case the correct fix might just be to raise the
> timeout duration on the read() call to the DVD drive before it
> reports an error.
>
> --
> Christophe Massiot.
>
> --
> This is the libdvdcss-devel mailing-list, see
> http://developers.videolan.org/
> To unsubscribe, go to: http://developers.videolan.org/lists.html
>
>


-- 
-Steven Walter <stevenrwalter at gmail.com>
"If you think healthcare is expensive now, you should see how much it costs
when it's free."
    - P.J. O'Rourke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.videolan.org/pipermail/libdvdcss-devel/attachments/20060516/ca55e203/attachment.htm 


More information about the libdvdcss-devel mailing list