[paranoia] sample offset?
Matt McClure
mlm at aya.yale.edu
Sat Sep 9 22:51:08 PDT 2000
On Sat Sep 09 2000, 21:22, Matt McClure <mlm at aya.yale.edu> wrote:
> I've determined that my drive (SONY CD-RW CRX140E) consistently rips
> tracks offset by 566 samples, which makes it impossible to get a
> completely bit-accurate copy of a WAV after burning it to a CD. I
> understand that cdparanoia does not currently have the ability to use a
> sample offset -- although an offset can be specified in hour, minute,
> second, and sector increments. Are there any plans for future versions
> to allow sample offsets as well?
>
> How difficult would it be to implement this feature?
After I sent this, I decided to take a closer look at the source. With
this simple patch (see below), and setting CD_SAMPLE_OFFSET=566, I was
able to get 100% bit-accurate copies of some WAVs I burned.
However, it did not work for the last track. In the case of the final
track, the ripped wav had all 0's for the final 2264 bytes (or 566
samples). Could anyone more familiar with the source comment on how
easy this would be to fix?
diff -cr paranoia-III.orig/paranoia/cdda_paranoia.h paranoia-III/paranoia/cdda_paranoia.h
*** paranoia-III.orig/paranoia/cdda_paranoia.h Sun Sep 10 01:32:21 2000
--- paranoia-III/paranoia/cdda_paranoia.h Sat Sep 9 23:48:37 2000
***************
*** 9,14 ****
--- 9,18 ----
#define CD_FRAMEWORDS (CD_FRAMESIZE_RAW/2)
+ #ifdef MLM
+ #define CD_FRAMEWORD_OFFSET (atoi(getenv("CD_SAMPLE_OFFSET")) * 2)
+ #endif /* MLM */
+
#define PARANOIA_CB_READ 0
#define PARANOIA_CB_VERIFY 1
#define PARANOIA_CB_FIXUP_EDGE 2
diff -cr paranoia-III.orig/paranoia/paranoia.c paranoia-III/paranoia/paranoia.c
*** paranoia-III.orig/paranoia/paranoia.c Sun Sep 10 01:32:29 2000
--- paranoia-III/paranoia/paranoia.c Sat Sep 9 23:39:52 2000
***************
*** 1190,1197 ****
--- 1190,1202 ----
size16 *paranoia_read(cdrom_paranoia *p, void(*callback)(long,int)){
+ #ifdef MLM
+ long beginword=p->cursor*(CD_FRAMEWORDS)+CD_FRAMEWORD_OFFSET;
+ long endword=beginword+CD_FRAMEWORDS+CD_FRAMEWORD_OFFSET;
+ #else
long beginword=p->cursor*(CD_FRAMEWORDS);
long endword=beginword+CD_FRAMEWORDS;
+ #endif /* MLM */
long retry_count=0,lastend=-2;
root_block *root=&p->root;
--
Matt
http://www.faradic.net/~mmcclure/
--- >8 ----
List archives: http://www.xiph.org/archives/
Paranoia homepage: http://www.xiph.org/paranoia/
To unsubscribe from this list, send a message to 'paranoia-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Paranoia
mailing list