Reading RAW data from CD/DVD

Hi,

I wish to read data from a DVD drive at lowest possible level. Disabling all the error correction that the drive implements.

I came to know that Plextor drives support the feature of disabling all error corrections and giving raw data.

Does any one know how do i get the data from those drives?

Thanks,
Salvo

Too many questions within single e-mail :slight_smile: OK, actually there are two ways
doing what you want… Here is first, long way:

  1. You need to hand-craft IRP_MJ_SCSI IRPs and target them to device PDO
    (filling
    embedded CDB and data buffers of course). Take a look at SCSI class driver
    and it would be a nice starting point. I guess you want to do this from
    kernel mode, right
    (unless you’ve picked up the wrong list)? If you really need user mode -
    take a look at SPTI.c sample from DDK. I hope it’s still there :slight_smile:

  2. To turn off drive’s hardware error correction you need to play with
    device’s
    “read error recovery page” (page code 0x01). Use MODE_SENSE10 to retrieve
    current configuration, zero out page header and patch fields you wanna
    modify
    and submit page back to device with MODE_SELECT10. You should care about
    so-called “device recovery strategy” and “number of read retries”. Changing
    first parameter from default value of 0x00 (“complete error recovery”) to
    0x01 (“easy error recovery”) would effectively disable drive’s hardware
    error correction. Decreasing number of read retries from default value (it
    very from one drive to other, most of the burners have it set to 0x0A AFAIK)
    to 0x00 also speeds up the things a lot :slight_smile: However life is not easy so some
    drives don’t tolerate altering “recovery strategy” from 0x00 -> 0x01, some
    drives just don’t care… You need to run a lot of experiments and create
    vendors and models database. Also you have to keep in mind some of the
    vendors do hardware error recovery modifications via vendor mode pages
    (unpublished of course!) so you’d possibly end up with proprietary hardware
    and software, some SCSI bus analyzer and tons of beer 6-packs :slight_smile: In any case
    don’t forget to roll the things back when your app would close.
    As Windows standard storage stack would be a little bit confused with junky
    data
    drive would return instead of cooked sectors. Sometimes :slight_smile:

  3. Getting RAW stream from CDs is easy. Use READ_CD command (0xBE AFAIK,
    READ10 0x28 for DVDs as they don’t have READ_CD supported) including ALL of
    the fields (user data, ECC, EDC and headers). You’ll get 2448 byte/sectors
    with all of the required information. Required for what? I guess for your
    own software-only L2 Reed-Solomon decoder. As with drive hardware error
    recovery firmware went South it would be only you standing between scratchy
    and dusty CD/DVD media and multiple read errors :slight_smile: Unlike Step 2 there is
    nobody who’d help you (no SCSI bus analyzer would become in use and
    disassembling somebody else code would take next 10-15 years of your life).
    Unfortunately there’s no free source code available on sourceforge.net (or
    anywhere else) and smallest implementation takes
    around 250-300K of tables and math calculations… Good luck :slight_smile:

For DVD media it’s simpler as there’s no way to turn L2 decoder OFF and get
true un-ECC-ed data from the media. You only play with number of retries
done.

So prepare to spend next 6+ months or so writing own Reed-Solomon decoder,
checking it on the different CD patterns and building device’s database
changing your application working strategy (this affects both CD and DVD
readers).

It was a long way… How here’s very short and EXTREMELY FAST one:

  1. Buy me a new Porsche 911 Carrera Turbo (silver metallic please!) and I’ll
    be happy to supply you with a source code of the library doing everything of
    the above :slight_smile: I would be even kind enough to update and support it for next
    say 3 years (or how long Porsche have factory warranty on their cars?)…

…or at least buy StarBurn SDK binaries for $1,500. In this case I’ll get
new wool floor mats for my Evolution IX :slight_smile:

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Wednesday, August 09, 2006 1:27 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Reading RAW data from CD/DVD

Hi,

I wish to read data from a DVD drive at lowest possible level. Disabling all
the error correction that the drive implements.

I came to know that Plextor drives support the feature of disabling all
error corrections and giving raw data.

Does any one know how do i get the data from those drives?

Thanks,
Salvo


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@voliacable.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

> I came to know that Plextor drives support the feature of disabling all error

corrections and giving raw data.

Does any one know how do i get the data from those drives?

