freac
freac copied to clipboard
Option to Zero-Fill Unreadable Sectors (Instead of Aborting the Rip)
Because fre:ac
bails at the first sign of trouble, it misses out on any readable data living on the other side of a scratch.
It would be useful to have an option to zero-fill unreadable sectors (instead of quitting) to produce a rip that is as complete as possible.
Such rips (obviously) wouldn't be 100% accurate, but they might be accurate enough for a third-party helper like CUETools
repair.
(This option would probably need to be presented as an alternative to CDParanoia. Even if they don't outright conflict with one another, it wouldn't make sense to apply both at the same time.)
Thanks!
zero-fill unreadable sectors
Aside from the reasons given by the OP (maximal extraction, faithfulness to the original), outputting silence (when the original data truly isn't recoverable) is most sensible from an audio engineering perspective. I'm thinking in terms of what's best for equipment (especially speakers). Pops, clicks, and such are to be avoided (else harshly attenuated).
Preferably, at the start & end of a muted/silenced section, ensure that the waveform reaches the zero/neutral position (mid-way between max-pos and max-neg output voltages/pressures). Avoid ending/starting at a non-zero/non-mid value, or otherwise generating a non-sine waveform (production engineering of the original recording not withstanding; some mastering is terrible (eg significant clipping(!))).
zero-fill
While I know what you mean from a software perspective, literal zeros may not be best in terms of audio output.
Actually, I think it would depend on which PCM format is being used; I can't recall for CDDA. Some PCM schemes (non-linear amplitude ones come to mind) use non-zero values for the neutral/mid position. So, the filler/padding data should match whatever will have the speaker remain at rest (no net force being applied to it). That might be the mid-point between minimal & maximal values, for example.
Otherwise, it could be that the output suddenly goes maximally-negative, and holds there. Essentially producing a (very) long square-wave. Bad for speakers.
Flat-line silence is what's desired, in the end.
However, the general idea of not aborting but padding the unreadable segment with silence, is one with which I quite agree. I have some discs which have scratches quite early on, while post-scratch is quite readable. Aborting any attempt to read most of the disc is non-ideal.
Thanks for the additional context, @Lee-Carre!
zero-fill
While I know what you mean from a software perspective, literal zeros may not be best in terms of audio output.
You're right, interpolation will almost always sound better than an abrupt drop from noise to null, but most optical drives interpolate unreadable samples whenever possible by default anyway. (Interpolated samples aren't usually accurate, but they shouldn't interfere with the rip process.)
This issue is more about edge cases where a drive can't — due to extensive damage — or won't — for example, a Pioneer drive operating in "Perfect Mode" — interpolate unreadable data and return a hard SCSI read error instead. (Hard errors are what cause fre:ac
to give up.)
Because discs (and most individual tracks) are naturally padded with thousands of null samples — \0\0\0\0
in raw PCM bytes — that's something of a convention for representing non-data data. EAC
and redumper
both mark unread/unreadable sectors with null samples, for example.
But it doesn't really matter. So long as all the readable samples wind up in the right place, there remains hope for CUETools
repair to fix the rest. :wink: