Most of the information here is also in other parts of the primer, some in greater detail. Still, the questions about buffer underrun - sometimes called "failure of streaming" - persist. So, let's consider it as a separate matter in order to help you diagnose it if it occurs and to cure it. Note too that buffer underrun protection, such as BURNProof, greatly reduces the risk of buffer underrun but does not eliminate it completely.
"Buffer underrun" simply means that the buffer supplying data to the writer has emptied before the data are completely written. Since mastering a disc requires that the burn of any track (at least) be continuous, interrupting the flow means - coaster time! (Because of the way that packets are written, buffer underrun cannot be a problem there.)
There are two sorts of buffer involved in CD-R: one within the writer and one which the mastering software may create from system RAM. Not all programs do it. Recent versions of CDRWin, ECDC and WinOnCD certainly do; others probably do as well, but you may want to check your preferred program. In a reasonably well configured system, the amount of buffer made from system RAM is much greater than that within the drive. Even more to the point, there is no feedback from the drive to tell the software how much buffer is being used. The result is that if you have a display of buffer level, it is reporting only the system RAM being used. That may go down to zero safely - you still have whatever is in the drive - but usually if it drops, complete underrun (which will be reported to the software) is only seconds away and unavoidable. For that reason, if you are trying to analyze the buffer underrun, it is useful to record the way the buffer behaves before the fact. Fortunately, underrun is usually found during test as well as while burning, so it can be analyzed without wasting a blank.
The normal pattern for buffer level is that it will build up quickly before the data writing begins, then hold steady - typically well over 90% - until just before the last data are to be written. Then the buffer drains to write the last information to the disc. Remember that pattern, it will be important.
One way to prevent a buffer underrun is to make the buffer so large that it cannot be emptied during the burn. Since that would mean something like a gigabyte of RAM, that's not the solution most of us choose. An alternative is to use the hard drive as a buffer - which will usually work if the problem comes when recording from another source, such as a CD-ROM - and we'll see where that is used in what follows.
Okay, if we can't put the whole disc into RAM, the objective is to keep the buffer filling more or less as fast as it is emptying. Since we're writing at between about 150 KB and 2 MB per second (1x data to 12x audio), that may be no problem at all or a severe burden on the system. If you are simply writing too fast for your source to keep up, the buffer level will ramp up to 100% initially, then gradually fall to zero - and continue to fall invisibly as the buffer in the drive is drained to produce an underrun. The solution here is either write at a lower speed or get your source to run faster. Depending on how you have configured your system, there are various ways to make the source drive run faster, but they may be more expensive or less convenient than you like. The simplest way to get your hard drive to run faster is to avoid using it for any heavy lifting while you burn. If you're close to your system's speed limit, shutting down other programs may be necessary.
What can slow down your source drive? If it's a hard drive, fragmentation will do a really good job of that; see the page on Arithmetic 101 for the effects of fragmentation and of dealing with large numbers of files. The fix in that case is simple: defrag the drive and (if you have a lot of files) write from an image. If you're reading from a CD-ROM instead of a hard drive, you need to check both the nominal speed of what you're trying to do (for example, a lot of "high-speed' drives only do DAE relatively slowly) and the actual speed given the disc you're trying to read.
Three factors typically slow the reader below the speed you expect it to deliver. One is consistently high error rates - typical of a CD-R or a scratched or dirty pressed disc. Rereading is very slow; even a modest error rate can cut the effective speed of your reader, even reduce it below 1x. That is not known to the software until the burn begins, when nothing can be done about it. If you suspect that cause, you can check the disc with CD Speed or simply make an image (where the read speed doesn't matter) and burn from that. If this is the cause of the underrun, the buffer level will fall gradually, but usually not smoothly, in a pattern similar to that of simply having too slow a source drive.
The second factor which can slow the CD-ROM reader is a severe scratch or similar localized damage which causes it to read well most of the time but to have trouble in one area. In that case, the buffer will stay up until that region is encountered, then fall rapidly as the reader re-reads to try to get valid data. You will see the read light flash as you watch the buffer drain. You can try writing from an image, but more often you will have to repair or replace the source disc.
The third cause is that the source drive simply stops for a period; when it starts up again, if it does not reach operating speed quickly enough - underrun! Most high-speed readers have a spindown time to save the bearings. If the drive is not reading information for that period, it is allowed to spin down, then when queried it will spin up. A CD-ROM being used for copying is not reading between sessions of a multisession disc. The pattern here is that the read light goes off while the buffer drains at the end of the first session - and the drive begins to spin down. You can deal with that problem in several ways: increase the spindown delay; write at higher speed (so the time to change sessions is reduced); write the second session to your hard drive and copy the first from the CD-ROM, the second from the hard drive; make the copy in separate sessions, one for each on the source; and so on. (To find out about changing spindown delay, check with the manufacturer of your reader. Using unapproved methods can damage the drive and void the warranty.)
Note that a similar condition can occur on a hard drive if its sleep time (typically, on a laptop) is set too short. There's another way that the buffer can be drained while you write from the hard drive: some other program may come along and override the high priority the mastering program set. What sort of program would do something that stupid? FastFind, some anti-virus monitors and other programs which insist on reading all your drives - including the one you're writing. Since the drive cannot read and write at the same time, if a very high priority read command is received, the writing will stop and the buffer will be drained so the read can be performed. The solution is simple and has no known alternative: kill the monitoring program.
In case you have not guessed, these are not all the ways that a buffer underrun can occur and far from the list of ways you can cure the problem. However, they should be enough to help you find out the cause of your problem and to fix it. Since you are the person who sees what's happening, you are in the best position to remedy any difficulties; fixing it by remote control through e-mail or even voice is extremely difficult.
E-mail me at cdrecording@mrichter.com
Return to Mike's home page