User:Gordon/Optical Drive Testing Script

From FreekiWiki
< User:Gordon
Revision as of 14:47, 16 December 2009 by Gordon (talk | contribs)
Jump to navigation Jump to search

Why automate optical drive testing?

Optical drive testing is currently a time consuming, error prone manual process that relies too much on human judgement and doesn't yield enough information about the drives being tested. A look at the current testing documents reveal a very complicated flowchart and several long lists of instructions for testing various types of drives. Based on the documentation and in my experience in advanced testing, much more human effort is expended per drive than many of the drives are worth; a brand-new DVD+R dual layer burner can be had for $27 on Newegg. This is a process that begs for increased automation so that less work time is spent per drive and fewer testing errors occur.

I propose the following:

  • To write software which makes use of freely-available open source tools in order to standardize and largely automate the identification and testing of optical drives
  • To provide standardized test subjects for the software (i.e. CDs and DVDs pre-burned with known test data)
  • To create a specification for sticky labels, if such labels are deemed useful by Free Geek staff, such that drives are better identified according to their capabilities
  • To make the software configurable such that Free Geek staff can easily change the criteria by which drives are recycled as the capabilities of incoming hardware continue to improve

Proposed testing strategy

Right now, on the subject of optical drive hardware, much of this is written from my memory and general knowledge. Please correct it if it is wrong.

Testing needs

Assuming we are testing a multifunction drive that can read and write both CDs and DVDs, there are several main functions which we need to test:

  1. The mechanical function of the drive, including its ability to spin properly and the ability of the laser sled to move back and forth properly over its full required range of motion.
  2. The function of the CD read laser and pickup.
  3. The function of the CD write laser. It is my understanding that CD-R and CD-RW discs are written with the same laser, and higher power is used to write CD-RW discs. This is the basis for my assertion that a write test on CD-RW is sufficient to also declare CD-R write capability good.
  4. The function of the DVD read laser and pickup.
  5. The function of the DVD write laser. Again, it is my understanding that writing a DVD-RW uses the same laser as writing a DVD-R but at higher power. This is the basis for my assertion that a write test on DVD-RW is sufficient to also declare DVD-R write capability good.

Meeting testing needs

  1. The drive's mechanical function can be tested with a CD-ROM read test which reads and verifies data from both the central and peripheral surfaces of a disc. If the drive cannot spin properly, the test will fail. If the laser sled is sticky, it may fail to read the outside or inside edge of a disc. I propose to use pre-burned CD-ROMs with multiple sessions containing files full of random data for which a hash is known. The basic read test would read the innermost and outermost session on the disc, verify the data it gets back, and time the test so as to reject drives which are returning valid data after many retries.
  2. The above test also implicitly tests the CD read laser/pickup.
  3. To test the CD write laser, a data file would be written to a CD-RW and then read back and verified. This would be done in sessions. I believe there is ~20MB overhead per session, so write 15MB data + 20MB overhead = 20 sessions per CD-RW disc before the disc must be blanked.
  4. To test the DVD read laser/pickup, a similar test as done for the CD function would be done with a pre-burned DVD-ROM.
  5. To test the DVD write laser, a similar (but larger) data file as for the CD-RW test would be written to a DVD-RW and then read back and verified.

Eventually, rewritable media will either wear out or become scratched and dirty and need to be replaced. How to detect this and whether the user can be automatically instructed to discard old media is an open question.

Software requirements

  • The script must correctly identify CD-ROM, CD-RW, DVD-ROM+CD-RW (combo), DVD +/- RW, and DVD+R dual layer (DL) drives. I will leave DVD-RAM out because DVD-RAM-only drives are uncommon and should probably be recycled.
  • The script must test read functionality from known-good CD-ROMs for CD capable drives.
  • The script must test read functionality from known-good DVD-ROMs for DVD capable drives.
  • The script must test read functionality on both the central and peripheral surfaces of a known-good disc in order to rule out laser sled malfunctions.
  • The script must test and verify write functionality on a known-good CD-RW disc for CD write capable drives. We assume that the ability to successfully write to CD-RW (high laser power) indicates the ability to successfully write to CD-R.
    • If using sessions, the script must erase CD-RWs when they fill up with test sessions to enable their reuse.
  • The script must test and verify DVD-RW write functionality on a known-good DVD-RW disc for DVD write capable drives. We assume that the ability to successfully write to DVD-RW (high laser power) indicates the ability to successfully write to DVD-R and DVD+R/RW; see "questionable requirements" for more information on this assumption.
    • If using sessions, the script must erase DVD-RWs when they fill up with test sessions to enable their reuse.

Requirements which need vetting by Free Geek staff

  • I believe that DVD+R/RW drives which are not capable of DVD-R/RW are a very small minority. In my (dated) research, DVD-R/RW is more widely compatible with various equipment than DVD+R/RW, so I propose testing only with DVD-R/RW and assuming this indicates DVD+R/RW functionality (if present) will also work, since the same physical hardware is involved; I further propose recycling any old drives that are not capable of DVD-R/RW (i.e. DVD+R/RW-only drives).

"Nice to have" requirements

  • It'd be nice if the script could keep track of how many times a rewritable disc has been used and tell the user to discard it and use a new one after a certain number of rewrite cycles. The buildup of scratches and dirt on the disc surface and the limited write cycle life of rewritable disc media will necessitate periodic replacement of test discs.
  • Identification of Lightscribe capability would be nice.

Dependencies

  • The script, if written by me, will be written in Python (whatever version is installed by default in Ubuntu 9.10)
  • The script will depend on 'wodim'.
  • The script will likely depend on 'cdrecord'.