Cue2cu2: A Python script to create CU2 sheets

Generic Customer Feedback, Content and Reviews based directly on PSIO
User avatar
Takehaniyasubiko
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 3460
Joined: March 13th, 2018, 5:04 am
PlayStation Model: SCPH-1002
Has thanked: 29 times
Been thanked: 18 times

Re: Cue2cu2: A Python script to create CU2 sheets

Post by Takehaniyasubiko » April 13th, 2020, 5:14 am

NRGDEAD wrote: April 13th, 2020, 4:43 amThen there would be no need for a separate PREGAP command, since there's INDEX 00 and the cue sheet in question even uses INDEX 00 for tracks 3 and onward.
It might be a mistake/bug. What do we even know about the .bin file? It's fan-made. That's why I'm asking.

PS1 CD-ROMs don't have the PREGAP string as all of the pregaps are physically present on the PS1 discs.
"Because we don't know when we will die, we get to think of life as an inexhaustible well. Yet everything happens only a certain number of times, and a very small number really. How many more times will you remember a certain afternoon of your childhood, an afternoon that is so deeply a part of your being that you can't even conceive of your life without it? Perhaps four, five times more, perhaps not even that."
- Paul Bowles

User avatar
NRGDEAD
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 1090
Joined: September 22nd, 2017, 3:10 am
I am a: Noob
PlayStation Model: SCPH-1002
Has thanked: 2 times
Been thanked: 8 times

Re: Cue2cu2: A Python script to create CU2 sheets

Post by NRGDEAD » April 13th, 2020, 5:57 am

Takehaniyasubiko wrote: April 13th, 2020, 5:14 am It might be a mistake/bug. What do we even know about the .bin file? It's fan-made. That's why I'm asking.
I didn't write or modify Cue2cu2 for this exact image. The PREGAP command handling is a best effort workaround based on what seems to me like a commonly agreed upon part of the cue sheet format. Like the warning message Cue2cu2 spits out when encountering a PREGAP command, if you can, please use a Redump compatible image instead - meaning one where the pregaps are present physically.
Takehaniyasubiko wrote: April 13th, 2020, 5:14 am PS1 CD-ROMs don't have the PREGAP string as all of the pregaps are physically present on the PS1 discs.
CD-ROMs don't have any of those strings in general because the cue sheet itself is only a representation of the TOC, independent from the physical disc.
You might not see PREGAP commands in Redump cue sheets simply because they always use INDEX 00 and have the data present in the binary file accordingly. And while the Redump way is a very good reference for us, it's not neccesarily the only correct way of doing it - especially if you're not dumping a physical disc but are creating your own from scratch. If the result will work out of the box on the PSIO is on another page, though. But based on the information you have in form of the image, you should be able to "restore" it.
Because, again, a perfect image might still come in different forms: single-bin + cue, multi-bin + cue, with pregaps present in the binary files or not. Provided the image is perfect and you were to convert it to a single-bin + cue with no PREGAP commands, it should always result in the exact same binary file - regardless of the form it had before.
Cue2cu2: A Python script for creating CU2 sheets via the command line on Linux/Mac/Windows.
GitHub / Forum

PSIO wallpaper template in Photoshop format.

User avatar
Takehaniyasubiko
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 3460
Joined: March 13th, 2018, 5:04 am
PlayStation Model: SCPH-1002
Has thanked: 29 times
Been thanked: 18 times

Re: Cue2cu2: A Python script to create CU2 sheets

Post by Takehaniyasubiko » April 13th, 2020, 6:53 am

NRGDEAD wrote: April 13th, 2020, 5:57 amI didn't write or modify Cue2cu2 for this exact image.
No, I mean a mistake/bug in the compilation of that fan-made DOOM disc image.
NRGDEAD wrote: April 13th, 2020, 5:57 amCD-ROMs don't have any of those strings in general because the cue sheet itself is only a representation of the TOC, independent from the physical disc.
Cue files for PS1 CD-ROMs should never have a PREGAP string because all of the preagaps are physically present on the discs, in the form of silence which is pressed into the discs as data (0s). A proper PS1 disc would never depend on a Windows program to define an arbitrary pregap playback. Since this "DOOM Beta 3" disc image is, in fact, a PS1 disc, then it seems like a simple mistake that the PREGAP string is present in its cue sheet.
NRGDEAD wrote: April 13th, 2020, 5:57 amYou might not see PREGAP commands in Redump cue sheets simply because they always use INDEX 00 and have the data present in the binary file accordingly.
You don't see them in Redump cue sheets because all PS1-mastered CD-ROMs have the pregaps physically present on the disc.
"Because we don't know when we will die, we get to think of life as an inexhaustible well. Yet everything happens only a certain number of times, and a very small number really. How many more times will you remember a certain afternoon of your childhood, an afternoon that is so deeply a part of your being that you can't even conceive of your life without it? Perhaps four, five times more, perhaps not even that."
- Paul Bowles