By sending proper SCSI commands via IOCTL_SCSI_PASS_THROUGH. The SCSI commands
are described in MMC-5 (or earlier) spec, downloadable from www.t10.org

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Thanks Maxim. does any one know which particular plextor drive supports the
feature of disabling various levels of error correction ?

Thanks

On 8/11/06, Maxim S. Shatskih wrote:
>
> > I came to know that Plextor drives support the feature of disabling all
> error
> >corrections and giving raw data.
> >
> > Does any one know how do i get the data from those drives?
>
> By sending proper SCSI commands via IOCTL_SCSI_PASS_THROUGH. The SCSI
> commands
> are described in MMC-5 (or earlier) spec, downloadable from www.t10.org
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Did you see my posting in this group about what REALLY you have to do?

Anton


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of salvo v
Sent: Saturday, August 12, 2006 12:00 AM
To: Windows File Systems Devs Interest List
Cc: xxxxx@storagecraft.com
Subject: Re: [ntfsd] Reading RAW data from CD/DVD

Thanks Maxim. does any one know which particular plextor drive supports the
feature of disabling various levels of error correction ?

Thanks

On 8/11/06, Maxim S. Shatskih wrote:

> I came to know that Plextor drives support the feature of disabling all
error
>corrections and giving raw data.
>
> Does any one know how do i get the data from those drives?

By sending proper SCSI commands via IOCTL_SCSI_PASS_THROUGH. The SCSI
commands
are described in MMC-5 (or earlier) spec, downloadable from www.t10.org

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@gmail.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

— Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17 You are currently subscribed to
ntfsd as: xxxxx@rocketdivision.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

SCSIOP_READ_CD with some mode page values set to 2325-byte sectors by MODE
SELECT command. The details are in MMC spec. Don’t think this work for DVDs -
IIRC their lowest level accessible by SCSI is 2048-byte sectors.

BTW - I saw the open-source CD writing code which IIRC could calculate the
CD checksums in software.

As you probably know, during CD writing, you can set the write mode (via
MODE SELECT), and, in some write modes, the burden of calculating the
checksums - and thus converting the 2048-byte sectors to 2352-byte sectors - is
on your app and not on the drive firmware. This open-source code (IIRC called
“cdrdao”) is capable of this. More so - Nero 6 uses this way in some of its
write modes (DAO IIRC).

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Anton Kolomyeytsev”
To: “Windows File Systems Devs Interest List”
Sent: Saturday, August 12, 2006 1:09 AM
Subject: RE: [ntfsd] Reading RAW data from CD/DVD

> Did you see my posting in this group about what REALLY you have to do?
>
>
>
> Anton
>
>
>
> _____
>
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of salvo v
> Sent: Saturday, August 12, 2006 12:00 AM
> To: Windows File Systems Devs Interest List
> Cc: xxxxx@storagecraft.com
> Subject: Re: [ntfsd] Reading RAW data from CD/DVD
>
>
>
> Thanks Maxim. does any one know which particular plextor drive supports the
> feature of disabling various levels of error correction ?
>
>
>
> Thanks
>
>
> On 8/11/06, Maxim S. Shatskih wrote:
>
> > I came to know that Plextor drives support the feature of disabling all
> error
> >corrections and giving raw data.
> >
> > Does any one know how do i get the data from those drives?
>
> By sending proper SCSI commands via IOCTL_SCSI_PASS_THROUGH. The SCSI
> commands
> are described in MMC-5 (or earlier) spec, downloadable from www.t10.org
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> — Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17 You are currently subscribed to
> ntfsd as: xxxxx@rocketdivision.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Hey Anton:

Sorry i missed your post.

I have already implemented (2), but what i do is instead of doing
MODE_SENSE first, I have sent MODE_SELECT with appropiriate bits set. I have
set retry count to 0 and also enabled DCR bit(Disable Error Correction).

But when i use a READ CD command, it gives me raw data with ECC disabled. I
understand that there are 3 levels of error correction.C1,C2 (Reed-solomon)
done by hardware. What it gives me is the ECC disabled data.

I came to know that plextor drives can provide that EFM level data.

What do you mean when referring to reed-soloman decoder ? The RAW data is
already decoded and what i need is data before applying reed-solomon
decoding!

Thanks,

