OPL (Open PS2 Loader)

PS2 Open PS2 Loader v1.1.0

I backported the changes, but could not get it to work with decent performance, without adjusting SMSTCPIP. The current parameters seemed to somehow allow OPL to work around the Windows TCP congestion control algorithm.
Well, at least I think it is because my PC will wait for a TCP window update by the PS2, whenever the receive window reaches 2200/5120. :(

Once I set the TCP receive window to 16384 and gave it 16 PBUFs, I could watch the Valkyrie Profile 2 OP without any pauses.
Unfortunately, there is an interest in using as little memory as possible and increasing just the TCP window doesn't work. Likely because the frames come really quickly, and then they get dropped when no PBUFs are available.

I also applied the OPL workaround for the Windows TCP congestion algorithm by receiving operations to 8192 bytes, while keeping the TCP receive window ahead at 10240 bytes. I guess, it's still an improvement? lol
Writing is still "unlimited" at 65535 bytes per chunk.

To make up for this slight increase in memory usage, I also removed the functions that OPL does not require.

I realized that I don't understand the relationship between CDVDFSV_BUF_SECTORS and CDVDMAN_FS_SECTORS. I've forgotten what it was about, what the +2 was for.
Since I could not find an explanation for it, I consolidated these 2 into one definition. Some testing should be done because I really don't know why I had this +2 sectors in the first place. I guess, it was for an earlier design of OPL or there was a mistake in CDVDFSV.

Test build: https://www.sendspace.com/file/wimba1
Branch: https://github.com/sp193/Open-PS2-Loader/tree/smb-update

Even with the latest commit I still have games missing. I don't have many games on my share since I usually use HDD, but the once I have that are missing are modified/translated games. However they work on prior revisions and on USB, so it shouldn't be the games.

EDIT: It seems to occur when there are more than one entry with the same GAME ID.

Unfortunately, I seem to have misinterpreted the meaning of the filename length field. It's in bytes, not characters.
Somehow it worked, but wasn't working properly. It should be fine now.

There's also this glitch within OPL's ISOFS module, causing mounting to always fail once it has failed once. It's because the file descriptor is never marked as available again, once if mounting failed once.

If you're able to get an increase of speed by sacrificing a bit of memory, couldn't it become a MODE? Or is the new code with larger buffers still not faster than current code?

Most of these network stack options are not configurable during runtime. So I would need to duplicate SMSTCPIP and CDVDMAN again, which will increase the code size by another 200KB or something.
I'm trying to not increase the number of compatibility modes because entertainment should be hassle-free and fun.

Whether it's faster or not... I don't really know. Logic dictates that it should be better. But the IOP is too restrictive and we're trying to save memory, a bit too hard. I'm hoping that it'll actually work out this time.

I was playing some Ps1 games with the last Ps2-Home DB… I was playing it from USB (POPS games too are on USB HDD), when I IGR from POPS it starts OPL ifcaro build ('cause I've it in BOOT folder, named as BOOT.ELF) and it couldn't load my iHDD game-list.

After a couple seconds, it loop on the loading icon, exactly as it used to do when IGResetting from some Ps2 games (like Ace Combat).

I wonder if listing POPS games as APPS, then IGResetting it would happen the same problem.

Do you have USB mode set to AUTO? If yes, then it is possible that your USB device has become unresponsive.
PS2 apps have full control over the PS2, so this may be a POPS problem. This may happen if transfers are interrupted.
 
Do you have USB mode set to AUTO? If yes, then it is possible that your USB device has become unresponsive.

Yes, but it seems to response. I think the problem is having the iHDD set to Auto. Indeed it start spinning, then after the usual 4 secs the orange light blink, the OPL loading icon freezes a little, then resumes to rotate again in a infinite loop (I need to hard power off the Ps2).

Maybe IGResetting from a POPS game cause a problem similar to the one when IGResetting from some Ps2 games (like Ace Combat 5) that you solved.

I'll do more tests, since I was doing cross tests between OPL_DBS and ifcaro builds for other purposes, I noticed this thing just for a coincidence.
 
Maybe IGResetting from a POPS game cause a problem similar to the one when IGResetting from some Ps2 games (like Ace Combat 5) that you solved.

So are you still having problems with IGR and some games? If not, then this is a POPS problem, which should be corrected by POPStarter.

The IGR feature of POPS works differently, as it is an emulator. It has full control over the PS2.
 

I also applied the OPL workaround for the Windows TCP congestion algorithm by receiving operations to 8192 bytes, while keeping the TCP receive window ahead at 10240 bytes. I guess, it's still an improvement? lol
Writing is still "unlimited" at 65535 bytes per chunk.

To make up for this slight increase in memory usage, I also removed the functions that OPL does not require.

I realized that I don't understand the relationship between CDVDFSV_BUF_SECTORS and CDVDMAN_FS_SECTORS. I've forgotten what it was about, what the +2 was for.
Since I could not find an explanation for it, I consolidated these 2 into one definition. Some testing should be done because I really don't know why I had this +2 sectors in the first place. I guess, it was for an earlier design of OPL or there was a mistake in CDVDFSV.

Test build: https://www.sendspace.com/file/wimba1
Branch: https://github.com/sp193/Open-PS2-Loader/tree/smb-update
So far i am having a smoother experience. I had pratically no stuttering in Kingdom Hearts 2' FMVs now.
 
  • Fixed streaming callback potentially executed with a NULL-pointer, due to the pointer getting changed between function calls.
  • CDVDMAN: consolidated CDVDFSV_BUF_SECTORS and CDVDMAN_FS_SECTORS, for clarity. CDVDMAN_FS_SECTORS is now set to 8 and CDVDFSV will read up to CDVDMAN_FS_SECTORS sectors per chunk. When the buffer is not aligned, then it will use 1 sector for alignment correction. This is higher than previously because I don't know why we only used 7/8 sectors...
  • Added patch for Harvest Moon: A Wonderful Life
  • padhook: changed Hook_scePad2CreateSocket() to always check and install IGR if SockParam is null (which is optional). This replaces the incomplete patch from 541d270.
  • padhook: do not create padhook thread & interrupt handler in duplicate. Thread will now be installed either at the IOP reboot or when the padhook is triggered, whichever comes first. This will allow the power button to always be used for IGR, even if libpad cannot be located due to the game being protected in some way (i.e. Tekken 5).
  • ISOFS: Fixed iso: being stuck in an opened state, if the file cannot be opened for mounting.

Indeed I pointed this out on Ps2-Home, since they have the integrated Ps1 page: http://www.ps2-home.com/forum/viewtopic.php?f=19&t=7140
This is starting to sound like the issue with OPL's IGR not erasing memory before loading the ELF...

@krHACKen: Does POPStarter erase memory before loading the ELF with SifLoadElf, during the IGR process? If not, it may result in some undefined behaviour. As you have noted before, SifLoadElf does not seem to erase memory that should be erased.
 
  • Fixed streaming callback potentially executed with a NULL-pointer, due to the pointer getting changed between function calls.
  • CDVDMAN: consolidated CDVDFSV_BUF_SECTORS and CDVDMAN_FS_SECTORS, for clarity. CDVDMAN_FS_SECTORS is now set to 8 and CDVDFSV will read up to CDVDMAN_FS_SECTORS sectors per chunk. When the buffer is not aligned, then it will use 1 sector for alignment correction. This is higher than previously because I don't know why we only used 7/8 sectors...
  • Added patch for Harvest Moon: A Wonderful Life
  • padhook: changed Hook_scePad2CreateSocket() to always check and install IGR if SockParam is null (which is optional). This replaces the incomplete patch from 541d270.
  • padhook: do not create padhook thread & interrupt handler in duplicate. Thread will now be installed either at the IOP reboot or when the padhook is triggered, whichever comes first. This will allow the power button to always be used for IGR, even if libpad cannot be located due to the game being protected in some way (i.e. Tekken 5).
  • ISOFS: Fixed iso: being stuck in an opened state, if the file cannot be opened for mounting.

There's already a test build??

This is starting to sound like the issue with OPL's IGR not erasing memory before loading the ELF...

Yes, after IGResetting with POPS, OPL fail to load the games.bin file from the iHDD. I and another guy experienced this.

However the main problem of PS2-HOME DBs is that the Ps1 page has not been correctly integrated with the new function that makes the HDD to spindown when accessing a APP.

If the APP is into the HDD the HDD shouldn't spindown, right??

However when you boot a POPS game from Ps1 page, OPL_DB, doesn't recognize from where POPS is started and make the HDD to spindown. Then POPS make the HDD to spinup again. This is not a healthy thing for the HDD to spin up and down after every POPS IGR (it spindown every time a Ps1 game is booted).
 
i've just tested the latest test build and there's an improvement in FMV playback trough SMB for example SLUS_216.78 DBZ budokai tenkaichi 3 with the the previous OPL the bandwith in the intro FMV was about 9.0 Mbps now with the latetst test build is around 11.0 Mbps wich allows this game's FMV to play at full speed.
however i noticed that for some reason the PS2 LOGO at game boot is corrupted? for some reason second half is black letters in a white background after that everything else seems fine does anyone else has this ?
 
so after further testing not everything is fine, VMC now doesnt save there's simply no network activity but it isnt corrupting the VMC either when the console is in this state IGR wont work, pressing the power/reset button on the console (on a FAT) will just freeze the game and or console i know this because before the button press icon animation in the game is still going until i press the button after that it has to be a hard shutdown by holding the power button.
 
From the time that feature was added, the PlayStation 2 logo never got displayed properly on my SCPH-15000. For one reason or another.

I guess, it could be because this earlier PS2's PS2LOGO did not have the buffer aligned to an address aligned to a 64-byte boundary. Due to the alignment correction algorithm, the lower half of the logo is not unscrambled properly (reading is skewed and overlapped).

so after further testing not everything is fine, VMC now doesnt save there's simply no network activity but it isnt corrupting the VMC either when the console is in this state IGR wont work, pressing the power/reset button on the console (on a FAT) will just freeze the game and or console i know this because before the button press icon animation in the game is still going until i press the button after that it has to be a hard shutdown by holding the power button.

The write function had some incomplete change, which I have just completed. But I can't and won't test this.
It should work because the function is the same as the one from the PS2SDK. Well, it's not a copy because I had to manually edit everything, due to the whitespaces also being different.
 
Last edited:
I've tested new PRs and SMSTCPIP - LWIP patch backports seems to be causing games to get stuck at pink screen ( magenta Before SifInitRpc ? )...
I've attached 2 OPL versions compiled with and without PR#195
-----
IGR is fine now with Splinter Cell franshise' network portion
-----
SMB Update working great.
-----
And maybe 6d4af30 changes to cdvdfs broke Ratchet & Clank 3/Up Your Arsenal again? It was ok up to d062a18
-----
Also, i had problems with VMC, i had to disable it for Tourist Trophy, otherwise console freezes... GTA:SA, Hitman Blood Money VMC tested and theyre okay.
 

Attachments

Last edited:
I've just tested the latest OPL from the build bot its 1343 commit 6836e5e and now it appears that no game loads through SMB dont even get PS2 logo can anyone else confirm ?
 
@sp193

I tested Ridge Racer V from USB with PS2ESDL.

You explained why this game has audio issues from USB and even SMB with OPL, but I can't find the post…

However sure it's not a reading speed problem. Playing the game with PS2ESDL the main menu music is the same as playing with OPL from the iHDD (maybe even a little better), almost perfect.

How it's possible to have so better performance from USB (PS2ESDL) than SMB (OPL)??
It seems some OPL software limit related to this game in particular.
 
However sure it's not a reading speed problem. Playing the game with PS2ESDL the main menu music is the same as playing with OPL from the iHDD (maybe even a little better), almost perfect.
So confusing!

What do you mean by "a little better" and "almost perfect"? To begin with, it should be perfect from iHDD, just like from the retail disc. Your post suggests it's not right even via iHDD.
How it's possible to have so better performance from USB (PS2ESDL) than SMB (OPL)??
The SMB code is dumpster fire. PS2 was never designed for this. It was a kind of dirty hack that allowed it to work, but it's fundamentally wrong in a few ways and people shouldn't expect it to perform like iHDD, or even USB storage.
 
Last edited:
I don't know what you guys are talking about. I only just touched Ridge Racer V recently.

The "low performance" you guys keep bringing up, is caused by the patch we apply to keep the game working. The game is flawed and it was a miracle that it even worked in the first place.
I do not have a patch that will correct the actual problem that the game has...

The only reason why the patch has not been applied to every method of playing games yet, is because I know people will nitpick, for one reason or another.

SMB support is a dumpster fire, I agree. But not for the same reason.
The code we always had, was just not of stellar quality. There are too many problems and options to adjust. Without a DTL-T10000, it is also nearly impossible to debug network-related problems, nevermind if you even know where to look.

We have been also working around the Windows TCP congestion avoidance algorithm, by limiting the transfer length to be lower than the TCP receive window. All the weird and undocumented things that were done, all acting like potential landmines to people who try to work on it.
 
I don't know what you guys are talking about.
The same thing here, dude. The last time I checked (back on 0.9.2), RRV played perfectly from iHDD. Now I'm reading something about the music not being right even via iHDD. What? The game had no performance issues from iHDD. It played like a dream.
SMB support is a dumpster fire, I agree. But not for the same reason.
Seems like the same reason, though. Basically, PS2 wasn't designed for it and the code was created in a messy way.
 
But, v0.9.2 is really, really old. We have at least a thousand commits made ever since...
If you want utmost performance, you need the equipment to tune it and the code has to be designed to work with the peripherals, a concept that we are breaking with OPL.

Performance is a complicated matter, and I alsl dare say that this game was not very well made to begin with. There are many calls to FlushCache. Either because they were trying to fix the cache coherency problem or they had no idea that abusing FlushCache is bad.
 
But, v0.9.2 is really, really old. We have at least a thousand commits made ever since...
Of course, but if any commit had actually broken this game, then it's absurd. High-profile games like this should have priority for fixes and we shouldn't even have commits which cripple game performance.
Performance is a complicated matter, and I alsl dare say that this game was not very well made to begin with. There are many calls to FlushCache. Either because they were trying to fix the cache coherency problem or they had no idea that abusing FlushCache is bad.
RRV was actually praised as one of the best-performing PS2 games on launch. Even to this day, it's impressive that PS2 can handle this game at 60 FPS. Namco did a lot of tuning for it.
 

Similar threads

Back
Top