CDBeQuiet! v1.3.2
=================

Developed by ChrisR3tro
Mastodon: https://chaos.social/@ChrisR3tro
X: https://x.com/ChrisR3tro
E-Mail: chrisr3tro@pm.me
Project page: http://www.a20gate.net/dos-tools/


DISCLAIMER
----------
Usage may lead to data loss, spontaneous combustion and other calamities.
Use at your own risk!


Licensing
---------
This program is free and open-source software as long as it's used privately.
Commercial use, as unlikely as it may seem, is hereby prohibited.
The source code may be modified and distributed as long as my contact info
is left in place.


What this tool does (please read first!)
----------------------------------------

There are some important things you'll want to know about before using
CDBeQuiet!. Until you can safely use this tool, some testing needs to be done,
which involves a benchmark to measure the speed of your CD drive.

This is necessary, because the speed setting that is best suited for your
drive needs to be determined first. Wrong settings can lead to poor CD read
performance!

Optical disk drives (CD, DVD, ...) have become really fast and thus can cause
noise during operation. This can be especially annoying with games that
continuously need to access the drive during gaming sessions.

CDBeQuiet! (aka CDBQ) sets the CD drive to a lower speed setting of your
choice. This should result in a slower spindle speed leading to an overall
more silent operation.

This is all done by sending a special command to your CD drive, after which
CDBeQuiet! quits immediately. So it won't take up any conventional memory
or stay resident.

If the tool generates any errors or you encounter problems while running it,
you can let me know (but you don't have to :-). When sending me emails,
please also include a log file. Use the /l command-line switch to create
the log file.


Requirements and notes on operation
-----------------------------------

* First of all, you need a real DOS environment, such as MS-DOS 6.22,
  FreeDOS, DR-DOS or the DOS version of Windows 9x/ME (e.g. DOS 7.0 and up).
  (Not the DOS command-line window under Windows)

* This program will not run under Windows. That was never the goal,
  as there are other tools that can slow down optical disk drives under these
  operating systems. Also, it will not run under DOSBox (the DOS emulator).

* Your optical disk drive has to support the ATAPI command "SET CD-ROM SPEED".
  Not all drives do. Have a look at the supported drives list (DRIVES.TXT)
  and if you are unsure, nothing speaks against trying it. Please consider
  letting me know if this tool works out for you via email, so I can add your
  drive to the list.

* Don't expect your CD drive to follow the selected speed setting very
  accurately. There are many drives out there that support the ATAPI command
  mentioned above, but it's up to you to figure out which setting suits your
  drive best. Please read the "How to test the settings and which rate to
  choose?" chapter below for more info on that.

* Audio playback or audio extraction speeds are not affected.

* If you make my tool part of your automated boot process (e.g. putting it
  in autoexec.bat) please make sure to load any device drivers of your optical
  disk drive BEFORE executing CDBeQuiet!. Device drivers (atapicd.sys,
  mscdex.exe, ...) may send a soft-reset command, which will reset all
  settings my tool sent.

* Some drives tend to forget the speed setting once you open/close the tray.
  I suspect this is due to a soft-reset by the drive's firmware. In this case,
  the only workaround up until now is to execute CDBeQuiet! again after
  changing the medium.

* Your optical disk drive (be it CD-ROM, DVD-ROM, ...) has to be an ATAPI
  device conntected to an IDE controller. SCSI drives are not supported.

* On DVD drives, the DVD read speed won't be affected. Same goes for writing
  speed on CD/DVD burners.

* The speed settings are not saved in any way in the drive's firmware and
  will be gone once you reboot or power-off your PC.


How do I run it?
----------------
This program is invoked through the command-line under DOS.
Please use the /? switch for further instructions. Type:
  cdbq /? [Return]


How to test the settings and which rate to choose?
--------------------------------------------------

It is important, that you determine the correct speed setting for your drive,
BEFORE you make use of CDBeQuiet! regularly. You can test different speed
settings with the benchmark tool "SPEEDSYS".

1. SPEEDSYS makes use of your ATAPI CD-ROM device driver, so you'll have to
load it prior to CDBeQuiet!. It will be best to create a boot floppy disk
for this purpose and only boot up with what's necessary for the test:
Your ATAPI driver and CDBeQuiet!.

2. After boot, for testing purposes, invoke CDBeQuiet! at a read rate of
600 kb/s (quad speed). This is done through -s600.

3. Please insert a data CD (no CD audio or hybrid disk) into your optical
disk drive. It should be an original CD-ROM (not a CD-R or CD-RW) with at
least 500 mb on it and make sure it's free of dirt and scratches. That is
necessary, because we have to rule out anything else that can affect
spindle speed and noise during our tests.

4. Start SPEEDSYS with the following command:
SPEEDSYS.EXE /CD /T2. You should now see at what speed your drive is
operating. Put your ears against it and decide if it's silent enough and if
you are satisfied with the read performance.

5. Repeat the process until you are satisfied with the results, increasing
the read speed in steps of ~ 100-300 kb/s. Do this, until you have achieved
a good trade-off between noise and read performance.

For installation purposes where large amounts of data is to be
transfered to hard drive as fast as possible, you can always have CDBeQuiet!
set your read speed to maximum with the -s0 parameter.

For long DOS gaming sessions, I recommend at least 6x (900 kb/s) real read
performance. CD drives react to speed settings in different ways: Some are
very accurate and maintain the exact read rate you set. Others only change
their read rate in several steps and don't support every little interval.
For instance, it might be the case, that a drive doesn't distinguish between
settings from 600 to 900 kb/s, but selecting beyond 900 kb/s leads to
significantly higher throughput. And some drives don't react to speed
settings at all, which normally suggests that they simply don't support it.
Also keep in mind that some drives don't retain the rate setting after you
open/close the tray. In that case, you have to re-run CDBeQuiet! after each
CD change.

So, before you can use CDBeQuiet! efficiently, it's always best to know
which group your drive belongs to and in what speed setting it will operate
fast enough, but still silent.


Development
-----------

This tool is compiled using the Open Watcom C compiler v1.9.
You can use Watcom MAKE to build it.


Acknowledgements & Special Thanks
---------------------------------
The basic approach of this tool is derived from an assembler program by a guy
called "Hackman". Thanks Hackman!

For more info have a look at his page: http://lateblt.tripod.com/
And especially:                        http://lateblt.tripod.com/atapi.htm


Version history
---------------

1.3.2:
  * Fixed a number conversion bug in speed parameter.
  * Fixes to command-line parser
  * Updated contact info throughout project

1.3.1:
  * Fixed a long standing bug with swapped ATAPI signature register offsets
    and inverted validation logic that together allowed valid drives to pass
    an incorrect check. (oops)
  * Improved build system a bit, since I moved to Linux
  * Small fixes

1.3.0:
  * Allow for speed setting of up to 65534 kb/s as defined in ATAPI spec.
  * Better handling of disabling and re-enabling interrupts
  * Can suppress text output via /Q switch now
  * Removed logging function (wasn't really used anyway)
  * Command-line arguments parsing is now done case-insensitive
  * Much improved command-line parsing code (got rid of  getopt() dependency)
  * Updated usage text (via /?)
  * Removed some unnecessary newlines before and after program banner/usage
  * Improved error handling
  * Added build date into program banner
  * New three-number versioning scheme
  * Smarter makefile
  * Made code a lot more modular
  * Various code cleanups
  * Updated readme.txt a bit
  * Planted an easter egg :)

1.2:
  * Fixed some small errors to do with error messages about missing
    command-line switches
  * Improved register polling function, so program should execute faster
  * Runs on 286 now
  * Removed WORD, BYTE, PORT typedefs
  * Removed dependency for time.h and FPU emulation
  * Removed dependency for log.h in IDE code
  * Removed dependency for stdio.h in IDE code
  * Added #defines to prevent multiple includes of headers
  * Revised build process
  * Added tasks and settings file for Visual Studio Code for compiling
    with Watcom's Windows version. There's even a problem-matcher that parses
    output from the compiler and displays any errors/warnings in VS Code. Enjoy!
  * Some changes to readme.txt including "Licensing and Disclaimer"
  * Made all source files adhere the 80 column limit. Yay, DOS!
  * New contact information and project page!

1.1:
  * Added support for rarely used IDE base port addresses (1e8h & 168h)
    Thanks to "Dimitrios" who provided a patch!

1.0b:
  * Builds on Open Watcom compiler now (removes dependency on CWSDPMI host)
  * Added makefile (use with WMAKE)
  * Minor bugfixes

0.9b:
  * New POSIX-style command-line parsing
  * New sanity checks that prevent sending ATAPI commands to hard disks
  * Better IDE error detection
  * New -f switch that allows to skip all sanity checks (expert use)
  * No more -v switch
  * Source code now much more modular and clean

0.7b:
  * Display drive model and firmware info via /i switch
  * Soft-reset command via /r switch
  * Screen output loggable via /l switch
  * Drive detection more reliable
  * Error handling more accurate
  * IDE error detection (preliminary)
  * Minor bugfixes

0.6b:
  * initial release