On 8/8/06, Anton Kolomyeytsev wrote:
>
> Too many questions within single e-mail :slight_smile: OK, actually there are two ways
> doing what you want… Here is first, long way:
>
> 1) You need to hand-craft IRP_MJ_SCSI IRPs and target them to device PDO
> (filling
> embedded CDB and data buffers of course). Take a look at SCSI class driver
> and it would be a nice starting point. I guess you want to do this from
> kernel mode, right
> (unless you’ve picked up the wrong list)? If you really need user mode -
> take a look at SPTI.c sample from DDK. I hope it’s still there :slight_smile:
>
> 2) To turn off drive’s hardware error correction you need to play with
> device’s
> “read error recovery page” (page code 0x01). Use MODE_SENSE10 to retrieve
> current configuration, zero out page header and patch fields you wanna
> modify
> and submit page back to device with MODE_SELECT10. You should care about
> so-called “device recovery strategy” and “number of read retries”.
> Changing
> first parameter from default value of 0x00 (“complete error recovery”) to
> 0x01 (“easy error recovery”) would effectively disable drive’s hardware
> error correction. Decreasing number of read retries from default value (it
> very from one drive to other, most of the burners have it set to 0x0A
> AFAIK)
> to 0x00 also speeds up the things a lot :slight_smile: However life is not easy so
> some
> drives don’t tolerate altering “recovery strategy” from 0x00 -> 0x01, some
> drives just don’t care… You need to run a lot of experiments and create
> vendors and models database. Also you have to keep in mind some of the
> vendors do hardware error recovery modifications via vendor mode pages
> (unpublished of course!) so you’d possibly end up with proprietary
> hardware
> and software, some SCSI bus analyzer and tons of beer 6-packs :slight_smile: In any
> case
> don’t forget to roll the things back when your app would close.
> As Windows standard storage stack would be a little bit confused with
> junky
> data
> drive would return instead of cooked sectors. Sometimes :slight_smile:
>
> 3) Getting RAW stream from CDs is easy. Use READ_CD command (0xBE AFAIK,
> READ10 0x28 for DVDs as they don’t have READ_CD supported) including ALL
> of
> the fields (user data, ECC, EDC and headers). You’ll get 2448 byte/sectors
> with all of the required information. Required for what? I guess for your
> own software-only L2 Reed-Solomon decoder. As with drive hardware error
> recovery firmware went South it would be only you standing between
> scratchy
> and dusty CD/DVD media and multiple read errors :slight_smile: Unlike Step 2 there is
> nobody who’d help you (no SCSI bus analyzer would become in use and
> disassembling somebody else code would take next 10-15 years of your
> life).
> Unfortunately there’s no free source code available on sourceforge.net (or
> anywhere else) and smallest implementation takes
> around 250-300K of tables and math calculations… Good luck :slight_smile:
>
> For DVD media it’s simpler as there’s no way to turn L2 decoder OFF and
> get
> true un-ECC-ed data from the media. You only play with number of retries
> done.
>
> So prepare to spend next 6+ months or so writing own Reed-Solomon decoder,
> checking it on the different CD patterns and building device’s database
> changing your application working strategy (this affects both CD and DVD
> readers).
>
> It was a long way… How here’s very short and EXTREMELY FAST one:
>
> 1) Buy me a new Porsche 911 Carrera Turbo (silver metallic please!) and
> I’ll
> be happy to supply you with a source code of the library doing everything
> of
> the above :slight_smile: I would be even kind enough to update and support it for next
> say 3 years (or how long Porsche have factory warranty on their cars?)…
>
> …or at least buy StarBurn SDK binaries for $1,500. In this case I’ll get
> new wool floor mats for my Evolution IX :slight_smile:
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
> Sent: Wednesday, August 09, 2006 1:27 AM
> To: Windows File Systems Devs Interest List
> Subject: [ntfsd] Reading RAW data from CD/DVD
>
> Hi,
>
> I wish to read data from a DVD drive at lowest possible level. Disabling
> all
> the error correction that the drive implements.
>
> I came to know that Plextor drives support the feature of disabling all
> error corrections and giving raw data.
>
> Does any one know how do i get the data from those drives?
>
> Thanks,
> Salvo
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@voliacable.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

  1. No, resulting sector format is selectable thru the fields in 0xBE CDB and
    not via
    any mode pages… And yes, 0xBE (READ_CD) is unsupported for DVD (and
    BD/HDDVD media). Only 0x28 (READ10). You may still speed up the reading with
    turning off number of retries (but there would be no way to recover or even
    detect
    read errors).

  2. No single drive returns 2325 byte/sectors. I think you’ve mistyped with
    2352…
    And it’s a bad idea to play with subchannel-less RAW data. Address markers
    could
    be missing from main stream (quite a common situation). You would not be
    able
    to recover the stream in case you would with 2448 byte/sectors.

  3. You don’t understand… When burning you have 2048 cooked sector and you
    need to generate EDC and ECC for it. In case of “no error recovery” raw
    reading you get already possibly spoiled data. All you can do with this
    “open-source CD writing code” - detect thru the ECC and EDC re-calculation
    you have broken data in
    the cooked 2048 byte/sector field. But you need not only to DETECT but also
    to
    RECOVER the errors. What L2 correction layer in CD/DVD drive did before
    you’ve
    turned it off. * Error detection* != * error recovery *. See now?

  4. The same as 3)…

