BIN/CUE/FLAC(+7z) on Data/Audio Discs

vbimport

#1

I’ve been looking at a lot of my old game collection for archival lately. Many games from the 90’s had both data (CD-ROM) and Redbook Audio (CD-Audio) components to them so that the game audio can play in the background while the game is playing, with examples being game discs of the Windows 95 era and original Playstation games. Because of the Redbook audio, these discs don’t compress well and I think it could be better.

Unless I’m mistaken, the best way to archive the discs currently is to perform LZMA compression on a BIN/CUE image of the discs using a combination of something like ImgBurn and 7-zip. Unfortunately, none of the lossless compression algorithms for files compress the audio portion of the discs very well. But something like FLAC works well for audio.

A solution to better compress the audio portion of the disc is to use something like CUEtools and make a CUE/FLAC disc image. Unfortunately, CUEtools discards the data portion of the image completely.

I believe that the best of both worlds exist. A CUE/BIN/FLAC image for hybrid discs would be beneficial because the audio tracks are easily accessible and better compressed. I can compress the CUE and BIN data separately using LZMA and get some pretty good results.

I have made a BIN/CUE/FLAC image manually. Is there a program that can rip hybrid discs to BIN/CUE/FLAC images? If not, is there a limitation that stops people from doing this? If there is not, may someone please make a program that does this or add this feature into their ripper/burner?

The CUE file standard does not object to having audio tracks and data from different sources and not just the BIN file. I have made a BIN/CUE/FLAC image manually from two rips and a notepad-modified CUE file. This image burns and plays fine. Here are my instructions for making a proof-of-concept BIN/CUE/FLAC image. I have performed these instructions on the video game disc “Agile Warrior F-111X”.

[ol]
[li]Using the CUE Ripper program of CUE Tools, I ripped the tracks of the disc in lossless FLAC format, in tracks using libFlake, using compression set to 11. I ripped these individual tracks in a folder called “[Just the Audio]” (if you wanted to know).[/li][li]Using ImgBurn’s “Build” feature, I dragged and dropped the files from the disc. I built the BIN/CUE image trying to replicate the data type and disc labels. (For the game I used, the data type was really MODE1/2352 but the closest thing I could use was MODE2/2352; I thought that the data was only ISO9660 Level 1 with standard character set.) I put the BIN/CUE in a folder called “[Just the Data]”.[/li][li]I made a new folder from the FLAC tracks and data BIN.[/li][li]I modified a cue file with notepad and put it into that folder as well. The file should start with “””FILE “data.bin” BINARY\ TRACK 01 MODE2/2352\ INDEX 01 00:00:00””” for the data portion, followed by “””FILE “01. Track 01.flac” WAVE\ TRACK 02 AUDIO\ INDEX 01 00:00:00””” on a new line for each consecutive audio track. You can keep the REM line from the CUE Tools CUE file if you want, but I did not.[/li][/ol]
At this stage, you should have a working CUE/BIN/FLAC image. These next steps are just for 7z compression.

[ol]
[li]I temporarily removed the FLAC tracks for a moment. I work with the BIN and CUE files in this next step.[/li][li]I used 7-zip to compress the folder. For me, the settings I used were Ultra / LZMA / 64 MB / Word Size: 273 / Solid Block / 2 CPU threads. I kept the update mode at “Add and replace files” for this step. I did not change the name of the archive: the archive name is the name of the folder.[/li][li]I added the FLAC tracks back in. I will work with all the files for this next step.[/li][li]I used 7-zip to compress the folder again, but this time I used the update mode “Update and add files” and the compression level “Store”. I did not change the name of the archive: the archive name is the name of the folder. This new archive should add the FLAC tracks, previously missing, in an uncompressed format.[/li][/ol]
By the end of this these instructions, I have created the 7z file that I will use to store the image for backup purposes.

My current proof of concept lacks the exact filesystem structure of the data portion of the disc; if you recall, I simply slapped the files from the disc onto another BIN/CUE image, which does not replicate the filesystem structure. Should there be any copy protection on any game, my proof of concept instructions would not make the game playable. I propose that someone should make a program that rips to BIN/CUE/FLAC because it would replicate the filesystem structure of the data.

If someone could make a program that makes this proof of concept better than I, it would be a great help! Not just to me but to the community.

Lastly, I think that this compressed single file should be burnable by itself, so I want it to have its own file extension. I think the compressed single file image should have the file extension “.cfz”; that extension is not linked to any program.


#2

[B]Update:[/B] I have been able to get the exact filesystem structure of a data disc. This relies on any program that rips only the data portion of a disc. I simply used CD Burner XP to rip the disc as single-track ISO, followed by burning the image and ripping the image disc as a .bin.

The problem with CD Burner XP is that you cannot set hardware error retries to zero like in ImgBurn. This makes reading discs with errors unbearably slow, like when a disc has copy protection based on unreadable sectors.

