
 README -- Main documentation file for the ATAPI set_cd_speed
           ioctl() kernel patch.

 (c) 1998  Toni Giorgino                   (toni@pcape2.pi.infn.it)




SUMMARY
=======

This patch against Linux 2.0.33 kernel will allow you to reduce the spindle
and data tranfer rate of an ATAPI cdrom drive, hopefully enabling you to
read problematic or badly pressed CDs.



LEGALESE
========

This is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version.

THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.



DESCRIPTION
===========

Working draft ATAPI 2.0 states that ATAPI CD-ROM peripherals should respond
to a "SET CD SPEED" command to reduce their spindle and head speed. This is
good, since sometimes you are able to find badly pressed media (...or badly
pressed CD-ROM drives :) which you are not able to read, or which cause
various inconveniences including: timeout errors; ATAPI reset; excessive
noise; very low data throughput.

After you have applied this patch to your kernel, you will be able to set
the speed of an ATAPI CDROM drive, in kB/s, via the argument of a
CDROM_SELECT_SPEED ioctl(2).  A program to automate this, cdspeed.c, is
included.  The program is intended to be self explanatory.

CDROM_SELECT_SPEED is #defined in <linux/ucdrom.h>.


NOTES
=====

This patch was originally written to read those CD's whose "zero" track is
not recognized, that is, their type is not recognized once inserted into the
CDROM and therefore are completely unusable.  The patch did NOT solve the
problem for me, as it seems that the speed is reset to the maximum every
time the slot is opened.

This patch DID actually solve timeout errors I had attempting to read
masterized CDs (setting the drive to read them slower, of course), whose
zero track was ok.

I can actually hear my CDROM driver spin down immediately after the ioctl
call.  For most values of the argument, anyway, it again spins up to the
maximum speed once the disc is accessed.

The file cdrom-standard.tex proposes that the CDROM_SELECT_SPEED takes as an
argument the relative speed to be set: 1 for 150 kB/s; 2 for 300 kB/s or
2X...  The reason for which I didn't follow this guideline is that my CDROM
- and I suppose others - isn't linear in the speed parameter.  I get 2.5X
speed every time I ask for anything different than the maximum and some
other special values.  Converting relative speed into absolute data rate by
multiplying the argument of the ioctl by 150 would have been confusing for
the user according to me.


EPILOGUE
========

I am interested in receiving bug and success reports.
You may call it Planck's constant. I heard God calls it scheduler granularity.


                                                    Toni Giorgino
                                                toni@pcape2.pi.infn.it
