News for hackers. Stuff that matters.
Re:How to rip audio CDs 2022 – with drive accuracy listing by arbitrage on Sunday November 06, 2022 @08:55PM (#33500089)
Error-correction in audio CDs can correct errors up to a specific threshold of corruption.

Additionally, there is no way to know that you've passed that threshold -- the drive will just return bits, with no way to guarantee that they're correct.

A better description for this is "passive" error-correction. To try to get a 100% bit-perfect rip, it's preferable to start off with a drive that you know minimizes errors in the initial read process.

Re:How to rip audio CDs 2022 – with drive accuracy listing by randombits0 on Sunday November 06, 2022 @09:09PM (#33500194)
Ah, so audio CDs were engineered to provide best effort data correction instead of dead-sure data correction to serve the audio market instead of the data market.

That just goes to show the lack of design foresight. They were still thinking in terms of grooves carved in plastic or a waveform on tape.

Re:How to rip audio CDs 2022 – with drive accuracy listing by at_a_remove on Sunday November 06, 2022 @09:11PM (#33500217)
What do you suppose dead-sure data correction would look like?

My guess is that you couldn't fit a lot of information on it, what with the redundancy to make it perfect.

Re:How to rip audio CDs 2022 – with drive accuracy listing by Tempest1981 on Monday November 07, 2022 @01:06AM (#33501783)
3 copies of each CD, stored in different locations, inserted into different players, interconnected via ...
Re:How to rip audio CDs 2022 – with drive accuracy listing by gnramires on Monday November 07, 2022 @09:00PM (#33515114)
With coding dead-sure correct isn't usually much different in capacity -- you usually don't need to sacrifice bandwidth completely to get reliability. In fact, a simple checksum with a good number of bits (e.g. CRC32) will pretty much give dead-sure accuracy (non-adversarial, you can hash e.g. SHA256 to get cryptographic certainty). If errors were evenly distributed (independent and identically distributed bit flips), it's generally very easy and well known how to obtain dead sure error correction, and the bandwidth you get is known as the channel capacity (C) of the medium (usually in bits/bit or bits/symbol) -- a "good code" operating at a rate R < C (under or equal to capacity) will give you this property; good codes, depending on the error rates, require moderately large block sizes (usually from 8b to 1-2kb in practice).

Real media like CDs usually have 'burst errors' like scratches that give a whole bunch of successive bit errors; however, there's an interleaving process to "spread" the errors across blocks, i.e. spread the information so it will resist a scratch. In an absolute way, indeed it's impossible to guarantee almost no errors (although you can guarantee almost no undetected errors) -- simply because your CD might be ruined in a way (which I guess isn't all too unlikely). By setting your rate R to a reasonable level above your drive error rates, you can get almost no errors (as few as you like) within those bounds (and fail above).

Here's a typical error rate curve for a moderately large (255b) code: https://en.wikipedia.org/wiki/Reed%E2%80%93Solomon_error_cor...

Re:How to rip audio CDs 2022 – with drive accuracy listing by SideQuark on Sunday November 06, 2022 @09:52PM (#33500537)
There's no such thing as dead sure error correction, and there cannot be.
Re:How to rip audio CDs 2022 – with drive accuracy listing by sp332 on Sunday November 06, 2022 @10:12PM (#33500669)
You could include a hash of the correct data, which would tell you in the (cosmically) vast majority of cases when your data has been corrupted.
Re:How to rip audio CDs 2022 – with drive accuracy listing by defrost on Sunday November 06, 2022 @11:33PM (#33501179)
Indeed.

That is, however, error detection and not error correction.

Once an error is detected you can apply 'correction' to the nearest probably correct value .. which only 'works' for errors under a threshold.

Hence the assertion in comment above yours.

Re:How to rip audio CDs 2022 – with drive accuracy listing by ars on Monday November 07, 2022 @12:28AM (#33501560)
How many hashes will you include? A single one for the whole CD? That tells you if you have an error, but not where?

A 32 bytes hash for every 32 bytes? Then you double your storage requirements.

There are actually WAY better algorithms for this than a hash (a hash is meant to handle secrets and cryptography - it's the wrong thing for this purpose).

ECC codes can tell you if the data is bad - and you can choose how many bytes this covers, and that can also fix bad data, again, you can choose how many errors per byte you want.

If you are curious: https://en.wikipedia.org/wiki/Error_correction_code

Re:How to rip audio CDs 2022 – with drive accuracy listing by ajsnigrutin on Monday November 07, 2022 @06:28AM (#33504495)
For ripping, would it matter? It's probably not a feature that was needed back in time when audio CDs were designed, but in retrospective, getting a notification "bit error was detected when ripping, not sure where, but now you know" would help preservers - they could then find another copy of the CD and get a 100% accurate digital copy of the song (within limits of hashing algos of course).
Re:How to rip audio CDs 2022 – with drive accuracy listing by jefftk on Monday November 07, 2022 @06:55AM (#33504685)
> a hash is meant to handle secrets and cryptography - it's the wrong thing for this purpose

The rest of your comment is good, but I wanted to quibble with this: hashing is useful for a very wide range of things, and are one of the main building blocks of modern algorithms (hash tables being the best know).

Re:How to rip audio CDs 2022 – with drive accuracy listing by rawoke083600 on Monday November 07, 2022 @08:31AM (#33505558)
>How many hashes will you include? A single one for the whole CD? That tells you if you have an error, but not where?

Interesting ! At what point with today's high-capacity-disks (DVD etc), can we just say store the data x3 and take the value of the closest two ?

If the only thing we really want is "high-audio-accuracy" ?

Re:How to rip audio CDs 2022 – with drive accuracy listing by system2 on Monday November 07, 2022 @12:43AM (#33501646)
Re:How to rip audio CDs 2022 – with drive accuracy listing by SideQuark on Monday November 07, 2022 @07:41AM (#33505033)
Checksums don't provide error correction, nor are they without errors. And they cannot be - it's mathematical fact, hence my post.
Re:How to rip audio CDs 2022 – with drive accuracy listing by system2 on Monday November 07, 2022 @12:55PM (#33509426)
No, but it shows you if your copy is 100% accurate or not. Which proves that 100% identical copy is possible.
Re:How to rip audio CDs 2022 – with drive accuracy listing by SideQuark on Monday November 07, 2022 @03:26PM (#33511884)
No, it most certainly does not.

A N bit checksum can at most distinguish 2^n different bitstreams as "100% accurate", and that is assuming there are no transmission errors in transmitting the checksum itself. This is proven trivially by the pigenhole priinciple.

And for most media, the checksum is itself transmitted over a noisy channel like the rest of the data.

Read your link carefully.

Re:How to rip audio CDs 2022 – with drive accuracy listing by extropy on Monday November 07, 2022 @03:52AM (#33503088)
I think GP means prefect or nothing - it errors out if not able to get a valid read.

Regular error correction + checksum is a pretty solid implementation of that.

Re:How to rip audio CDs 2022 – with drive accuracy listing by hoseja on Monday November 07, 2022 @04:24AM (#33503389)
You can however make it astronomically improbable.
Re:How to rip audio CDs 2022 – with drive accuracy listing by SideQuark on Monday November 07, 2022 @07:39AM (#33505027)
Which is not what the OP asked for. You simply reintroduced error correction, and you cannot surpass the noisy channel coding theorem bounds.
Re:How to rip audio CDs 2022 – with drive accuracy listing by TheOtherHobbes on Monday November 07, 2022 @07:47AM (#33505101)
Re:How to rip audio CDs 2022 – with drive accuracy listing by SideQuark on Wednesday November 09, 2022 @05:12AM (#33529453)
The zero error capacity is defined for infinite length codes, none of which are usable in practice.

Another way to see it - care to list any error code used anywhere with zero error rate?

Read the paper. Shannon write about this in his 1956 paper and subsequent work analyses further, but it's theoretical, and probably not practical for any real world error codes.

Re:How to rip audio CDs 2022 – with drive accuracy listing by SideQuark on Wednesday November 09, 2022 @03:42PM (#33537532)
Oh, and another limitation in that paper: to get positive zero-error rate, there has to be input symbols in the channel that cannot ever map to the same output channel, which is not the case for any binary channel in use I have ever seen (my PhD is in error correcting codes).

So if noise in the channel could turn a 0 to a 1, or a 1 to a 0, then there is never a positive zero-error rate.

This is explained in the paper, page 9, second column.

So this is an interesting math question for channels that don't occur in practice, and has resulted (as far as I can tell) in no working codes usable even in labs. It certainly does not apply to transmitting binary data over any noisy channels or media, which is where most if not all error correction codes are actually used.

Re:How to rip audio CDs 2022 – with drive accuracy listing by orev on Sunday November 06, 2022 @11:42PM (#33501244)
If they had foresight, they wouldn’t have made CDs at all. They do not want people ripping them and getting “perfect” copies.
Re:How to rip audio CDs 2022 – with drive accuracy listing by fuckstick on Monday November 07, 2022 @02:12AM (#33502198)
> That just goes to show the lack of design foresight.

You have a skewed perspective of growing up with ubiquitous computing and cheap ICs. This was very much not the case in the early 70s when CDs were designed. Trying to simultaneously design for high fidelity audio and a then completely theoretical demand for data storage would have made no sense and would be unjustifiable scope creep. The spiral groove of a CD is objectively better for a low cost linear playback device - even though it is obviously worse for random data access (though modern DSP mitigated this 15 years later). Engineering is about trade offs.

There’s no binary best effort vs dead sure - it’s a matter of degree, unlike the mistaken GP post, CDDA and CDROM both use RS error detection and correction, just the former has less of it - a CDDA (Redbook) can store about 15% more audio than would be possible with the equivalent WAVE files on a CDROM - at the expense of some redundancy, but it still has very robust error correction - otherwise every little tiny piece of dust would cause a skip. And for audio playback - trying to fill in a best guess is the right thing to do - rather than just making the thing spit the disk out with a failure.

Re:How to rip audio CDs 2022 – with drive accuracy listing by kevin_thibedeau on Sunday November 06, 2022 @09:16PM (#33500262)
Audio CDs also have significantly weaker error correction than CD-ROM.
Re:How to rip audio CDs 2022 – with drive accuracy listing by fuckstick on Monday November 07, 2022 @12:40AM (#33501630)
> Additionally, there is no way to know that you've passed that threshold

This is not quite right. CDs use a forward error correcting code, and of course that means you can detect errors (how can one correct errors if they can’t detect them?). The CD drive most definitely can distinguish between an error free signal and a marginal one - both at the analog level and the digital level. Most CD drives firmware are a bit inconsistent in their ability to correctly provide error correction information but this is not a fundamental issue with the technology and far from “no way to know” - relying on the drives error detection facilities is what the C2 error detection option in EAC does for instance.

https://wiki.hydrogenaud.io/index.php?title=EAC_Drive_Option...