I wasn't sure whether to start a new thread but I figured all the IRD discussion is going on here so figured it may be best to post this here as well.
Having discussed IRD files with others recently I'm now pretty sure that the existing IRD format doesn't cater for hybrid discs and would need some sort of new IRD v2.0 revision in order to get round this fact. Whether anyone would want to spend the time doing this is another matter entirely. Apologies in advance if others have already mentioned some or all of the following but if so then I've not managed to find anything online myself. Apologies for the length of this post as well but I thought it best to try and cover everything in one go!
Essentially, there would appear to be an inherent flaw in how IRDs are created in that there's an assumption that all data is written contiguously on PS3 discs. In 99% of cases this is true but with hybrid discs this doesn't appear to be the case.
Since I was having trouble getting hybrid disc titles to rebuild I got hold of and dumped an actual disc myself using my PC: Phineas and Ferb Across the 2nd Dimension [BLES01376]. It was a perfect match against the one in the Redump dat. I then tried to create an IRD only to find that when trying to rebuild the disc, two of the files didn't match. This non-matching files issue seems to be a problem that people have had with all hybrid discs so far and I think there was even some uncertaintly as to whether these types of discs had been dumped correctly since it didn't seem possible to rebuild them using existing IRD files.
Please note that since I can only use HEN on my PS3 console I cannot create IRDs on there, nor can I dump encrypted ISO images. However, my decrypted dump that I made using my PS3 was a 100% match for the decrypted dump that I created using PS3Dec from my original PC-dumped ISO. The reason why I mention this is to confirm that my dumps and the Redump one *are* fine and the Blu-ray video content works perfectly as well.
I used ird_tools with my IRD file to have a look at how the files were supposedly laid out on the disc and in tandem with a hex editor I worked out that the two files in question were actually split into three chunks and interspersed with each other on the disc.
SECTOR 1637952: 00019.m2ts 473580 sectors or 969,891,840 bytes
SECTOR 2111532: 00013.m2ts 448545 sectors or 918,620,160 bytes
SECTOR 2560077: 00019.m2ts 474663 sectors or 972,109,824 bytes
SECTOR 3034740: 00013.m2ts 447489 sectors or 916,457,472 bytes
SECTOR 3482229: 00019.m2ts 458031 sectors or 938,047,488 bytes
SECTOR 3940260: 00013.m2ts 449331 sectors or 920,229,888 bytes
After doing all of this I then realised that one of the log files spewed out by MPF when I ripped the disc had already done all this hard work for me - duhhh! PS3VOLUME_volDesc.txt breaks down the TOC in a very detailed fashion and agreed with what I'd worked out manually.
For example, here's the entry for 00013.m2ts:
Length of Directory Record: 52
Extended Attribute Record Length: 0
Location of Extent: 2111532
Data Length: 918620160
Recording Date and Time: 2011-05-26T22:44:05+00:00
File Flags: 128 (Visible, File, No Associated, No Record Format, No Owner/Group ID, No Final Directory Record)
File Unit Size: 0
Interleave Gap Size: 0
Volume Sequence Number: 1
Length of File Identifier: 12
File Identifier: 00013.M2TS;1
FullPath: \BDMV\STREAM\00013.M2TS
Length of Directory Record: 52
Extended Attribute Record Length: 0
Location of Extent: 3034740
Data Length: 916457472
Recording Date and Time: 2011-05-26T22:44:05+00:00
File Flags: 128 (Visible, File, No Associated, No Record Format, No Owner/Group ID, No Final Directory Record)
File Unit Size: 0
Interleave Gap Size: 0
Volume Sequence Number: 1
Length of File Identifier: 12
File Identifier: 00013.M2TS;1
FullPath: \BDMV\STREAM\00013.M2TS
Length of Directory Record: 52
Extended Attribute Record Length: 0
Location of Extent: 3940260
Data Length: 920229888
Recording Date and Time: 2011-05-26T22:44:05+00:00
File Flags: 0 (Visible, File, No Associated, No Record Format, No Owner/Group ID, Final Directory Record)
File Unit Size: 0
Interleave Gap Size: 0
Volume Sequence Number: 1
Length of File Identifier: 12
File Identifier: 00013.M2TS;1
FullPath: \BDMV\STREAM\00013.M2TS
I also had a look at some other discs with large files, such as The Last of Us, and found that they also had files that were broken into several parts on the disc, according to the TOC, but they *were* written sequentially so the fact that the IRD only had the start sector of the first part didn't matter.
One thing I didn't manage to suss out was how the two incorect MD5 values in the IRD file were calculated. I tried several different options and nothing I came up with matched the incorrect values. It's probably not really important but it still confused me all the same! I may have just goofed somewhere but I am quite a belt and braces sort of person so...
Anyway, as far as I can make out, in order to be able to rebuild hybrid discs the IRD format (and any of the tools that use it) would need to be updated as follows:
- When an IRD is created it needs to take into account the file flags of each file in the TOC. A value of 128 seems to mean that the file in question is not complete, a value of 0 means it is and there is no more data relating to it on the disc.
- When the data is split into parts each start sector and data length needs to be stored in the IRD and any rebuild tools need to be aware of this
e.g. This one is incorrect and doesn't accurately represent how the data is written on the disc
"PATH" : "/BDMV/STREAM/00013.m2ts",
"MD5" : "0A5030BCFEC20343EFB64256DCE01071",
"SECTOR" : 2111532,
"SIZE" : -1539659776,
"TYPE" : "Plain"
e.g. Something like this would log how the data really was laid out on the disc
"PATH" : "/BDMV/STREAM/00013.m2ts",
"MD5" : "1F220D299A237D352D6C78DBF05A65D3",
"SECTOR" : 2111532,3034740,3940260
"SIZE" : 918620160,916457472,920229888
"TYPE" : "Plain"
All of the above is waaaaaaay beyond my pathetic coding skills but I thought I'd lay all this out in a post in case it was of any use to anyone out there who does have the required skills to potentially make any updates to the IRD format... and ideally the creation/rebuild tools too! Right, that's me done for now then
TL;DR Hybrid discs are broken in current IRD files