Repository navigation
[Experiment] Storing data in a DVD's picture area: an idea and an early test / 【实验】让 DVD 的图案区域同时存数据:一个想法和初步测试 #150
Replies: 6 comments 10 replies
|
说起来,目前的DVD的深浅色,我感觉可能是由于光栅常数的不同,深色是把可见光的一级衍射角度挪到了非常偏的角度上实现的,所以似乎应该只会和游程有关系。 |
|
以及,目的是存有意义的数据,还是只要能挂载就好?如果是能挂载,我有这样一个iso:
|
其实不是标靶中的块。是 #90 (comment) ISO里面的。如果是标靶的话,我这边测试直接最开始就读不出。不过这个无所谓,反正重要的是找到一个这样的块。
想到一块了,在 #90 我就突然想到如果是有多个扰码Q能呈现几乎一样的最终效果,那可以利用此做隐写术。不知道这样能整盘下来存多少数据。 |
|
更新:刻好的对比盘第一次读回。平时很少报错的 GH70N,每种纹理读 9 块:把 另外 能不能显出明暗要看扫描,下一步就做这个。 |
|
之前有在 #27 提过 |
|
这个想法第一次有了实盘结果:一张 RITEKF1 DVD-R 上,图案区约七成的地方既是画面也存着数据,一共 1.38 GB。在 GH70N 上整盘读回没有错误,数据全部一致。这只是一台光驱、一张盘。细节在 #170。 Update: this idea now has a first result on a real disc. On one RITEKF1 DVD-R, about 70% of the picture area is both picture and data, 1.38 GB in all. A whole-disc read on a GH70N had no errors, and all the data matched. It's one drive and one disc. Details are in #170. |



Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
中文版点这里
With DiscImageStudio, files and a picture currently occupy separate parts of a disc. The files go in an inner or outer ring, or in the picture's blank areas, as in #96.
We want to try storing data in the area that draws the picture, too. If several different bytes can produce the same brightness, then choosing among them could carry data. But picture discs often fail to read back at all (#90), so the first step is to make that area readable.
This is still an experiment, and I'll update this post as we get results.
How a picture gets onto a disc
DIS draws light and dark areas with different bytes. On our discs, areas filled with the byte
92look bright, and areas filled withA5look dark. Mixing the two makes grey.A disc records data as pits and lands along a spiral, and the length of a continuous pit or land is called a run. Each byte turns into roughly one pattern of runs, which also depends on the byte before it:
92gives long runs andA5gives short ones.The drive scrambles data before encoding it, so DIS undoes that step in advance. After the drive scrambles the data, its encoder sees exactly the
92orA5the picture needs.How the picture could also store data
A small patch of picture that looks evenly bright covers a lot of bytes. A 0.2 mm square is about 270 tracks of about 94 bytes each, so roughly 25,000 bytes on the disc, all currently used to produce one brightness. About 21,000 of those are ours to choose; the rest are parity and sync that the drive adds.
If other long-run bytes also look bright, we could choose among them, and that choice would represent data. Dark areas would choose among short-run bytes in the same way. To get the data back, you'd read the disc normally and turn each byte back into bits with a small decoder. An ordinary file put straight on the disc wouldn't do this: whatever the file contains, the drive's scrambling turns it into something close to random, so it shows up grey.
Whether this works depends on one thing we haven't measured: whether a mix of long-run bytes really looks bright and a mix of short-run bytes really looks dark. Contrast will drop, and colour may fade too.
Capacity depends on the same thing, and we don't have a real number yet. As one cautious estimate, if only stretches of plain
92andA5look right, and each stretch must be 32 bytes long, a mid-grey disc holds at most about 18 MB. This is a calculation, not a measurement.Details: the steps, and the numbers from our model
The steps would be:
dispersion-byte-pools.jsonalready has this kind of grouping.Numbers from our encoder model, for one block with full frames. DSV is explained in the next section. Whether brightness follows the mean run is still an assumption.
92A5One T is one channel bit, about 133 nm. Each byte becomes a 16-bit EFMPlus code word.
If single bytes from these sets work, at 5 and 4.2 bits per byte, the ideal limit on a 4.7 GB disc is about 2.5 to 2.9 GB. That assumes single-byte mixes show light and dark, which is untested, and it's before the data's own error correction, guard bytes and any layout overhead. The drive's parity isn't in this figure, since 4.7 GB is already what's left after it.
Why we started with reading, and what we tested
bczhc found a block from a DIS picture ISO that the drive can't read at blocks 2000, 4000 and 8000 (it reports an uncorrectable read error,
3/11/05), but that reads fine elsewhere. Scrambling depends on the sector's position, so the same data only turns back into92andA5at some positions, and those are the ones that fail. Our model shows the same split: a large imbalance between pits and lands at those positions, and a small one elsewhere. That imbalance is called DSV. The encoder normally keeps it near zero, and we suspect a large DSV upsets the read signal.Our best explanation is that
92has two possible code words. One is balanced. The other pushes DSV the same way on every byte. Normally the encoder steers DSV by choosing between alternative code words, but in the middle of a run of92it has no alternative to choose, so it can't switch back until the next sync code. Which form you get depends on the byte before the run. That part follows from the standard's code tables; that this is what makes the read fail is still our suspicion.So we changed the first
92of each run to9B, a byte that forces the balanced form. That's 168 bytes out of 32768. On one disc and one drive, bczhc then got this:9B92andA5The change didn't make reading slower through retries: block 4000 took 76.2 ms and block 3999, which has no such problem, took 76.9 ms.
Thanks to bczhc for the test. An AI review found a bug in our encoder and proposed
75and9B, and we recalculated its numbers with our own code. This doesn't show that DSV is the cause on other drives.Update: we then tested the cause directly. On a burned comparison disc and a GH70N, a drive that rarely reports errors, we read 9 blocks of each texture.
92Dis plain92with one extra byte at the start of each frame, which pushes it into the unbalanced form.92D92A5, 92/A5 mixes, long-run and short-run mixes, random dataThis is one disc and one drive, but it is the first time we changed only the form of
92and saw reading change. Peak DSV alone doesn't predict it:A5peaks at 325 in the model and reads fine, because that peak is only in its parity rows, while92Dpeaks at 373 and is offset in every frame. How long the offset lasts may matter more than how high it gets.Second update: whole-disc and scan results.
bczhc ran
bridge_iso.py(ef38742) on a whole picture ISO and burned it on the same Verbatim DVD+RW, read on the same ASUS BW-16D1H-U. The script changed 1.91% of the bytes.pvthen read all 4.38 GiB without an error. An earlier version of the script had only moved the first error from about 390 MiB to about 2.14 GiB. By eye, bczhc sees no real change in the picture.We burned one picture with and without the change on RITEKF1. On the GH70N, 301 sampled blocks of the changed disc all read and matched, with 4 slow reads of 2 to 9 s. We then scanned the two discs together 3 times:
Notes on this figure:
A closer look changes this a little. The numbers above only cover the centre of the dark region, and contrast depends strongly on the angle from that centre. Here it is split by angle, averaged over the 3 scans:
Most of the central bins are close. From -2° to 2° the original is higher, but that comes mainly from one high value (0.332 in scan 3), and values in that bin are uncertain by 0.02 to 0.07. From 10° to 14° out, on both sides, the bridged disc is lower in all 3 scans. That could be real, since changing the code word of
92can change where the light goes. But the signal there is faint, it rests on few patches, the 3 scans are of the same two discs, and the discs show different parts of the picture at those angles.So the result so far is no clear change near the centre of the dark region, and a possible small loss toward its edges. A fixed camera at other angles should help settle it.
Here is the same part of the picture on both discs:
In the Difference column, figures look dark on the left and light on the right. That mostly comes from position: at the left of each strip the original is near the centre of the dark region and the bridged disc near its edge, and at the right it's the reverse. So this figure shows the two pictures line up, but it can't be used on its own to measure a loss.
The comparison disc shows something for the data idea too. In the same dark region, the two random-byte mixes differ in brightness:
Notes on this figure:
SHORToverLONGis 0.75 to 0.86 in all 6 pairs, whileA5over92is 0.67 to 0.77. So on this measure, the gap between these two random mixes is about two thirds of the gap between the two solid bytes.Third update: how much bias does it take? A new test disc (
tools/duty_disc.py) held 92 with biased bursts. The bursts stayed the same, so peak DSV stayed at about 269, and only their spacing changed. On a GH70N with RITEKF1, each condition got 60 reads:"Share of time at high bias" is the share of 512T windows whose mean level is above 0.125 in the model (F512). Every block that did read matched the ISO.
So on this drive, trouble starts somewhere between about 2% and 5%. Plain
92(2.8%) failed 12 of 60, close to the 2.4% row, and plainA5(0.7%), whose peak is over 300, failed none. This fits the earlier result that peak DSV alone doesn't predict reading. It also explains why the guard byte helps: it brings this share close to 0.Burst length matters too. With the same number of biased bytes per block, 8-byte bursts failed 5 of 60, 16-byte 24, 32-byte 26 and 64-byte 59.
Some of this isn't explained. 8-byte bursts failed 5 times at a share of only 0.2%. 32-byte bursts failed in whole segments, with some segments all failing and others all reading, and the share doesn't predict which. And this is one disc and one drive: bczhc's ASUS fails on blocks at about 2.7% to 4%, while the GH70N still reads most blocks there. The limit depends on the drive, so these numbers aren't a rule for other drives. Every read is recorded here. An AI review proposed this metric and test, and we recalculated its numbers with our own code.
Details: the code words, and the DSV numbers
92has two EFMPlus code words:0000100000001000, runs of 8T and 8T, no offset, next state 3.0100000000010000, runs of 6T and 10T, an offset of 4 per byte, next state 2.Only bytes 00 to 57h have a second table of code words for steering DSV, and
92andA5don't. Bytes above that have two forms only in states 1 and 4, so once92is in state 2 the encoder has no alternative and can't correct the offset. Over about 79 bytes that adds up to about 316, the calculated size of one jump.75and9Blead to the first form from every state, which we checked by listing all the cases.Peak DSV in the model: about 310 for bczhc's block where it fails (307 to 311), about 24 where it reads, about 25 to 29 for random data depending on the seed, and 315 for all
92.The position matters because the scrambler has 16 starting values, so the block only turns back into
92andA5at matching positions.What we don't know yet
tools/bridge_iso.pydoesn't touch it, and it can still have a large DSV. On a test image some blocks stay at 100 to 175 in the model.Details: parity and the picture
The drive adds a header to each sector and PI and PO parity over each ECC block of 16 sectors. We can't choose those bytes directly. With uniform data, every column gives the same PO byte, so a PO row becomes one long repeat. All
A5peaks at 325 there, while its data rows stay at 17.For an ideal grating, going from 6T/10T to 8T/8T makes the first order about 17% stronger and removes the even orders. That can't tell us what a real disc will look like.
What's next
A5peaks high in those rows and still reads.How you can help
If you have a picture disc that won't read, run this on the same ISO, burn it on the same kind of disc, and post whether it reads and what it looks like. Failing LBAs help, and a photo next to the original helps most.
Related work: #59 got stable DVD-R DL burns with a low-DSV palette plus 10% random bytes, and the maintainer's note in #90 warns that mixing in other data doesn't always help. Philips US7990837B2 makes visible marks by steering the encoder, which an ordinary burn command can't do. #27 suggests a different route, with the picture and the data on separate layers of a dual-layer disc. We haven't tested dual-layer discs.
@bczhc I've quoted your results here, so please correct anything I got wrong.
中文版
目前,用 DiscImageStudio 在一张盘上同时放文件和图案,还是要把两者分开放:文件放在内圈、外圈,或者像 #96 那样,放在图案的空白处。
我们想试试:用来画图的那片区域,能不能也存数据?如果几种不同的字节能产生同样的明暗,在它们之间选择就能表示数据。不过图案盘经常连读取都有问题(#90),所以第一步是让这片区域读得出来。
这还是个实验,有新结果我会继续更新这篇帖子。
图是怎么刻上去的
DIS 用不同的字节来画出明暗。在我们的盘上,重复写入字节
92的区域看起来亮,重复写入A5的区域看起来暗,灰色由两者混合而成。光盘沿一条螺旋线,用坑和岸记录数据,连续一段坑或岸的长度叫作“游程”。每个字节大致对应一组游程,具体还取决于前一个字节:
92的游程长,A5的游程短。光驱在编码前会先对数据做“扰码”,所以 DIS 事先抵消这一步,让光驱扰码后,编码器看到的正好是画图需要的
92或A5。图案怎么同时存数据
图案中一小块看起来明暗一致的区域,其实覆盖了很多字节。一块 0.2 mm 见方的区域约有 270 条轨道,每条约 94 个字节,盘上加起来约 25000 个字节,现在它们都用来表现同一个亮度。其中约 21000 个是我们能选的,其余是光驱加的校验和同步码。
如果其他长游程字节也能显得亮,我们就可以在它们之间选择,用这个选择来表示数据。暗的区域同样在短游程字节之间选择。取数据时,正常读盘,再用一个小解码器把字节变回数据。普通文件直接放进去做不到这一点:不管文件内容是什么,光驱扰码后都接近随机,刻出来就是灰的。
这能不能行,取决于一件我们还没测的事:长游程字节的混合是不是真的显得亮,短游程字节的混合是不是真的显得暗。对比度一定会下降,颜色也可能变淡。
容量也取决于这一点,现在还没有可靠的数字。保守估算:如果只有连续的
92、A5才看得对,而且每段要连续 32 个字节,中灰的盘最多约 18 MB。这是计算,不是测量。细节:具体步骤和模型里的数字
步骤是:
dispersion-byte-pools.json已经有类似的分组。下面是编码器模型里的数字,按完整录制帧算一个块。DSV 在下一节解释。“明暗跟着平均游程走”目前还只是假设。
92A51T 是一个通道位,约 133 nm。每个字节会变成一个 16 位的 EFMPlus 码字。
如果这两组字节单个混用也行,按每字节 5 和 4.2 bit 算,4.7 GB 的盘理想上限约 2.5 到 2.9 GB。前提是单字节混合还能显出明暗,这没测过;也还没扣数据自己的纠错、守护字节和布局开销。光驱的校验不用再扣,4.7 GB 已经是扣掉它之后的容量。
为什么先研究读取,以及测到了什么
bczhc 发现 DIS 的一个图案 ISO 里有一个块,写到块 2000、4000、8000 光驱读不出(报告无法纠正的读取错误
3/11/05),写到别处能读。扰码和扇区位置有关,同样的数据只有写到特定位置才会还原成92和A5,读不出的正是这些位置。我们的模型里也有同样的差别:这几个位置的坑和岸严重不平衡,别处很小。这种不平衡叫 DSV。编码器平时会让它接近 0,我们怀疑它太大会干扰读取信号。我们目前最好的解释是,
92有两种码字。一种是平衡的。另一种每个字节都把 DSV 往同一边推。编码器平时靠在备选码字之间选择来控制 DSV,但一长串92中间没有备选可挑,所以到下一个同步码之前都换不回来。走哪一种,取决于这段92前面的字节。这部分能从标准的码表推出来;读不出是不是因为它,还只是我们的怀疑。所以我们把每段
92的第一个字节改成9B,它能让后面的92走平衡的那种。32768 个字节里改了 168 个。同一张盘、同一台光驱,bczhc 的结果是:9B92和A5改动后也没有因为反复重试而变慢:块 4000 读取 76.2 ms,本来就没问题的块 3999 是 76.9 ms。
感谢 bczhc 做了这次测试。AI 在核对时找出了我们编码器的一个 bug,并提出了
75、9B,相关数字我们已用自己的代码重新计算。这不能说明在别的光驱上也是 DSV 造成的。更新:我们随后直接测了原因。在一张刻好的对比盘上,用平时很少报错的 GH70N,每种纹理读 9 块。
92D就是普通的92,只在每帧开头多一个字节,把它推进不平衡的那种码字。92D92A5、92/A5混合、长短游程混合、随机数据这只是一张盘、一台光驱,但这是第一次只改变
92的码字形式,读取就跟着变。DSV 峰值单独预测不了:A5模型峰值 325,却读得很好,因为峰值只在校验行;92D峰值 373,而且每一帧都偏。偏多久可能比偏多高更重要。第二次更新:整盘读取和扫描结果。
bczhc 用
bridge_iso.py(ef38742)处理了一个完整的图案 ISO,还是刻到同款 Verbatim DVD+RW,用同一台 ASUS BW-16D1H-U 读。脚本改了 1.91% 的字节。之后pv读完了全部 4.38 GiB,没有报错。旧版脚本只是把第一个错误从约 390 MiB 推到约 2.14 GiB。bczhc 目视,图案看不出什么变化。我们用 RITEKF1 把同一张图加和不加改动各刻了一张。在 GH70N 上,改过的盘抽查 301 块,全部读出且内容一致,其中 4 块偏慢(2 到 9 秒)。然后把两张盘放在一起扫了 3 次:
这张图的说明(图上的文字是英文,Original 是原版,Bridged 是桥接版):
再细看一步,结论要稍微改一下。上面的数字只统计了暗区中央,而对比度和离中心的角度关系很大。按角度分开后(3 次扫描平均)是这样:
中间的几段大多很接近。-2° 到 2° 这段原版更高,但主要来自一个偏高的值(第 3 次的 0.332),这一段每个值的误差有 0.02 到 0.07。离中心 10° 到 14° 的两段,桥接版在 3 次扫描里都更低。这可能是真的,因为改变
92的码字可能改变光的去向。不过这里信号很弱,小块也少,3 次扫描又是同样两张盘,而且两张盘在这些角度露出的是图案的不同部分。所以目前的结果是:暗区中央没有明显变化,往边缘可能有一点损失。用相机固定机位拍其他角度,应该有助于定下来。
下面是两张盘上同一块图案的对照:
Difference 列(桥接版减原版)里,人形左边偏暗、右边偏亮,这主要来自位置:每条的左边原版靠近暗区中心、桥接版靠近边缘,右边正好相反。所以这张图能说明两张盘的图案对得上,但不能单独用来衡量损失。
对比盘对存数据的想法也有一点启发。在同一个暗区里,两种随机字节混合的亮度不一样:
这张图的说明(图上的文字是英文):
SHORT比LONG在全部 6 对里都是 0.75 到 0.86,A5比92是 0.67 到 0.77。按这个指标,这两种随机混合的差距约为两种纯字节差距的三分之二。第三次更新:偏多少才读不出?我们做了一张新的测试盘(
tools/duty_disc.py),在92里放有偏置的突发。突发本身不变,所以 DSV 峰值都约 269,只改变突发之间的间隔。GH70N 加 RITEKF1,每种读 60 次:“高偏置占比”是模型里平均电平绝对值超过 0.125 的 512T 窗口所占的比例(F512)。能读出的块,内容都和 ISO 一致。图上的文字是英文。
所以在这台光驱上,问题大约从 2% 到 5% 之间开始。纯
92(2.8%)读不出 12 次,和 2.4% 那一行接近;纯A5(0.7%)峰值 300 多,一次都没失败。这和之前“DSV 峰值单独预测不了”的结果对得上,也解释了守护字节为什么有用:它把这个占比压到接近 0。突发长度也有影响。每块偏置字节数相同时,8 字节的突发读不出 5 次,16 字节 24 次,32 字节 26 次,64 字节 59 次。
有些地方还解释不了。8 字节的突发占比只有 0.2%,也失败了 5 次。32 字节的突发是成段失败的,有的段全失败,有的段全成功,占比预测不了是哪些。而且这只是一张盘、一台光驱:bczhc 的 ASUS 在约 2.7% 到 4% 的块上读不出,GH70N 在这里大多还能读。界限和光驱有关,这些数字不能套用到别的光驱。每次读取的记录在这里。这个指标和测试是 AI 审查提出的,数字我们已用自己的代码重新计算。
细节:码字和 DSV 的数字
92的两种 EFMPlus 码字:0000100000001000,游程 8T 和 8T,没有偏置,下一状态 3。0100000000010000,游程 6T 和 10T,每个字节偏 4,下一状态 2。只有 00 到 57h 的字节才有第二套码字用来控制 DSV,
92、A5不在其中。更大的字节只在状态 1、4 下有两种写法,所以92一旦到了状态 2,编码器就没有别的码字可选,也就无法纠正这段偏移。约 79 个字节累积约 316,这是算出来的一次跳变大小。75、9B在所有状态下都通向第一种,我们逐一枚举确认过。模型里的 DSV 峰值:bczhc 的块在失败位置约 310(307 到 311),能读的位置约 24;随机数据约 25 到 29,随种子变化;全
92是 315。位置有影响,是因为扰码初值只有 16 种,这个块只有在匹配的位置才会还原成
92和A5。还不知道的
tools/bridge_iso.py不处理校验,校验部分的 DSV 仍可能很大。测试镜像里有些块在模型中还剩 100 到 175。细节:校验和图案
光驱会给每个扇区加扇区头,并给每 16 个扇区(一个 ECC 块)加 PI、PO 校验,这些字节我们不能直接指定。数据均匀时,每列算出的 PO 字节都一样,PO 行就成了一长串重复。全
A5的峰值 325 就在这里,它的数据行只有 17。按理想光栅计算,从 6T/10T 变成 8T/8T,一级衍射增强约 17%,偶数级消失。不过这还不能告诉我们实际刻出来是什么样。
接下来
A5在这些行的峰值很高,也还能读。可以怎么帮忙
如果你有读不出的图案盘,可以用同一个 ISO 跑下面这条,刻到同款盘上,回帖说读不读得出、看起来怎样。出错的 LBA 有用,和原版放一起的照片最有用。
相关的工作:#59 用低 DSV 调色板加 10% 随机字节,让 DVD-R DL 刻录稳定了;维护者在 #90 提醒过,混入别的数据不一定都有改善。Philips US7990837B2 通过控制编码器做出可见标记,普通刻录命令做不到。#27 提了另一条路:在双层盘上把图案和数据分层存放。双层盘我们还没有测过。
@bczhc 这里引用了你的结果,有写错的地方麻烦指正。
All reactions