User avatar
NRGDEAD
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 1090
Joined: September 22nd, 2017, 3:10 am
I am a: Noob
PlayStation Model: SCPH-1002
Has thanked: 2 times
Been thanked: 8 times

Re: Cue2cu2: A Python script to create CU2 sheets

Post by NRGDEAD » April 13th, 2020, 7:27 am

Okay, one last time:
An image is not a disc. And bin/cue is a pretty flexible image format.
It makes no difference for the result, let's call it a virtual disc, wether or not a silent pregap is physically present in the binary or only referenced per PREGAP in the cue sheet:
If you're creating an image from a disc and there's a two second silent pregap for track 2, the imaging software can either write those zeroes in the binary file and put an INDEX 00 in the cue sheet - OR it can skip writing the zeroes to the binary file and put PREGAP 00:02:00 in the cue sheet instead.
Any imaging software or drive emulator or burning software using that image, when asked to play/burn index 0 of track 2, will return the same amount of silence in either case. Regardless of the structure of the image, the logical, virtual disc (or burned disc) is always identical.

However, the PSIO doesn't use cue sheets for good reason, the CU2 format doesn't include an instruction to generate silence ad hoc for good reason as well, and thus, in order to get the image to work on the PSIO your best bet is to re-create it per Redump methods, or convert/edit it to include the zeroes in the binary file (and thus potentially making it Redump compatible). If that is not an option, Cue2cu2 uses the zero-length pregap trick to at least try and get you something playable on the PSIO. Wether or not that trick works will depend on the individual game in question.
Cue2cu2: A Python script for creating CU2 sheets via the command line on Linux/Mac/Windows.
GitHub / Forum

PSIO wallpaper template in Photoshop format.

User avatar
Takehaniyasubiko
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 3460
Joined: March 13th, 2018, 5:04 am
PlayStation Model: SCPH-1002
Has thanked: 29 times
Been thanked: 18 times

Re: Cue2cu2: A Python script to create CU2 sheets

Post by Takehaniyasubiko » April 13th, 2020, 7:38 am

NRGDEAD wrote: April 13th, 2020, 7:27 am Okay, one last time:
An image is not a disc. And bin/cue is a pretty flexible image format.
It makes no difference for the result, let's call it a virtual disc, wether or not a silent pregap is physically present in the binary or only referenced per PREGAP in the cue sheet:
It's makes a difference for real PS1 hardware. An accurate disc image is a 1:1 representation of the physical disc. That's the entire reason for the existence of Redump: to recreate game discs 1:1 in disc images.

PS1 CD-ROM discs do not use commands to play silence, like a Windows program might do. They need to have physical pregaps on the disc, which are then ripped into accurate disc images.

When a PREGAP command tells a program to add silence, it's not the same as having physical pregaps. PS1 CD-ROMs simply do not work that way. That's why there is something wrong with that Doom Beta 3 cue sheet. It might work perfectly on an emulator, but burning something like that to a physical disc would, in fact, need to add 2 physical seconds of silence. That's why your approach of totally ignoring the pregap in this case is wrong. You're telling PSIO to play the first audio track without a pregap at all, whereas on real hardware it needs 2 seconds of pregap. Inaccuracies like that should not be encouraged. For example, if a game uses fade-in/out effects, removing a pregap would throw off the playback timing.
"Because we don't know when we will die, we get to think of life as an inexhaustible well. Yet everything happens only a certain number of times, and a very small number really. How many more times will you remember a certain afternoon of your childhood, an afternoon that is so deeply a part of your being that you can't even conceive of your life without it? Perhaps four, five times more, perhaps not even that."
- Paul Bowles

User avatar
NRGDEAD
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 1090
Joined: September 22nd, 2017, 3:10 am
I am a: Noob
PlayStation Model: SCPH-1002
Has thanked: 2 times
Been thanked: 8 times

Re: Cue2cu2: A Python script to create CU2 sheets

Post by NRGDEAD » April 13th, 2020, 7:52 am

Did you even read what I wrote?
Takehaniyasubiko wrote: April 13th, 2020, 7:38 am burning something like that to a physical disc would, in fact, need to add 2 physical seconds of silence.
That's exactly what it does and what I repeated like thrice now. Same for a virtual disc. The logical result is identical, regardless of it's representation in the image file(s).

