-
Notifications
You must be signed in to change notification settings - Fork 794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Directory Scan validates bin/cue compressed in 7zip, but rejects them after extraction #1513
Comments
Note the expected relevant redump data is here. In some cases redump data could be getting precedented/over-ruled by something earlier in the build / higher in the repository for the final database build, though I don't see any other Mega CD RetroArch should be using serial for matching Mega CD and disc-based games with databases, scanned inside the game's binary (NOT metadata). Could the 7zip load cause some other handling of how the file is ID'd? Like it's using the checksum if 7zip has that pre-computed and accessible, when RA normally wouldn't use the checksum (see above) when scanning a disc? I searched PR's for info about 7z scanning behavior but I don't see anything that seems relevant. |
@OctopusButtons thanks for response. I am trying to understand how it works. First I checked serial number inside of bin-file file using hex editor: So, something else went wrong, like following, right? P.S. I was thinking it's a problem on my end, so I also tried scanning this copy of Road Rash on another computer with newly installed Retroarch and problem still persists. P.P.S. if it worth checking and I can be somehow helpful I can make a screencast of what I am doing to add this game to the playlist. |
Not a screencast, but do logs show the same thing happening when you scan 7zip versus unzipped? The fallback is Manual Scan, that will get the game into playlist, though the intriguing mystery remains. The .rdb file is the final real data used by RetroArch, so if your check showed the correct serial in your local .rdb, that should mean there's no precedence/over-rule issue (which would only apply at the level of multiple conflicting 7zip file scanning successfully while uncompressed fails is interesting. I searched but I don't see any info about 7zip scans doing matching that is different from normal (see below). I suppose it's worth trying new RA version 1.20 unless your second computer test was already 1.20. About database matching and file ID. Note that while the sha/md5 etc convince us that your file matches Redump's, Retroarch database matching only uses serial number in a disc game's binary data (and uses CRC checksum for database matching for smaller file / non-disc-based games). I can't imagine how the serial number would be different if the md5 is the same, which points back to RA's serial-scanning behavior going wrong, so I'm stumped. Scan settings. I know very little about the ins/outs of scanning (I usually do Manual Scan myself), especially with cue/bin. I'm interested in this case because it will help my research for a documentation update I'm working on. |
I've found that both running and scanning in 7z archives can be hit or miss. While your mileage may vary, I'd recommend trying without using 7z. For reference, here's the entry in the dat: libretro-database/metadat/redump/Sega - Mega-CD - Sega CD.dat Lines 2441 to 2446 in a2e9b12
|
The telling thing in this case is that it's scanning/validating correctly when in the 7z, but failing when outside/uncompressed. I thought RA could be doing non-normal behavior because of the 7z, like somehow grabbing and matching checksum that was stored in the 7zip metadata, somehow not doing the expected serial scan. But I don't see any documentation of anything like that, and if that feature exists I still don't get the anomaly of the failed uncompressed scan. |
Yes, this is happening after extraction. Just to make sure, here is the quick screencast of what is going on (70mb mkv file in Dropbox): |
I may have a lead, actually. I forgot to check log file when I was making video, so I re-did the same test, and this time I noticed, that when it is scanning 7z files, it starts with BIN file, checks it, and add to playlist right after that: But when scanning extracted version it only checks CUE file: So this can be a difference between 7z`ed and extracted files. It will be a good idea to check Road Rash's CUE file. Maybe there are wrong paths, but no, everything seems fine:
The other files, from the other games only differ by the first line:
But adding this line to the Road Rash's cue doesn't help. |
Looked a bit further. Sega CD database indexes the serial: https://github.com/libretro/libretro-super/blob/9f8ebb51b21c81802050da9670771c271ebf5b2a/libretro-build-database.sh#L334C2-L334C65
In This calls |
I recommend now changing the issue title to something like: "Directory Scan successfully validates bin/cue compressed in 7zip, but ignores the bins and scans/rejects the cue if files are extracted" or specifying that it validates and scans fine in 7z but not outside. Might help get more attention. (I know that's similar in essence to your current title though.) It may be correct to move the issue to RetroArch issues rather than database. And the fact that the 7zip scan validates fine (I think?) it's not really a Road Rash issue now. I'm really interested now because bin/cue scanning is a mystery to me and I don't see documentation. The To maybe learn more:
My tips are like blackbox-testing, because I have no capability to read the scanner code on github to understand directly what it's doing. The answers might shed some light. Could even possibly be some OS-related quirk happening with RA / 7z. Can you make an edit to specify which OS's the 2x test computers were? If trying to figure out how databases work in order to go deeper on troubleshooting, I have pending/draft additional clarifying research here. Though this issue is looking like RetroArch rather than databases now. Also this issue seems similar: their scan/validation worked with the zip, but not with extracted files. (Note that when you see reference to hash/checksum match or check, in reality now disc-based games use a serial NOT a crc/hash for matching, and RA gets the serial by scanning game's binary data.) |
>>It may be correct to move the issue to RetroArch issues rather than database. @RobLoach can you kindly take a look? I see you are being added to the organization. >>For first Scan File, target only the cue file (everything uncompressed, not in 7z) See if it adds it.
Both scanner seems work the same. >>Remove it from playlist again, and now Scan File on the .bin. It makes me think there is something wrong with the cue file, like a wrong path or wrong character in the document. But I keep comparing it with another working game symbol by symbol and it seems perfectly fine: >>Zip the cue and bin into a .zip instead of .7z and see if Scanning is equally successful as the 7z or not. This can, actually, be the reason why Sega CD games can't be run from the 7z / zip archives: archived games added by bin files, and bin files alone can't run a game: May I ask if you guys have any thoughts on that? Was this always an issue? >>Verify that your successful scan games have expected data in the .dat files. It might expose something obvious we missed. (E.g. I'm not even sure whether the .dat should be only Bin 1? If we talk about this DAT file, then ever each of 16 games I have, they all add to the playlist just fine. I checked first bin track for a couple of them and it matches DAT perfectly: serial, file size, md5, crc, sha. For some reason it struggle with Road Rash only. Will test more games later. >>Could even possibly be some OS-related quirk happening with RA / 7z. Can you make an edit to specify which OS's the 2x test computers were? |
Sorry, I should have said open on RetroArch issues separately, rather than transfer per se. Because it looks like a scanner/import program issue, rather than database. (But leave the database issue open until final word.)
In my testing of my games, Genesis Plus GX core can run fine if a I found and read this pull request from years ago. And from your info, is the 7zip/zip scanner more "diligent" and checks every file, while ignoring files in folders when extracted? Like you mentioned and saw in your logs, the scan of the extracted files (apparently) works based on file extension (unlike zips)...it ignored the bins directly and only scanned the cue. But frankly I don't understand that, since if it's scanning cue it should be looking at the referenced bins that are referenced by the cue file...because the bin is what's defined in the database. |
I have a working Road Rash rom file, and both tracks MD5 matches with redump data base.
But using Import Content -> Scan Directory I can't add this rom to the playlist.
All of the other CD's from the same source can be added normally. I also tried redownloading Road Rash from other sources and faced the same problem.
The strange thing I noticed is that it can be added normally while it is still inside of 7z archive, but can't be added right after extraction.
Using RetroArch 1.19.1 on M1 mac.
DB is updated via Main menu -> online update -> Update Databases
Log:
Contains of Road Rash (USA).cue:
The text was updated successfully, but these errors were encountered: