| | #1 |
| CD Freaks Expert Join Date: Oct 2004 Location: Delft, The Netherlands
Posts: 58
| Offsets handling (syncing of audio data vs. Q channel) Hi all, I have been reading up on low-level Compact Disc technique and - being somewhat of a hacker - I have hooked up some electronics that capture the analog response signal from an audio CD player's laser unit into a desktop PC (sampled at 50 MHz), in order to understand the fundamentals of the channel encoding - and also to pass final judgement on the quality of digital audio extractor s/w. Using my neat hardware setup I now have captured a precious 0.1 seconds worth of 588-bit channel data frames from a pristine audio CD, each frame containing, among other things, a subchannel byte and 24 bytes of audio data. As specified in the Red Book standard, the audio data of 6 samples (6x2x16 bits of data) is really spread out over 108 channel consecutive data frames. I can reproduce the CIRC, get the de-interleaved audio data, and also do the Reed-Solomon C1/C2 stuff in software from my analog laser readouts - showing an error-free read, identical to what I get with my Plextor using somewhat more conventional methods. So far, so good. However, one has to realize that the 108-frame interleave structure of the audio data is quite independent/different from the 98-frame sequence that comprises a 2352-byte sector, which is what one usually thinks of as the smallest addressable amount of audio data (corresponding to 1/75 seconds). The 98-frame sectors structure, in effect, is determined by the Q sub-channel - the subchannel starting with two "special" values of 14 channel bits (SYNC0 and SYNC1), followed by (for the Q channel) 96 bits of info describing the current audio sector (most of the time this gives track/index nr., time since start-of-track, time since start-of-CD, etc.) - as many of you here will know. Now to my question. The Q-channel and the audio data channels are interleaved. What I need to know is where to find, in the audio data channel, the first sample of audio data that corresponds to the start of a 2352-byte (98 frame) sector as defined by the Q sub-channel. This one number is, in effect, the last degree of freedom left in my low-level extraction procedure. I would expect the standard (Red Book) to spell out the correspondence of audio and subchannel data. Over the last months, I have read quite a couple of books on CD technology, and I have also scrutinized the ECMA-130 standard (not the Red Book unfortunately, it's a bit too expensive). None of these seems to provide an answer to this question of the exact synchronisation between the audio data channel and the subcode Q channel. In fact, I suspect that this may precisely be the reason why many CD players employ a different "offset" value - the standard may simply be inconclusive on this (yikes). I hope any of the more technically inclined folks around here may be able to shine some light on this issue. It's quite frustrating to be so close to being able to make the perfect extraction procedure, but to leave this little issue dangling. Best regards, Sidney ( sidney at jigsaw dot nl) [[PS. if any of you is a regular at the EAC forum: I posted a similar question over there a couple of days ago - I didn't get a satisfactory response up to now. I hope to be more lucky here]] |
| | |
| | |
| Register to remove me Join Date: Today Location: Myce HQ
Posts: Zillions
| |
| | #2 |
| CD Freaks Expert Join Date: May 2002
Posts: 143
| Re: Offsets handling (syncing of audio data vs. Q channel) hmm... according to mmc5 4.3.2.1 exact frame boundaries do not exist due to the physical interleaving. that'd be a good reason for the sync field used in data sectors hope i didnt get that wrong :s aah, stop slapping me spath! btw welcome aboard! |
| | |
| | #3 | ||
| CD Freaks Expert Join Date: Oct 2004 Location: Delft, The Netherlands
Posts: 58
| Re: Offsets handling (syncing of audio data vs. Q channel) Quote:
I think the "do not exist" statement is a bit weird, although I could (learn to) live with "have not been properly defined." It would, after all, be completely possible to define the correspondence between subchannel and audio-channel in an unambiguous way, by saying something like this: "a 1/75 sec 'audio sector' consists of 98 frames, the start of which is defined by the 588-bit channel frame that has a 14-bit SYNC0 identifier for its subchannel. The MSB of the 16-bit left-channel sample value of the audio sample corresponding to the first 1/44100 second of the audio data stream represented by this audio sector, is to be found N frames prior to the SYNC0 frame corresponding to this audio sector." That's a lot of words (there would probably be a much easier way to define it), but it /is/ unambiguous. I would suspect N=108 would be a reasonable (implicit) choice, but I would certainly be happy to find conformation in the Red Book or IEC60908. Does anyone here have either of these standards, and care to look it up? On a related note: I went looking for the Red Book on the Philips "licensing" site only to find one must sign an NDA when ordering the RB standard. Being a sucker for open standards, I'll be damned if I will ever do that ...Quote:
| ||
| | |
| | |
| Always the best offers Join Date: Today Location: Myce HQ
Posts: Zillions
| |
| | #4 |
| CD Freaks Expert Join Date: May 2002
Posts: 143
| Re: Offsets handling (syncing of audio data vs. Q channel) |
| | |
| | #5 |
| CD Freaks Expert Join Date: May 2002
Posts: 143
| Re: Offsets handling (syncing of audio data vs. Q channel) hmm, a lot of people here (especially me ) would love to hear some details on your neat capturing setup. if you read my thread about gc discs... capturing a frame of these discs would answer all my questions at once and a software dvd frame decoder (which i'm willing to code) would make a nice addition to our homemade tools sticky. |
| | |
| | #6 |
| Optical storage technical expert Join Date: Jan 2002
Posts: 994
| Re: Offsets handling (syncing of audio data vs. Q channel) Hi Sidney, > Using my neat hardware setup I now have captured a precious 0.1 seconds worth > of 588-bit channel data frames from a pristine audio CD, each frame containing, Hmm, from the analog signal to the frames you still need some signal processing, an analog to digital conversion, a slicer and run-length recognition. How do you do that ? > The Q-channel and the audio data channels are interleaved. What I need to > know is where to find, in the audio data channel, the first sample of audio > data that corresponds to the start of a 2352-byte (98 frame) sector as defined > by the Q sub-channel. I'm not sure I understand you question here. In a track audio data start when the start bit of the P channel goes to 0 and the MIN/SEC/FRM in channel Q are all 0 (before this is the 2s pause). So the first valid audio sample is the one just after a SYNC0 subcode in a 588 bits frame which satisfies these 2 conditions. Did I miss something ? |
| | |
| | #7 | |||
| CD Freaks Expert Join Date: Oct 2004 Location: Delft, The Netherlands
Posts: 58
| Re: Offsets handling (syncing of audio data vs. Q channel) Quote:
This point is probed and fed into a high-speed AD converter (12 bit res, 50 Msamples/sec) that is hooked to an FPGA. I implemented a flank detector and a run-length encoder in VHDL. Using this setup, I can capture about 10000 pits/lands in one go. This is about 1/1000 of a second worth of data. What I did was performing 40 of such captures, all hand-triggered to a particular drum beat moment in a song on a pristine CD. After getting these, I translated the flank/run-lengths into 1's and 0's; after this I wrote a small program to match the 40 slices I got in this way (basically, this is the dna sequencing problem, for just 2 bases). This got me a sequence of 1/0's corresponding to cleaned-up pits and lands. From this point on, I implemented the CIRC decoder circuitry with all delays, interleaving, and Reed-Solomon decoding, which enables me to reproduce audio samples, error checking syndromes, and the subchannel stuff. Back in college I had a few courses in coding theory and algebra, which allows me to understand that kind of stuff (I'm a software engineer by training, with a knack for hardware and maths - this helps!). That is basically it. I am planning on writing some web pages on the details of this when I'm done; for now, look at: http://ch.twi.tudelft.nl/~sidney/fpga/sanyo.jpg for the rigged CD player (the green wire connects to the EFM header) and http://ch.twi.tudelft.nl/~sidney/fpga/fpga.jpg which shows the FPGA development board and the fast AD/DA daughterboard sitting on top. Quote:
Quote:
However, due to the extensive use of delay lines between the C1 and C2 encoder, 6 consecutive samples of audio data do not end up in a single frame; they are "spread out" over 106 consecutive frames as follows: L0 = data[i-108][ 0]*256 + data[i-105][ 1] L2 = data[i-100][ 2]*256 + data[i- 97][ 3] L4 = data[i- 92][ 4]*256 + data[i- 89][ 5] R0 = data[i- 84][ 6]*256 + data[i- 81][ 7] R2 = data[i- 76][ 8]*256 + data[i- 73][ 9] R4 = data[i- 68][10]*256 + data[i- 65][11] L1 = data[i- 46][16]*256 + data[i- 43][17] L3 = data[i- 38][18]*256 + data[i- 35][19] L5 = data[i- 30][20]*256 + data[i- 27][21] R1 = data[i- 22][22]*256 + data[i- 19][23] R3 = data[i- 14][24]*256 + data[i- 11][25] R5 = data[i- 6][26]*256 + data[i- 3][27] Here, L0...L5 and R0....R5 are consecutive 16-bit audio samples (not yet subjected to 2-complementing to make them signed). data[i][j] are audio data bytes, with i denoting consecutive frames, and 0<=j<=31 denoting any of the audio+reed/solomon data bytes in a frame. data[i][12 to 15] are the inverted Reed-Solomon 'Q' values (C2), data[i][28 to 31] are the inverted Reed-Solomon 'P' values (C1). I am very sure that the calculations shown above are correct, i.e., this perfectly represents the delay-and-interleave algorithm of the CIRC decoder, for the audio data (frame sync pattern detection, EFM demodulation, and this would be all you need to play-back - assuming an error-free CD). The reason I am sure about this is that this perfectly reconstructs the audio of the 0.1 second sample I got. As you see from the above reconstruction algorithm, the consecutive audio bytes come from channel frames that are spread over a total 106 frames. This suggests the question I'm posing, which is this. We can clearly identify channel frames that start at a particular point by looking at the subchannel data; the subchannel provides the notion of "sectors", which are 98 consecutive frames starting with SYNC0/SYNC1 markers, and the Q subchannel provides an absolute time reference. But how, exactly, do we know which audio data correspond to the first channel frame of a sector? There should be 6 consecutive audio frames that correspond, time-wise, to the first frame of a given sector, but since the audio data is spread out over 106 frames, it is not entirely clear how this choice is made. This is the degree-of-freedom that I would like to resolve. This is quite a difficult thing to explain, but I hope this helps. If it's still not clear I will have to draw some pictures I suppose :^) Best regards, Sidney | |||
| | |
| | #8 | |
| CD Freaks Expert Join Date: Oct 2004 Location: Delft, The Netherlands
Posts: 58
| Re: Offsets handling (syncing of audio data vs. Q channel) Quote:
Regards, Sidney | |
| | |
| | #9 | |
| CD Freaks Expert Join Date: Oct 2004 Location: Delft, The Netherlands
Posts: 58
| Re: Offsets handling (syncing of audio data vs. Q channel) Quote:
The setup I am using (FPGA, fast AD - see my earlier post) costs about $500 plus many hours of tweaking. I suppose if I had to do it again I would pick some different hardware which would probably bring the cost down to about $200 - ex. an expendable player (I've blown one in the course of all this, so far). Now my setup isn't currently good for doing streaming captures of, for example, an entire CD (or even DVD). However, I am looking into adding a USB2 port to my setup which should allow 480Mbits/sec streaming captures - which would be ideal to shift as much of the signal analysis as possible to the desktop computer, where things are inherently /a lot/ easier. One problem I see for DVD's is that the players are simply "too smart" - i.e., they will do much seeking and re-seeking which prevents one from making the kind of clean start-to-end capture one would ideally want. Old audio CD players are so amazingly stupid, they will happily "play" CD-ROM discs if you feed it with one. This is truly ideal for analysis purposes. I guess if you wanted to do start-to-end captures on a DVD, you would need to lobotomize it a bit, i.e. force it to do a raw start-to-end read at 1x speed. But then, perhaps you can direct it to do this using proper SCSI commands (I never did low-level DVD or CD programming - I completely skipped that level ;-)) Regards, Sidney | |
| | |
| | #10 |
| Optical storage technical expert Join Date: Jan 2002
Posts: 994
| Re: Offsets handling (syncing of audio data vs. Q channel) > That is basically it. I am planning on writing some web pages > on the details of this when I'm done This is really amazing, I would have never thought somebody would build his own decoder (especially not a software guy ). Don't forget to tell us when your pages are ready, we will surely add a news item on front page for this. > From what I am seeing, this is not completely accurate. When looking > at combined audio/subchannel rips I make with my Plextor using linux/readcd, > the P channel is still '1' in the first 1/75 sec of a track. This is normal, the red book specifies that P channel encoding is one subcode block delayed versus Q channel. You always have to take this delay into account when dealing with channels P and Q. > But how, exactly, do we know which audio data correspond to the first > channel frame of a sector? Now I understand what you mean. The red book does not define any such correspondance between audio samples and subcode blocks, so it's a matter of interpretation from manufacturers. |
| | |
| | #11 |
| CD Freaks Expert Join Date: May 2002
Posts: 143
| Re: Offsets handling (syncing of audio data vs. Q channel) capturing a complete dvd would be awesome but that's not what i itend to do. a few ecc frames would be enough. once i figure out whats so special about these discs i guess i can achieve the writing part by modifying a writers firmware. i dont know the dvd channel bandwith. maybe i should consult a calculator ![]() hmm since usb2 does 480mbit, maybe there are ready-made ad convertors ? if thats still not fast enough i could be possible to temporarly slow down the motor in order to capture a few frames. on the other hand thats something the drive might be to 'intelligent' for.... |
| | |
| | #12 | |||
| CD Freaks Expert Join Date: Oct 2004 Location: Delft, The Netherlands
Posts: 58
| Re: Offsets handling (syncing of audio data vs. Q channel) Quote:
Using this setup it should be possible to make rips that are comparable in quality to rips using a high-end player, but with a very reliable detection of "questionable" sections - at least better than what any drive that I am aware of could do. Furthermore, I think it will be possible to improve on the syndrome-based C1/C2 error detection correction algorithm, in effect trading accuracy for processing power. The reason I started all this is that I was very much annoyed by the fact that it seemed nigh-impossible to do reproducible rips of CD's using different CD players. Also, linux/cdparanoia would happily rip a CD with no problems found, then half a year later using the same player and the same CD, it would still be perfectly happy with a rip - but it /would/ yield a non-identical file to the first rip; with some inspection showing instances of sample interpolation that were not detected by the cdparanoia software. For a digital medium, such things are UNACCEPTABLE (excuse me for raising my voice!) This really pissed me off bigtime, and looking around on the web I didn't find a great deal of very deep analysis of what silliness was preventing good reproducible ripping abilities - at that point I decided to bite the bullet and do the analysis myself. The bottom line: never underestimate a software guy with an axe to grind ;-) Quote:
Quote:
Regards, Sidney | |||
| | |
| | #13 |
| CD Freaks Expert Join Date: May 2002
Posts: 143
| Re: Offsets handling (syncing of audio data vs. Q channel) dvd channel bitrate is 26.16 MHz http://www.opticaldisc-systems.com/2...VDBASICS78.htm |
| | |
| | #14 | |
| CD Freaks Expert Join Date: Oct 2004 Location: Delft, The Netherlands
Posts: 58
| Re: Offsets handling (syncing of audio data vs. Q channel) Quote:
As to the bandwidth requirement, with a channel rate of 26 MHz I guess we could settle for something like an 80 Msamples/sec AD converter - however I would prefer to overspecify this by quite a margin. An AD9480 (250 Msamples/sec at 8 bits) looks tempting. Fun thing is that when you're done reverse-engineering CDs and DVDs you could always turn it into an FM radio that can listen to all stations at once - which would be a worthy exercise, I'd say ;-) Also, this may be enough to repeat the same exercise for Blu-Ray later on (anyone know the channel BR for this?). Regards, Sidney | |
| | |
| | #15 | |
| Optical storage technical expert Join Date: Apr 2001 Location: London, UK
Posts: 679
| Re: Offsets handling (syncing of audio data vs. Q channel) Quote:
Concerning the EFM header, I think the modern drives still have a similar set of points marked on the board, e.g. the 24x LiteOn and 32x BenQ writers, which I had opened a while a go have them marked, they even had the 4 optical quandrant sensors marked. If I have time I'll take out my digital camera and post a link of the pictures here. | |
| | |
| | #16 | ||
| CD Freaks Expert Join Date: Oct 2004 Location: Delft, The Netherlands
Posts: 58
| Re: Offsets handling (syncing of audio data vs. Q channel) Quote:
Quote:
Cheers, Sidney | ||
| | |
| | #17 |
| Optical storage technical expert Join Date: Jan 2002
Posts: 994
| Re: Offsets handling (syncing of audio data vs. Q channel) > Using this setup it should be possible to make rips that are comparable in quality to > rips using a high-end player, but with a very reliable detection of "questionable" > sections - at least better than what any drive that I am aware of could do. Your setup obviously gives better observability and reporting than chipsets, but don't expect to get better extraction quality. Actual chipsets contain lots more logic than that to handle bad discs. > Furthermore, I think it will be possible to improve on the syndrome-based C1/C2 > error detection correction algorithm, in effect trading accuracy for processing power. Two standard improvements are : 1) use multiple consecutive C1/C2 corrections on the same data. 2) use erasure strategy at C1 stage. > Also, this may be enough to repeat the same exercise for Blu-Ray later on (anyone know the > channel BR for this?). 66 Mb/s By the way, DVD-ROM standard is at http://www.ecma-international.org/pu...s/Ecma-267.htm |
| | |
| | #18 | ||||
| CD Freaks Expert Join Date: Oct 2004 Location: Delft, The Netherlands
Posts: 58
| Re: Offsets handling (syncing of audio data vs. Q channel) Quote:
Whether I can get better extraction quality I don't know yet, but I think it isn't completely impossible (see below). Quote:
Quote:
This is a much more advanced approach than one that could be implemented in hardware, if only because it will not be able to meet the real-time constraints that a CD player has to ensure smooth play-back. When you drop this constraint you open up the possibility of CPU intensive offline post-processing, which (I think) has the potential to indeed improve on the rather crude but fast C1/C2 Reed-Solomon codes. So we may disagree on this, and the ball is now in my court to show that I am right .... ![]() Quote:
| ||||
| | |
| | #19 |
| Optical storage technical expert Join Date: Jan 2002
Posts: 994
| Re: Offsets handling (syncing of audio data vs. Q channel) > Observability is by far the most important thing for me - one must accept that some > errors are not recoverable, but I want to be able to know exactly which samples are > "questionable" - which is feedback that even high-quality players aren't able to > reliable provide. Keep in mind though that what your setup will report is not what is on the disc and not necessarily what other drives will see either. > What kind of logic are you thinking about (and how could it impact the extraction > quality)? Of course there is also the signal tracking, but I am certainly not planning > on interfering with that, I will happily piggy-back on the player's built-in hardware > for that. For instance, the channel data rate is continuously slightly changing, even in CLV mode. This is why drives use a PLL to track such changes and make sure that their runlength decoding is always correct. Or reflectivity and defects can change the amplitude and offset of your analog signal, which is usually tackled by additional signal processing. > I am not quite sure what you mean by the first one. This is a nice property of the CIRC that you can "refine" your data several times. Consider for instance a C1 frame with 4 errors ; it will be flagged as an erasure and no correction will occur at C1 stage. Now if at C2 stage only 2 of these errors can be corrected (because there are too many errors in 2 of the 4 C2 frames), this leaves 2 wrong bytes in our original C1 frame. If you just run again CIRC on these data, the original C1 frame will be correctable since it now contains only 2 errors, and in turn this can make some C2 frames correctable. > The algorithm I am thinking about will effectively use a probabilistic error model > of the channel (describing burst errors, random errors, and perhaps also an audio > content predictor), then find the "maximum likelihood" solution for the channel > content based on the channel observation. Hmm, this sounds a bit like the Viterbi decoder that Pioneer is using in their DVD players. Can you elaborate a bit on these algorithms and maybe post some links ? |
| | |
| | #20 | |||||
| CD Freaks Expert Join Date: Oct 2004 Location: Delft, The Netherlands
Posts: 58
| Re: Offsets handling (syncing of audio data vs. Q channel) Quote:
I think that many CD players will have a header where a cleaned up 'EFM' signal is available, so it's a pretty good compromise. I like the fact that the analog chain takes care of the filtering up to that point (some things are better done using analog components even in this day and age). Very little information that is useful to reconstruct the channel is lost in the process - the information 'shedded' is mostly irrelevant or positively unhelpful - which is why it is filtered out of course. Quote:
Quote:
Quote:
What I am thinking about certainly has parallels to this, but I like to think of it as a more general framework. Quote:
Below are some links to scientific literature. Some of this material takes a bit of math experience to digest (though nothing excessive, a smart undergrad should be able to follow this). Some articles introducing the problem domain (these are old but rather accessible): ftp://publications.ai.mit.edu/ai-pub...df/AIM-394.pdf ftp://publications.ai.mit.edu/ai-pub...df/AIM-380.pdf The "model based approach" was introduced by De Kleer and Williams ("Diagnosing Multiple Faults", 1992 - unfortunately this is copyrighted so i cannot post it here). Some other articles that cover this: ftp://publications.ai.mit.edu/ai-pub...df/AIM-739.pdf ftp://publications.ai.mit.edu/ai-pub...f/AIM-1059.pdf ... If you don't plan to spend the next weeks studying this ;-), allow me to give a simple example to show you a typical (but very simple) example of this approach. This does not apply to CD's, but it should convey the general idea. *** A five-minute intro to Model Based Health Management *** Suppose I have an "inverter" that inverts a digital boolean input if it is "healthy". Its behavior (with x input, y output, and h healthy - a boolean) can be described as: h => (x = !y) { in words: if the inverter is healthy, x and y are each unequal } Now suppose that I have 3 inverters; I hook them up in such a way that the output of the first one drives the input of both the second and the input of the third one (i.e., inverter #1 has a "fan-out" of 2). Now suppose I impose a boolean "true" on the input of inverter #1. At the output of inverters #2 and #3, I should also observe a "true". But now suppose I see that I in fact observe both a "false" at inverter #2 and #3's output. Considering the "health state" of the inverters, and combining their respective health equations, we get the following list of possible health modes of the system: inv.1 OK inv.2 OK inv.3 OK -- INCONSISTENT with observation inv.1 OK inv.2 OK inv.3 FAIL -- INCONSISTENT with observation inv.1 OK inv.2 FAIL inv.3 OK -- INCONSISTENT with observation inv.1 OK inv.2 FAIL inv.3 FAIL -- CONSISTENT with observation inv.1 FAIL inv.2 OK inv.3 OK -- CONSISTENT with observation inv.1 FAIL inv.2 OK inv.3 FAIL -- CONSISTENT with observation inv.1 FAIL inv.2 FAIL inv.3 OK -- CONSISTENT with observation inv.1 FAIL inv.2 FAIL inv.3 FAIL -- CONSISTENT with observation So we have that either of the following five conditions must be true: inv.1 OK inv.2 FAIL inv.3 FAIL -- CONSISTENT with observation inv.1 FAIL inv.2 OK inv.3 OK -- CONSISTENT with observation inv.1 FAIL inv.2 OK inv.3 FAIL -- CONSISTENT with observation inv.1 FAIL inv.2 FAIL inv.3 OK -- CONSISTENT with observation inv.1 FAIL inv.2 FAIL inv.3 FAIL -- CONSISTENT with observation Assuming that all inverters are equally likely to fail, and that their probability failure exceed 0.5, n-ary failures are much more likely than (n+1)-ary failures. In the above list, there is only one fault mode that has just 1 faulty inverter: inv.1 FAIL inv.2 OK inv.3 OK So this is probably the correct diagnosis of the observed system. Note that we can put all this in a probabilistic framework, quantifying the probabilities of health of different variables. This also has close links to information theory as well, e.g. we can quantify the amount of "bits of information" that could be gained by peeking at the output of inverter #1. This framework can also be applied to signal processing; here, a "diagnosis" could be that a certain sample in the channel domain is not to be trusted. The potential power of this way of looking at systems is really awesome, and although I may be suffering from the "if you have a hammer, everything looks like a nail" syndrome, I truly believe that the CD signal path could provide a textbook example of succesful application of these sort of techniques. I hope this clears it up a small bit. regards, Sidney | |||||
| | |
| | #21 |
| New on Forum Join Date: Nov 2004
Posts: 9
| Re: Offsets handling (syncing of audio data vs. Q channel) Hello, Back to the original question and since interleaving data is not taking place on the Control&Display symbol (a.k.a subchannel byte), you can reconstruct sectors by using the offsets mentioned on your post dated 24-10-04 (which by the way are very correct). If the interpretation problem was coming from the P been '1' on the 1st subcoding block of a track as mentioned on the same post, Spath gave the answer of P been one subcoding block delayed to Q (red book), so, if I am not missing something, case is closed. You have a very interesting project running. I do work the other side (sector, TOC, and subchannel analysis through ASPI retrieval of data). Do you have a good reference to Reed-Solomon so I can meet you halfway? ![]() data_ |
| | |
| | #22 | ||||
| CD Freaks Expert Join Date: Oct 2004 Location: Delft, The Netherlands
Posts: 58
| Re: Offsets handling (syncing of audio data vs. Q channel) Quote:
PLEXTOR RULE: the MSB of the first left-channel sample of the time-interval corresponding to a sector is contained in the first frame of that sector. This uniquely determines the Q-channel to audio mapping. I determined this by using a CD for which I know what the physical channel looks like. The Plextor rule seems sensible, but other CD brands use a different interpretation (in fact, I tried an older Plextor and it synchronizes differently); there seems to be no clear statement in either the Red Book or IEC908. Quote:
Quote:
Quote:
Regards, Sidney | ||||
| | |
| | #23 | ||
| New on Forum Join Date: Nov 2004
Posts: 9
| Re: Offsets handling (syncing of audio data vs. Q channel) Quote:
It is a little bit strange you get it without any delays!! Do you make any use of LI to your calculations?Quote:
As for the C1/C2, data is retreived on sector level, so there is no direct access to frames (and C1/C2 as a result). Theoretically though you have access to flags which mark error data through the use of C1/C2 but there is a total mess from one manufacturer to the other... | ||
| | |
| | #24 | ||||
| CD Freaks Expert Join Date: Oct 2004 Location: Delft, The Netherlands
Posts: 58
| Re: Offsets handling (syncing of audio data vs. Q channel) Quote:
This picture does indeed prescribe a three-frame delay for the left channel MSB of the first-of-six samples. However, this picture doesn't have anything to say on the relation between the audio channel and the sub-channel. If there would be a delay-less line drawn here marked "subchannel", the issue would be settled. But there isn't. The exact correspondence between audio and subchannel data isn't specified. Quote:
In the algorithm I quoted earlier, the numbers "-108", "-105", ... , "-3" all correspond to delays: L0(i) = data[i-108][ 0]*256 + data[i-105][ 1] L2(i) = data[i-100][ 2]*256 + data[i- 97][ 3] L4(i) = data[i- 92][ 4]*256 + data[i- 89][ 5] R0(i) = data[i- 84][ 6]*256 + data[i- 81][ 7] R2(i) = data[i- 76][ 8]*256 + data[i- 73][ 9] R4(i) = data[i- 68][10]*256 + data[i- 65][11] L1(i) = data[i- 46][16]*256 + data[i- 43][17] L3(i) = data[i- 38][18]*256 + data[i- 35][19] L5(i) = data[i- 30][20]*256 + data[i- 27][21] R1(i) = data[i- 22][22]*256 + data[i- 19][23] R3(i) = data[i- 14][24]*256 + data[i- 11][25] R5(i) = data[i- 6][26]*256 + data[i- 3][27] However, my problem is that any frame-wise translation in these delay offsets would reproduce the audio stream perfectly - except at start-of-audio-data and end-of-audio-data, due to another sync with the subchannel. For example, to describe the algorithm for my Plextors the above is more reasonably re-written as: L0(i) = data[i +0][ 0]*256 + data[i +3][ 1] L2(i) = data[i +8][ 2]*256 + data[i +11][ 3] L4(i) = data[i +16][ 4]*256 + data[i +19][ 5] R0(i) = data[i +24][ 6]*256 + data[i +27][ 7] R2(i) = data[i +32][ 8]*256 + data[i +35][ 9] R4(i) = data[i +40][10]*256 + data[i +43][11] L1(i) = data[i +62][16]*256 + data[i +65][17] L3(i) = data[i +70][18]*256 + data[i +73][19] L5(i) = data[i +78][20]*256 + data[i +81][21] R1(i) = data[i +86][22]*256 + data[i +89][23] R3(i) = data[i +94][24]*256 + data[i +97][25] R5(i) = data[i+102][26]*256 + data[i+105][27] Then, by "LI" I take it you mean "linear interpolation" (?) Then, the answer is no. I am not cutting corners here, that's the point of dropping down to the hardware level. Quote:
Quote:
Regards, Sidney | ||||
| | |
| | #25 | |||
| New on Forum Join Date: Nov 2004
Posts: 9
| Re: Offsets handling (syncing of audio data vs. Q channel) Quote:
Quote:
LI stands for LeadIn. The encoded pattern in the lead in area could give you a reference point so you can afterwards work based on your offset tables. Quote:
| |||
| | |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ConvertXtoDVD: Audio Syncing Problems | LazLong | Burning Software | 1 | 05-04-2007 01:30 |
| WHY am I now having problems with syncing audio and visual?? | Oz12 | Nero & InCD | 0 | 23-03-2007 21:04 |
| Audio syncing problems | Kgo | General Software | 1 | 28-12-2005 20:11 |
| VOB Audio syncing | MassDistortion | Video Edit Software | 5 | 12-12-2005 15:04 |
| sub-channel data | kryptonite | Newbie Forum | 1 | 21-11-2003 03:05 |