As I also repeated a few times: what Cue2cu2 does is attempt a best effort workaround trick, which may or may not work, and warn the user about it. From the script's perspective, the only other option is to abort.
Michael Scott wrote:You miss 100% of the CU2 sheets you don't convert
- Wayne Gretzky
Cue2cu2: A Python script for creating CU2 sheets via the command line on Linux/Mac/Windows.
GitHub / Forum

PSIO wallpaper template in Photoshop format.

User avatar
Takehaniyasubiko
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 3460
Joined: March 13th, 2018, 5:04 am
PlayStation Model: SCPH-1002
Has thanked: 29 times
Been thanked: 18 times

Re: Cue2cu2: A Python script to create CU2 sheets

Post by Takehaniyasubiko » April 13th, 2020, 8:09 am

NRGDEAD wrote: April 13th, 2020, 7:52 amThat's exactly what it does and what I repeated like thrice now. Same for a virtual disc. The logical result is identical, regardless of it's representation in the image file(s).
You're missing my point all this time.

Burning it to a physical disc would preserve the silence, but using it for a CU2 file does not. Your CU2 is missing the pregap because the pregap02 and track02 strings are identical.

That's why I don't understand why you assumed this is OK when real hardware would have 2 seconds of pregap.
NRGDEAD wrote: April 13th, 2020, 7:52 amFrom the script's perspective, the only other option is to abort.
You can add those 2 seconds of pregap and check if it works because it's possible the disc image for DOOM Beta 3 actually has a pregap and that string in the cue sheet is some kind of a bug/mistake in the tools they used for crating this fan version of the game.
"Because we don't know when we will die, we get to think of life as an inexhaustible well. Yet everything happens only a certain number of times, and a very small number really. How many more times will you remember a certain afternoon of your childhood, an afternoon that is so deeply a part of your being that you can't even conceive of your life without it? Perhaps four, five times more, perhaps not even that."
- Paul Bowles

User avatar
NRGDEAD
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 1090
Joined: September 22nd, 2017, 3:10 am
I am a: Noob
PlayStation Model: SCPH-1002
Has thanked: 2 times
Been thanked: 8 times

Re: Cue2cu2: A Python script to create CU2 sheets

Post by NRGDEAD » April 13th, 2020, 11:22 am

Takehaniyasubiko wrote: April 13th, 2020, 8:09 am Burning it to a physical disc would preserve the silence, but using it for a CU2 file does not. Your CU2 is missing the pregap because the pregap02 and track02 strings are identical.
NRGDEAD wrote: April 13th, 2020, 7:27 am in order to get the image to work on the PSIO your best bet is to re-create it per Redump methods, or convert/edit it to include the zeroes in the binary file (and thus potentially making it Redump compatible). If that is not an option, Cue2cu2 uses the zero-length pregap trick to at least try and get you something playable on the PSIO. Wether or not that trick works will depend on the individual game in question.
Takehaniyasubiko wrote: April 13th, 2020, 8:09 am That's why I don't understand why you assumed this is OK when real hardware would have 2 seconds of pregap.
NRGDEAD wrote: March 16th, 2020, 2:13 pm Cue2cu2 now experimentally "supports" cue sheets that are using the PREGAP command. Not fully, because that would require inserting data to the binary file, which Cue2cu2 can't do. In order to continue and hopefully be somewhat compatible, the pregap position will be the same as the track position. In other words: the pregap will have a length of 00:00:00.
The program will also spit out a warning with a short explanation when encountering the PREGAP command.
This is kind of a last resort; please go for Redump images whenever possible.
Takehaniyasubiko wrote: April 13th, 2020, 8:09 am You can add those 2 seconds of pregap and check if it works
It wont:
  1. PREGAP specifies silence that is to be added ad hoc and thus missing from the binary file. Cue2cu2 can't and won't modify the binary file.
  2. NRGDEAD wrote: April 13th, 2020, 3:19 amSince the pregap is missing, this would put the pregap in the end of the data track, potentially produce audible garbage and might even damage the speakers or playback system. Also might interfere with PSIO's operation when trying to access data on the very end of the data track.
    In other words: the data track would be two seconds short. But since the raw data is still present in the binary file but now used as the pregap for track 2, you now have something in the pregap that is probably not silence.
  3. The workaround seems to work in this case and will probably work in others, but might just as well fail for some or many games. Depends on how the individual game handles it's CDDA tracks.
