![]() Number 212 - January 2001 |
|
| The Truth About Buffer Underruns | ||
|
Kern Independent PC Users Group, Contributed by Stuart Ree Thanks to Bob Starrett (http://www.cdpage.com)1 via SVCA Sept 2000 Blue Chip News | ||
|
You've probably heard of
buffer underruns, and maybe even had them happen to you. Just in case,
let's first explain what a buffer underrun is: "Whatever speed you
select for writing your CD, recording will proceed at exactly that speed
until it is finished."
This means that the flow of data from its source (hard disk, CD-ROM drive, network, etc.) to the recorder must be at least as fast as the selected recording speed. If you're recording data at 8x speed, your source must be able to keep up a steady data stream of at least 1200 kilobytes/second. If this speed is not maintained, writing halts and the disc is ruined. To help prevent this, every CD recorder has some internal RAM memory that temporarily stores data during recording, acting as a "buffer" against slowdowns in the data stream. The buffer stores a small amount of data that it can keep feeding to the recorder until the flow of data from the source resumes. If the interruption is so long that even the buffer is emptied, that's a buffer underrun, which is a major cause of coasters. [The ruined discs become cold drink coasters - ed] I hate to break the bad news, but on a properly configured Pentium (200 MHz or faster) with 32 megabytes of RAM, you will not suffer buffer underruns when recording a CD at 4x--although a look at the newsgroups or support sites may lead you to believe that CD recording is constantly beset by this problem. First off, buffer underruns go hand in hand with CD recording. They happen for various reasons and always have, even in the early days when recording speed was limited to 1x and the host machine was likely an ISA-based 16 MHz 386 with 4 or 8 megabytes of RAM. That setup might understandably underrun, although it usually did not. Today, computers are faster, of course. And so are recording speeds. With 8x prevalent and 12x in the picture, it is easy to see that buffer underruns will continue to be a concern for CD-R/RW users. However, many buffer underruns are not buffer underruns at all, but some other phenomenon that causes the recording software to return that error. This can be the result of recorder command set errors poorly interpreted by software, or a faulty recorder. We all know that buffer underruns occur when the computer is unable to transfer data to the recorder fast enough to keep the recorder's buffer full. Because recording is a real-time process, the data must flow in a steady uninterrupted stream to make recording successful. Many factors can affect the data stream, and slow it down or interrupt it completely. Some are true enemies of successful recording, and others are not. Hardware, software, and source media can all affect the recording process. On the hardware side, the culprit is usually the source you are recording from, whether that is the hard drive holding the files to be recorded, or a CD-ROM drive, ZIP, JAZ, or other removable media. A hard drive can cause buffer underruns if it's extremely slow, or (usually only if it's an older drive) it uses thermal recalibration. Thermal recalibration is a process by which the hard drive "takes a break" from data transfer to adjust itself to compensate for changes in operating temperature. During this "break" no data is transferred. It is unlikely in the modern desktop computing environment that either of these will be the case. Modern hard drives are plenty fast, and most manufacturers have remedied the thermal recalibration problem. Fragmentation Problems Another hard disk problem is fragmentation. As a new hard drive is used, and more and more programs installed and uninstalled, files created and deleted, and data copied to and moved around on the disk, the drive becomes fragmented. This means that a file or program is not stored on the hard disk in contiguous sectors, but is spread out over several different areas, and must be reassembled before it can be used. When many files or programs are not contiguous on the disc, the disc is "fragmented". When your system accesses the data you want to write to CD, the hard disk heads must move around a lot to pick up the pieces of the fragmented files to assemble them for transfer to the CD. This slows down the rate at which the hard drive can transfer data, possibly resulting in an underrun. Other problems, too, can originate from the source drive. Windows and BIOS power management features may be good for the global environment, but in the CD recording environment, they are as destructive as a stagnant pool of pesticide-laced water. Turn off the power management features in your BIOS and in Windows, at least those that attempt to spin down hard disks and CD-ROM drives. |
Hard Drive Optimization
One of the features introduced in Windows 95 and carried over to Windows 98 and Windows 2000 is hard drive read-ahead optimization. Turning this feature off can help to prevent buffer underruns. Here are the steps: 1 Select Settings from the Windows Start menu. 2 Select the Control Panel item. 3 Double-click on System. 4 Click the Performance tab on the right. 5 Click on the File System button near the bottom left of the dialog box. 6 On the first (hard disk) tab you will then see a slider marked "Read-ahead optimization". Slide it all the way to the left to disable read-ahead optimization. Controller Types When using a SCSI controller, always check the settings to make sure that they are appropriate for CD recording. To change SCSI controller settings, press CTRL-A as your computer is booting, or run the software that came with the controller. The settings recommended by Adaptec technical support can be read at http://www.adaptec.com/ support/ configuration/ cdrecscsi.html. It can be useful to check and update your drivers from time to time, both SCSI and IDE. Go to the manufacturer's Web site and download and install the latest drivers, especially if you are having problems. The card or motherboard manufacturer would not release new drivers if they did not fix some problem. However, if your recorder and other programs are all working well, there is no need to take a chance on a driver that may do more harm than good. Recording Audio Recording audio requires a faster data transfer rate than data recording. You may be able to record all day at 4x with data, but every time you try audio you get a buffer underrun. This is a sure sign that your data recording transfer rate was pretty close to the edge. Set a lower recording speed and try again. You can record from a network drive in many cases, but success depends on the setup (and speed) of your network. If it works, fine; if it doesn't, you'll need to copy all the data you want to record to a local hard drive. Recovery Trying to record a damaged file may also cause a buffer underrun. Use Windows' hard disk error checking function regularly, to find and repair file damage. Trying to record a file, which is open or in use during the recording process (such as system files or swap files) may also cause a buffer underrun with Easy CD Creator or Toast; these software applications are not designed to handle open files. Use backup software such as Take Two (included with Easy CD Creator 4 Deluxe) to make full system backups. Recording many small files, especially if they are all in one directory, is a recipe for buffer underruns. Easy CD Creator can take care of this problem, however. Select "CD Layout Properties" from the File menu. Halfway down the General tab you'll see a checkbox with "Single data track only". Deselect that check box, and Easy CD Creator will cache all the small files in your layout to an image file which it will write to CD as a separate track, then it will go on to write the larger files directly from hard disk to CD as usual. Caveat You will be able to read this disc on a CD-ROM drive just like any other CD, but, because it contains multiple data tracks in a single session, such a disc may not be suitable as a master for factory replication. The nature of the error correction [ECC] and error detection code [EDC] on CD-ROM is such that, if you are trying to copy data or audio from a disc that is damaged, scratched, dirty--or otherwise in poor physical condition--the CD-ROM drive will continue to try to reread and recalculate the data through ECC/EDC. This, too, may cause a buffer underrun. Like any electronic device, a CD recorder can break. A damaged recorder can return many error messages, including buffer underrun, but a damaged recorder may return false messages. Don't assume that every error reported by the software is correct, especially if you suspect that the problem is with the recorder itself. Finally, check your system.ini file and make sure the cache settings are set to MinFileCache=512 and MaxFileCache=4096.
|
|
Number 212 - January 2001
|
|
|