Anton

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Saturday, August 12, 2006 1:39 AM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] Reading RAW data from CD/DVD

SCSIOP_READ_CD with some mode page values set to 2325-byte sectors by
MODE
SELECT command. The details are in MMC spec. Don’t think this work for DVDs

IIRC their lowest level accessible by SCSI is 2048-byte sectors.

BTW - I saw the open-source CD writing code which IIRC could calculate
the
CD checksums in software.

As you probably know, during CD writing, you can set the write mode (via
MODE SELECT), and, in some write modes, the burden of calculating the
checksums - and thus converting the 2048-byte sectors to 2352-byte sectors -
is
on your app and not on the drive firmware. This open-source code (IIRC
called
“cdrdao”) is capable of this. More so - Nero 6 uses this way in some of its
write modes (DAO IIRC).

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Anton Kolomyeytsev”
To: “Windows File Systems Devs Interest List”
Sent: Saturday, August 12, 2006 1:09 AM
Subject: RE: [ntfsd] Reading RAW data from CD/DVD

> Did you see my posting in this group about what REALLY you have to do?
>
>
>
> Anton
>
>
>
> _____
>
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of salvo v
> Sent: Saturday, August 12, 2006 12:00 AM
> To: Windows File Systems Devs Interest List
> Cc: xxxxx@storagecraft.com
> Subject: Re: [ntfsd] Reading RAW data from CD/DVD
>
>
>
> Thanks Maxim. does any one know which particular plextor drive supports
the
> feature of disabling various levels of error correction ?
>
>
>
> Thanks
>
>
> On 8/11/06, Maxim S. Shatskih wrote:
>
> > I came to know that Plextor drives support the feature of disabling all
> error
> >corrections and giving raw data.
> >
> > Does any one know how do i get the data from those drives?
>
> By sending proper SCSI commands via IOCTL_SCSI_PASS_THROUGH. The SCSI
> commands
> are described in MMC-5 (or earlier) spec, downloadable from www.t10.org
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> — Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17 You are currently subscribed
to
> ntfsd as: xxxxx@rocketdivision.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@rocketdivision.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

I would reply personally as this topic is quite rare beast and has nothing
to do with NT file system development…

Anton


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of salvo v
Sent: Saturday, August 12, 2006 1:57 AM
To: Windows File Systems Devs Interest List
Cc: xxxxx@rocketdivision.com
Subject: Re: [ntfsd] Reading RAW data from CD/DVD

Hey Anton:

Sorry i missed your post.

I have already implemented (2), but what i do is instead of doing MODE_SENSE
first, I have sent MODE_SELECT with appropiriate bits set. I have set retry
count to 0 and also enabled DCR bit(Disable Error Correction).

But when i use a READ CD command, it gives me raw data with ECC disabled. I
understand that there are 3 levels of error correction.C1,C2 (Reed-solomon)
done by hardware. What it gives me is the ECC disabled data.

I came to know that plextor drives can provide that EFM level data.

What do you mean when referring to reed-soloman decoder ? The RAW data is
already decoded and what i need is data before applying reed-solomon
decoding!

Thanks,

On 8/8/06, Anton Kolomyeytsev wrote:

Too many questions within single e-mail :slight_smile: OK, actually there are two ways
doing what you want… Here is first, long way:

1) You need to hand-craft IRP_MJ_SCSI IRPs and target them to device PDO
(filling
embedded CDB and data buffers of course). Take a look at SCSI class driver
and it would be a nice starting point. I guess you want to do this from
kernel mode, right
(unless you’ve picked up the wrong list)? If you really need user mode -
take a look at SPTI.c sample from DDK. I hope it’s still there :slight_smile:

2) To turn off drive’s hardware error correction you need to play with
device’s
“read error recovery page” (page code 0x01). Use MODE_SENSE10 to retrieve
current configuration, zero out page header and patch fields you wanna
modify
and submit page back to device with MODE_SELECT10. You should care about
so-called “device recovery strategy” and “number of read retries”. Changing
first parameter from default value of 0x00 (“complete error recovery”) to
0x01 (“easy error recovery”) would effectively disable drive’s hardware
error correction. Decreasing number of read retries from default value (it
very from one drive to other, most of the burners have it set to 0x0A AFAIK)
to 0x00 also speeds up the things a lot :slight_smile: However life is not easy so some
drives don’t tolerate altering “recovery strategy” from 0x00 -> 0x01, some
drives just don’t care… You need to run a lot of experiments and create
vendors and models database. Also you have to keep in mind some of the
vendors do hardware error recovery modifications via vendor mode pages
(unpublished of course!) so you’d possibly end up with proprietary hardware
and software, some SCSI bus analyzer and tons of beer 6-packs :slight_smile: In any case

don’t forget to roll the things back when your app would close.
As Windows standard storage stack would be a little bit confused with junky
data
drive would return instead of cooked sectors. Sometimes :slight_smile:

3) Getting RAW stream from CDs is easy. Use READ_CD command (0xBE AFAIK,
READ10 0x28 for DVDs as they don’t have READ_CD supported) including ALL of
the fields (user data, ECC, EDC and headers). You’ll get 2448 byte/sectors
with all of the required information. Required for what? I guess for your
own software-only L2 Reed-Solomon decoder. As with drive hardware error
recovery firmware went South it would be only you standing between scratchy
and dusty CD/DVD media and multiple read errors :slight_smile: Unlike Step 2 there is
nobody who’d help you (no SCSI bus analyzer would become in use and
disassembling somebody else code would take next 10-15 years of your life).
Unfortunately there’s no free source code available on sourceforge.net (or
anywhere else) and smallest implementation takes
around 250-300K of tables and math calculations… Good luck :slight_smile:

For DVD media it’s simpler as there’s no way to turn L2 decoder OFF and get
true un-ECC-ed data from the media. You only play with number of retries
done.

So prepare to spend next 6+ months or so writing own Reed-Solomon decoder,
checking it on the different CD patterns and building device’s database
changing your application working strategy (this affects both CD and DVD
readers).

It was a long way… How here’s very short and EXTREMELY FAST one:

1) Buy me a new Porsche 911 Carrera Turbo (silver metallic please!) and I’ll
be happy to supply you with a source code of the library doing everything of
the above :slight_smile: I would be even kind enough to update and support it for next
say 3 years (or how long Porsche have factory warranty on their cars?)…

…or at least buy StarBurn SDK binaries for $1,500. In this case I’ll get
new wool floor mats for my Evolution IX :slight_smile:

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Wednesday, August 09, 2006 1:27 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Reading RAW data from CD/DVD

Hi,

I wish to read data from a DVD drive at lowest possible level. Disabling all

the error correction that the drive implements.

I came to know that Plextor drives support the feature of disabling all
error corrections and giving raw data.

Does any one know how do i get the data from those drives?

Thanks,
Salvo


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@voliacable.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@gmail.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

— Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17 You are currently subscribed to
ntfsd as: xxxxx@rocketdivision.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

> What do you mean when referring to reed-soloman decoder ? The RAW data is

already decoded and what i need is data before applying reed-solomon
decoding!

IIRC Reed-Solomon encoding on CD/DVD is very, very low level, just before the
platter itself, at the same level as microframes.

I’m not sure you can READ CD such data. What I was speaking about is that your
can read the data CD (2048 byte/sector) as 2352byte/sector, and these “raw”
sectors will include the “cooked” 2048-byte sectors in them, as also the very
long ECC checksum and some other stuff. Yes, this is possible.

You can also write the data CD using 2352-byte sectors, in which case your app
must calculate ECC itself, IIRC the open-source “cdrdao” can do this, as also
Nero in some modes (don’t remember exactly, Disk-At-Once maybe).

Audio uses 2352byte/sector natively, the sector is 1/75 second, and contains
588 samples - 16bit left and 16bit right (stereo). The sampling rate is, as you
can imagine, 75 * 588 = 44100 Hz.

Most of this is known not only from the MMC specs, but from the ancient SCSI-2
spec of around 1995 or so which pre-dated MMC.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Some time passed since I was in CD writing…

  1. No single drive returns 2325 byte/sectors. I think you’ve mistyped with
    2352…

Yes.

  1. You don’t understand… When burning you have 2048 cooked sector and you
    need to generate EDC and ECC for it.

Correct. This task can be done either by the drive (in which case, I send
2048byte sectors in WRITE CDBs) or by the app (in which case, I send 2352byte
sectors). The choice between these is in one of the mode pages (write
parameters?).

reading you get already possibly spoiled data. All you can do with this
“open-source CD writing code” - detect thru the ECC and EDC re-calculation
you have broken data in
the cooked 2048 byte/sector field.

No, it can IIRC just calculate ECC in app software and then write the data
tracks using 2352byte sectors.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Let’s move to NTDEV?

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Anton Kolomyeytsev”
To: “Windows File Systems Devs Interest List”
Sent: Saturday, August 12, 2006 3:08 AM
Subject: RE: [ntfsd] Reading RAW data from CD/DVD

> I would reply personally as this topic is quite rare beast and has nothing
> to do with NT file system development…
>
>
>
> Anton
>
>
>
> _____
>
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of salvo v
> Sent: Saturday, August 12, 2006 1:57 AM
> To: Windows File Systems Devs Interest List
> Cc: xxxxx@rocketdivision.com
> Subject: Re: [ntfsd] Reading RAW data from CD/DVD
>
>
>
> Hey Anton:
>
>
>
> Sorry i missed your post.
>
>
>
> I have already implemented (2), but what i do is instead of doing MODE_SENSE
> first, I have sent MODE_SELECT with appropiriate bits set. I have set retry
> count to 0 and also enabled DCR bit(Disable Error Correction).
>
>
> But when i use a READ CD command, it gives me raw data with ECC disabled. I
> understand that there are 3 levels of error correction.C1,C2 (Reed-solomon)
> done by hardware. What it gives me is the ECC disabled data.
>
>
>
> I came to know that plextor drives can provide that EFM level data.
>
>
>
> What do you mean when referring to reed-soloman decoder ? The RAW data is
> already decoded and what i need is data before applying reed-solomon
> decoding!
>
>
>
> Thanks,
>
>
>
> On 8/8/06, Anton Kolomyeytsev wrote:
>
> Too many questions within single e-mail :slight_smile: OK, actually there are two ways
> doing what you want… Here is first, long way:
>
> 1) You need to hand-craft IRP_MJ_SCSI IRPs and target them to device PDO
> (filling
> embedded CDB and data buffers of course). Take a look at SCSI class driver
> and it would be a nice starting point. I guess you want to do this from
> kernel mode, right
> (unless you’ve picked up the wrong list)? If you really need user mode -
> take a look at SPTI.c sample from DDK. I hope it’s still there :slight_smile:
>
> 2) To turn off drive’s hardware error correction you need to play with
> device’s
> “read error recovery page” (page code 0x01). Use MODE_SENSE10 to retrieve
> current configuration, zero out page header and patch fields you wanna
> modify
> and submit page back to device with MODE_SELECT10. You should care about
> so-called “device recovery strategy” and “number of read retries”. Changing
> first parameter from default value of 0x00 (“complete error recovery”) to
> 0x01 (“easy error recovery”) would effectively disable drive’s hardware
> error correction. Decreasing number of read retries from default value (it
> very from one drive to other, most of the burners have it set to 0x0A AFAIK)
> to 0x00 also speeds up the things a lot :slight_smile: However life is not easy so some
> drives don’t tolerate altering “recovery strategy” from 0x00 -> 0x01, some
> drives just don’t care… You need to run a lot of experiments and create
> vendors and models database. Also you have to keep in mind some of the
> vendors do hardware error recovery modifications via vendor mode pages
> (unpublished of course!) so you’d possibly end up with proprietary hardware
> and software, some SCSI bus analyzer and tons of beer 6-packs :slight_smile: In any case
>
> don’t forget to roll the things back when your app would close.
> As Windows standard storage stack would be a little bit confused with junky
> data
> drive would return instead of cooked sectors. Sometimes :slight_smile:
>
> 3) Getting RAW stream from CDs is easy. Use READ_CD command (0xBE AFAIK,
> READ10 0x28 for DVDs as they don’t have READ_CD supported) including ALL of
> the fields (user data, ECC, EDC and headers). You’ll get 2448 byte/sectors
> with all of the required information. Required for what? I guess for your
> own software-only L2 Reed-Solomon decoder. As with drive hardware error
> recovery firmware went South it would be only you standing between scratchy
> and dusty CD/DVD media and multiple read errors :slight_smile: Unlike Step 2 there is
> nobody who’d help you (no SCSI bus analyzer would become in use and
> disassembling somebody else code would take next 10-15 years of your life).
> Unfortunately there’s no free source code available on sourceforge.net (or
> anywhere else) and smallest implementation takes
> around 250-300K of tables and math calculations… Good luck :slight_smile:
>
> For DVD media it’s simpler as there’s no way to turn L2 decoder OFF and get
> true un-ECC-ed data from the media. You only play with number of retries
> done.
>
> So prepare to spend next 6+ months or so writing own Reed-Solomon decoder,
> checking it on the different CD patterns and building device’s database
> changing your application working strategy (this affects both CD and DVD
> readers).
>
> It was a long way… How here’s very short and EXTREMELY FAST one:
>
> 1) Buy me a new Porsche 911 Carrera Turbo (silver metallic please!) and I’ll
> be happy to supply you with a source code of the library doing everything of
> the above :slight_smile: I would be even kind enough to update and support it for next
> say 3 years (or how long Porsche have factory warranty on their cars?)…
>
> …or at least buy StarBurn SDK binaries for $1,500. In this case I’ll get
> new wool floor mats for my Evolution IX :slight_smile:
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
> Sent: Wednesday, August 09, 2006 1:27 AM
> To: Windows File Systems Devs Interest List
> Subject: [ntfsd] Reading RAW data from CD/DVD
>
> Hi,
>
> I wish to read data from a DVD drive at lowest possible level. Disabling all
>
> the error correction that the drive implements.
>
> I came to know that Plextor drives support the feature of disabling all
> error corrections and giving raw data.
>
> Does any one know how do i get the data from those drives?
>
> Thanks,
> Salvo
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@voliacable.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> — Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17 You are currently subscribed to
> ntfsd as: xxxxx@rocketdivision.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Software Reed-Solomon decoder was implemented first by CloneCD in I think
2002
or early 2003. To workaround bad-block based CD protection systems (SecuROM
and SafeDisc). Alcohol 120%, BlindRead and StarBurn also do this stuff
today. So…

Anton

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Sunday, August 13, 2006 4:27 AM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] Reading RAW data from CD/DVD

What do you mean when referring to reed-soloman decoder ? The RAW data is
already decoded and what i need is data before applying reed-solomon
decoding!

IIRC Reed-Solomon encoding on CD/DVD is very, very low level, just before
the
platter itself, at the same level as microframes.

I’m not sure you can READ CD such data. What I was speaking about is that
your
can read the data CD (2048 byte/sector) as 2352byte/sector, and these “raw”
sectors will include the “cooked” 2048-byte sectors in them, as also the
very
long ECC checksum and some other stuff. Yes, this is possible.

You can also write the data CD using 2352-byte sectors, in which case your
app
must calculate ECC itself, IIRC the open-source “cdrdao” can do this, as
also
Nero in some modes (don’t remember exactly, Disk-At-Once maybe).

Audio uses 2352byte/sector natively, the sector is 1/75 second, and contains
588 samples - 16bit left and 16bit right (stereo). The sampling rate is, as
you
can imagine, 75 * 588 = 44100 Hz.

Most of this is known not only from the MMC specs, but from the ancient
SCSI-2
spec of around 1995 or so which pre-dated MMC.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@rocketdivision.com
To unsubscribe send a blank email to xxxxx@lists.osr.com