Takehaniyasubiko wrote: April 13th, 2020, 8:09 am it's possible the disc image for DOOM Beta 3 actually has a pregap and that string in the cue sheet is some kind of a bug/mistake in the tools they used for crating this fan version of the game.
NRGDEAD wrote: April 13th, 2020, 4:43 am I provided three sources which all concur on how the PREGAP command is to be handled, and I see no reason why it should be different in this case.
It's a valid way of having the image, albeit it won't work perfectly on the PSIO without modification as I explained multiple times already.
Even if it were to be a mistake, it would be an isolated case and not representative of all cue sheets with PREGAP commands.
Cue2cu2: A Python script for creating CU2 sheets via the command line on Linux/Mac/Windows.
GitHub / Forum

PSIO wallpaper template in Photoshop format.

User avatar
Takehaniyasubiko
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 3460
Joined: March 13th, 2018, 5:04 am
PlayStation Model: SCPH-1002
Has thanked: 29 times
Been thanked: 18 times

Re: Cue2cu2: A Python script to create CU2 sheets

Post by Takehaniyasubiko » April 13th, 2020, 11:45 am

OK, zredgemz's tests confirmed that this particular Doom Beta 3 disc image was created with no pregap for track02. The game can sometimes freeze if a pregap is artificially added.

It was the right call on your side for Cue2cu2's behavior. :clap
"Because we don't know when we will die, we get to think of life as an inexhaustible well. Yet everything happens only a certain number of times, and a very small number really. How many more times will you remember a certain afternoon of your childhood, an afternoon that is so deeply a part of your being that you can't even conceive of your life without it? Perhaps four, five times more, perhaps not even that."
- Paul Bowles

User avatar
ugol45
BANNED
BANNED
Posts: 1
Joined: March 8th, 2021, 11:26 am
I am a: Gamer, Designer
PlayStation Model: SCPH-5502
Been thanked: 1 time

Re: Cue2cu2: A Python script to create CU2 sheets

Post by ugol45 » March 8th, 2021, 12:10 pm

So hot discussion, guys)

First of all want to say big THANK YOU, NRGDEAD, for cue2cu2.py !!!
As for me - its the only way to make working .cu2 files. No one .cu2 file made by Psio System Console was working correct for me.

I own chinese cloned psio (have bought it fully installed from neighbor, if its interesting for someone). So i made some .cu2 files with cue2cu2.py

For example lets take Twisted Metal 4.
When we start playing on a first map, we hear looped 2 seconds of pregap sound instead of song#1. On the second map we hear song#1 instead of song #2. On 3rd map playing 4th song, 5th map - 6th song, etc. As far as i get, its all about not updated firmware on cartridge. So i have deleted all lines with pregaps in .cu2 and it sounds correct now. (Format revision 1 instead of Format revision 2).

So here is the question.
So i downgrade Format revision 2 to revision 1 .cu2 file. I quite don't understand, do I need to add 2 seconds to "size" line in .cu2 file? And how to calculate correct "trk end" value?

P.S. may be you got cue2cu2.py for a revision 1 .cu2 files? It must be helpful!

User avatar
Matt
Cybdyn Systems - Admin
Cybdyn Systems - Admin
Posts: 4376
Joined: December 31st, 2012, 5:37 pm
I am a: Systems Designer
PlayStation Model: H2700/5502
Location: Australia
Has thanked: 16 times
Been thanked: 60 times
Contact:

Re: Cue2cu2: A Python script to create CU2 sheets

Post by Matt » March 8th, 2021, 5:24 pm

Hope you're enjoying your cloned PSIO. Thanks for the support mate. We've banned your account.
CU2 sheets are not working for you because you're using cloned hardware. Simple.

User avatar
NRGDEAD
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 1090
Joined: September 22nd, 2017, 3:10 am
I am a: Noob
PlayStation Model: SCPH-1002
Has thanked: 2 times
Been thanked: 8 times

Re: Cue2cu2: A Python script to create CU2 sheets

Post by NRGDEAD » March 9th, 2021, 12:09 am

ugol45 wrote: March 8th, 2021, 12:10 pm I own chinese cloned psio (have bought it fully installed from neighbor, if its interesting for someone).
I'm afraid I can't help from this point, either. Please don't buy clones. Always support the creator. They put in a lot of effort to create a cool product, and should be rewarded accordingly. Especially in case where the device is priced very fair, like the PSIO.
Cue2cu2: A Python script for creating CU2 sheets via the command line on Linux/Mac/Windows.
GitHub / Forum

PSIO wallpaper template in Photoshop format.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests