Hi, I've just experimentally, in my own copy of the CVS, changed the code in misc/cdrom.c so that it handles mixed mode CDs the same as data CDs for retrieving CD labels. (In the process of trying to get Age of Empires 1 to run in single-player mode).
And surprisingly, it worked! (mind you AOE is not fast under wine, but that's another problem).
Does anyone have any comments on this approach? if not I'll submit a patch...
regards Chris Green
On Fri, Dec 28, 2001 at 07:06:46PM +1000, Chris Green wrote:
Hi, I've just experimentally, in my own copy of the CVS, changed the code in misc/cdrom.c so that it handles mixed mode CDs the same as data CDs for retrieving CD labels. (In the process of trying to get Age of Empires 1 to run in single-player mode).
And surprisingly, it worked! (mind you AOE is not fast under wine, but that's another problem).
Does anyone have any comments on this approach? if not I'll submit a patch...
Hmm, did you actually implement something new or just used old sector reading code ?
I know for a fact that you need special raw sector ioctl()s at least for certain mixed-mode CDs...
On Friday 28 December 2001 20:24, Andreas Mohr wrote:
On Fri, Dec 28, 2001 at 07:06:46PM +1000, Chris Green wrote:
I've just experimentally, in my own copy of the CVS, changed the code in misc/cdrom.c so that it handles mixed mode CDs the same as data CDs for retrieving CD labels. (In the process of trying to get Age of Empires 1 to run in single-player mode).
And surprisingly, it worked! (mind you AOE is not fast under wine, but that's another problem).
Does anyone have any comments on this approach? if not I'll submit a patch...
Hmm, did you actually implement something new or just used old sector reading code ?
I didn't do anything other than use the old sector-reading code. I can say though that it worked for picking up the correct label for both Age of Empires and for Diablo 1, so it does work for at least some CDs.
I know for a fact that you need special raw sector ioctl()s at least for certain mixed-mode CDs...
Yeah I assumed there must have been something like that going on - I couldn't think of any other reason why it wouldn't have been done.
I don't know - does it make sense for wine to support something that seems to work at least some of the time, as opposed to not supporting it at all?
If not, are there any CDs in particular that you know of, that have the requirement for a raw ioctl() read, I might have here, so I could experiment with them?
regards Chris Green
On Fri, Dec 28, 2001 at 09:24:14PM +1000, Chris Green wrote:
On Friday 28 December 2001 20:24, Andreas Mohr wrote:
I know for a fact that you need special raw sector ioctl()s at least for certain mixed-mode CDs...
Yeah I assumed there must have been something like that going on - I couldn't think of any other reason why it wouldn't have been done.
Right :) There are problems at least with certain mixed-mode CDs.
I don't know - does it make sense for wine to support something that seems to work at least some of the time, as opposed to not supporting it at all?
I think what should be done is to find out which mixed-mode CDs exactly are "special" and which ones aren't.
If not, are there any CDs in particular that you know of, that have the requirement for a raw ioctl() read, I might have here, so I could experiment with them?
I guess it might be music CDs with builtin biography data/programs often that are problematic.
If you get hold of such CDs, then you need to experiment with CDROMREADMODE2, CDROMREADMODE1 and/or CDROMREADRAW ioctl()s (in /usr/include/linux/cdrom.h) to get back sector data. I already verified once that you can get the CD label of "problematic" mixed-mode CDs this way. I couldn't figure out the mechanism that e.g. Windows uses to calculate the serial number of these CDs, though.
You might probably want to figure out a way to have misc/cdrom.c also support label and serial reading of problematic mixed-mode CDs, in a modular way (i.e. one that doesn't look too awful code-wise ;)
On Friday 28 December 2001 21:38, Andreas Mohr wrote:
I guess it might be music CDs with builtin biography data/programs often that are problematic.
If you get hold of such CDs, then you need to experiment with CDROMREADMODE2, CDROMREADMODE1 and/or CDROMREADRAW ioctl()s (in /usr/include/linux/cdrom.h) to get back sector data. I already verified once that you can get the CD label of "problematic" mixed-mode CDs this way. I couldn't figure out the mechanism that e.g. Windows uses to calculate the serial number of these CDs, though.
You might probably want to figure out a way to have misc/cdrom.c also support label and serial reading of problematic mixed-mode CDs, in a modular way (i.e. one that doesn't look too awful code-wise ;)
Thanks Andreas. I'll do some investigating!
regards Chris Green
On Friday 28 December 2001 21:38, Andreas Mohr wrote:
On Fri, Dec 28, 2001 at 09:24:14PM +1000, Chris Green wrote:
On Friday 28 December 2001 20:24, Andreas Mohr wrote:
I think what should be done is to find out which mixed-mode CDs exactly are "special" and which ones aren't.
I guess it might be music CDs with builtin biography data/programs often that are problematic.
If you get hold of such CDs, then you need to experiment with CDROMREADMODE2, CDROMREADMODE1 and/or CDROMREADRAW ioctl()s (in /usr/include/linux/cdrom.h) to get back sector data. I already verified once that you can get the CD label of "problematic" mixed-mode CDs this way. I couldn't figure out the mechanism that e.g. Windows uses to calculate the serial number of these CDs, though.
You might probably want to figure out a way to have misc/cdrom.c also support label and serial reading of problematic mixed-mode CDs, in a modular way (i.e. one that doesn't look too awful code-wise ;)
Ok - I've been doing some serious experimenting here, including reading the iso 9660 spec :)
I've found some interesting things too.
First, it seems that some CD's don't just store the 'best' data in higher-numbered volume descriptors. Some seem to store 'everything' in the type 1 (primary) descriptor, and only store the modified info in the type 2 (secondary) descriptor. So the routine CDROM_Data_FindBestVoldesc (it returns the highest-numbered descriptor) might need some rethinking...
Secondly, I found a real curiosity in one particular CD: Microsoft's Multimedia Beethoven (about 1992) isn't ISO9660 at all. It's a mixed mode CD, and is readable in Windows, as well as Wine, but the label is screwy (Windows XP gets it wrong too). Instead of using the specification identifier 'CD001' (ISO9660) it uses 'CDROM' and has two dwords stored at the start of the volume descriptor, as well as having a few other discrepancies. I have no conclusive proof as to what specification it's written, but I'm guessing its possibly the original High Sierra format, or perhaps an even earlier, semi-proprietary, spec. Either way, it makes me wonder whether some of the 'strange' mixed-mode CDs are of a similar nature.
Anyway, what I'm thinking is to rewrite the code that deals with CD labels to take into account what I've found so far - I'll also include support to get the label from the 'CDROM' type I've found, so we'll have the right label for that CD too. Quite possibly, that'll fix the 'strange' mixed mode CD's too.
If anyone has an odd CD lying around, they can email me the first 65536 bytes of the CD (hopefully no vendor will care about copyright on their volume descriptors!) so I can compare the structure of the volume descriptors - I've got about 8 of them so far, just use 'dd if=/dev/scd0 of=cd.dmp bs=65536 count=1' and compress the result before emailing it to me :)
regards Chris Green
On 2001.12.30 03:34 Chris Green wrote:
If anyone has an odd CD lying around, they can email me the first 65536 bytes of the CD (hopefully no vendor will care about copyright on their volume descriptors!) so I can compare the structure of the volume descriptors - I've got about 8 of them so far, just use 'dd if=/dev/scd0 of=cd.dmp bs=65536 count=1' and compress the result before emailing it to me :)
hmm, wouldn't dd if=/dev/cdrom of=cd.dmp bs=2048 count=32 be better?
Maybe it doesn't make a damn bit of difference, but as the blocksize on cds is 2048 bytes I think it makes more sense to say gimme the first 32 2048-byte sectors.
-Dave
On Sunday 30 December 2001 20:04, you wrote:
got about 8 of them so far, just use 'dd if=/dev/scd0 of=cd.dmp bs=65536 count=1' and compress the result before emailing it to me :)
hmm, wouldn't dd if=/dev/cdrom of=cd.dmp bs=2048 count=32 be better?
Maybe it doesn't make a damn bit of difference, but as the blocksize on cds is 2048 bytes I think it makes more sense to say gimme the first 32 2048-byte sectors.
six of one, half-a-dozen of the other :) they give the same data, I just often go for large block sizes and smaller counts - some read-ahead type operations run faster, I find, if you do that. I don't mind either way :)
Chris
On 2001.12.30 05:10 Chris Green wrote:
On Sunday 30 December 2001 20:04, you wrote:
got about 8 of them so far, just use 'dd if=/dev/scd0 of=cd.dmp
bs=65536
count=1' and compress the result before emailing it to me :)
hmm, wouldn't dd if=/dev/cdrom of=cd.dmp bs=2048 count=32 be better?
Maybe it doesn't make a damn bit of difference, but as the blocksize on cds is 2048 bytes I think it makes more sense to say gimme the first 32 2048-byte sectors.
six of one, half-a-dozen of the other :) they give the same data, I just often go for large block sizes and smaller counts - some read-ahead type operations run faster, I find, if you do that. I don't mind either way :)
Duh!
For some reason I was thinking the other way around... i.e. If you specify the blocksize as less than what the blocksize is (or not on an integer multiple of it) then you run into issues. You are correct, specifying it as 64kiB (gotta love the new SI standards, hehe) would actually increase the reading performance, not decrease it.
-Dave
Ok -I'm just about ready to submit a patch :) What I've done is to check for the pre-iso signature, and if it occurs, to increase the offset by 8. This puts the offset in a position that makes the get label function find the correct entry. I've tested it with both 'normal' iso9660 cds, and with pre-iso cds (e.g. MS Multimedia Beethoven, and MS Cinemania 92) and it works flawlessly in both cases.
Any comments by anyone before I send in the patch?
regards Chris Green
On Sun, 30 Dec 2001, Chris Green wrote: [...]
If anyone has an odd CD lying around, they can email me the first 65536 bytes of the CD (hopefully no vendor will care about copyright on their volume descriptors!) so I can compare the structure of the volume descriptors - I've got about 8 of them so far, just use 'dd if=/dev/scd0 of=cd.dmp bs=65536 count=1' and compress the result before emailing it to me :)
There are a number of bug reports concerning CD label problems in Bugzilla... although currently I can find only one (I thought there were more). I asked the submitter to try again with a recent Wine. FYI, here is the bug: http://wine.codeweavers.com/bugzilla/show_bug.cgi?id=275
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ Cahn's Axiom: When all else fails, read the instructions.
Using Dark Reign (The Future of War) mixed CD, (one data track and several audio after),
label is reported correctly. Good Job !
--- Francois Gouget fgouget@free.fr a écrit : > On Sun, 30 Dec 2001, Chris Green wrote:
[...]
If anyone has an odd CD lying around, they can
email me the first 65536 bytes
of the CD (hopefully no vendor will care about
copyright on their volume
descriptors!) so I can compare the structure of
the volume descriptors - I've
got about 8 of them so far, just use 'dd
if=/dev/scd0 of=cd.dmp bs=65536
count=1' and compress the result before emailing
it to me :)
There are a number of bug reports concerning CD label problems in Bugzilla... although currently I can find only one (I thought there were more). I asked the submitter to try again with a recent Wine. FYI, here is the bug:
http://wine.codeweavers.com/bugzilla/show_bug.cgi?id=275
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ Cahn's Axiom: When all else fails, read the instructions.
___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Courrier : http://courrier.yahoo.fr
On Wednesday 02 January 2002 17:00, Francois Gouget wrote:
There are a number of bug reports concerning CD label problems in Bugzilla... although currently I can find only one (I thought there were more). I asked the submitter to try again with a recent Wine. FYI, here is the bug: http://wine.codeweavers.com/bugzilla/show_bug.cgi?id=275
Thanks Francois - I've had a look at the bug report you mentioned, and (fingers crossed) it should be fixed with the patch. I can't see any reason why it wouldn't be, anyway!
regards Chris Green