I don’t know if this actually works for the copy protection mentioned above. It verified fine using ImgBurn, but I have not tried the game.


#3

[QUOTE=Ostratego;2715417]I don’t know if this actually works for the copy protection mentioned above. It verified fine using ImgBurn, but I have not tried the game.[/QUOTE]

Most likely it won’t work,as quite a few of the copyprotecions from the 90’s used subchannel data to store their verification algorithms.
Ripping to *.iso rips only the filestructure to 2048 bytes/sector streams,while you need at least 2368 (DAO16) bytes/sector to get some or even 2448 (DAO96) to get all subchannel data.
And then we’re not even talking about copyprotections based on weak sectors,like for example,SafeDisc. :slight_smile:
While your project is an interesting experiment,I highly doubt that there’s any software developer who will try to write a program wich suits your needs.
Storage space is dirt cheap these days,you can put more than 25 images on a 2.5 $ Blu-ray disc,or even 1000 PS1/cd-rom backups on a 69 $ external hd.
IMHO,there’s simply no market for such an archiver.:disagree:


#4

Thanks for telling me the flaws here. I’ll have to research subchannel data and copy protection based on unreadable sectors harder. I’ll also try to find more information on BIN/CUE rippers that rip data only, and whether that is viable for preserving copy protection.

The implementation seems so easy to make that the market doesn’t matter anymore; It’s a pretty obvious implementation. I think of this experiment as an extension of the CUE format to the point where I cannot believe it was not thought of as a feature for something like CUEtools. That said, I don’t work in actual programming languages: I’ve only dabbled in C++, C, Java, and python and I mostly work in batch files. If I had six months of free time, I would implement this somewhere, but I don’t have that time.

I also didn’t expect there to be a market for it either. While I know that space is not important nowadays, regardless of the high dollar per gigabyte prices of SSDs, I think that compression is not the only benefit. If the image was burned without data compression, the disc audio can easily be accessed for listening. In contrast, Virtual Clonedrive and ImDisk cannot mount a BIN/CUE image properly if it has audio in it; you would have to burn it to listen to it.

I would not pay for a product that does this proof of concept; again, I think this would be good in something free or open source like CUEtools, which has all the pieces of this feature already.


#5

[QUOTE=Ostratego;2715592]In contrast, Virtual Clonedrive and ImDisk cannot mount a BIN/CUE image properly if it has audio in it; you would have to burn it to listen to it.[/QUOTE]I think DAEMON Tools supports multisession cues.


#6

Hi Ostratego I’ve been looking into doing this or I should say I have looked into doing this along time ago… last century if memory serves and I always ran into the same problem of what program will burn a BINARY+WAVs or BINARY+MP3s back to the original state.

I first imaged the complete disc with cdrwin 3.7c just to get the cue file then made a bin of just the data track and extracted the audio tracks to wavs, I had to rename the audio files as cdrwin gives them a .bin extension but they are real riff/waves if you look with a hex editor
I then edited the cue file to except the separate audio files and loaded it into imgburn, under view image information the disc layout looked identical to the complete image+cue I made first but I get an error when imgburn attempts to write to a cd

“Failed to send cue sheet! invalid field in first parameter list”

btw alcohol 52% seems to work with mixed mode images, I can even make an image from its virtual drive with imgburn and it plays fine.

any ideas as to why this cue is bad?


FILE "kingpin.bin" BINARY
  TRACK 01 MODE2/2352
    INDEX 01 00:00:00
  TRACK 02 AUDIO
FILE "kingpin01.wav" WAVE
    PREGAP 00:01:66
    INDEX 01 52:42:08
  TRACK 03 AUDIO
FILE "kingpin02.wav" WAVE
    INDEX 00 56:18:01
    INDEX 01 56:20:01
  TRACK 04 AUDIO
FILE "kingpin03.wav" WAVE
    INDEX 00 60:39:59
    INDEX 01 60:41:59
  TRACK 05 AUDIO
FILE "kingpin04.wav" WAVE
    INDEX 00 64:18:40
    INDEX 01 64:20:40
  TRACK 06 AUDIO
FILE "kingpin05.wav" WAVE
    INDEX 00 67:52:41
    INDEX 01 67:54:41
  TRACK 07 AUDIO
FILE "kingpin06.wav" WAVE
    INDEX 00 72:15:68
    INDEX 01 72:17:68


#7

Because the index times are relevant to the start of the file, not of the disc as a whole. So basically, the sound file ones should be back at 00:00:00 for index 00.


#8

thanks for that explanation LIGHTNING UK! I thought there might be a Yossarian issue


#9

Some old safedisc 1 protected games were recorded on mixed mode cds. Given how cheap both internal and external hard drives are these days, if you want to archive them, I suggest that you make images files of the cd/s with alcohol 52% in either mds/mdf or bin/cue format and then store the image files on an external hard drive.