Skip to content
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

VMC has some new problems (maybe start from rev1079) #147

Closed
ckmop opened this issue Oct 1, 2018 · 24 comments
Closed

VMC has some new problems (maybe start from rev1079) #147

ckmop opened this issue Oct 1, 2018 · 24 comments

Comments

@ckmop
Copy link

ckmop commented Oct 1, 2018

Open PS2 loader version

from rev 1079 to rev 1088

Open PS2 loader mode (USB, SMB, HDD)

SMB

Open PS2 type (Normal, Childproof, VMC, GSM, PS2RD)

VMC

Issue description - Describe the problem you are having

I dont know what is exactly wrong but maybe start from rev1079 to rev1088, the VMC has some new problems (all default config except VMC on) :

GRAN TURISMO 4 (SCAJ_300.07) with VMC on(SCAJ_300.07_0.bin), the game freeze at the opening(no memory card detection icon)
Xenosaga Episode 1(SLUS_204.69) with VMC on(SLUS_204.69_0.bin), just black screen, the game wont start.
I remember the older versions dont have these VMC problems.

@rickgaiser
Copy link
Member

I've noticed the same issue. It's caused by d25a8ea.

I'm hoping @sp193 can take a look at it, or otherwise we can revert that commit (git revert d25a8ea).

@sp193
Copy link
Contributor

sp193 commented Oct 1, 2018

Please refer to the head commit, as well as the last comments of pull request #144.

@sp193
Copy link
Contributor

sp193 commented Oct 1, 2018

I don't think the change has anything to do with VMC, however. It was the CDVDFSV service that had its RPC stacks reduced in size, so it prevents bootup of OPL, likely due to a stack overflow.

But if the 4 tests do not help you at all, then it has likely nothing to do that that commit.

@ckmop
Copy link
Author

ckmop commented Oct 1, 2018

Thank you sp193!
I've just tested #148
It has fixed this issue #147
SCAJ_300.07 and SLUS_204.69 run fine with VMC on now.

@ckmop ckmop mentioned this issue Oct 1, 2018
6 tasks
@ckmop
Copy link
Author

ckmop commented Oct 1, 2018

Oh sorry...one more problem
GRAN TURISMO 4 (SCAJ_300.07)
I create a new 8m VMC (SCAJ_300.07_0.bin), all default setting, SMB
GT4 seem start normally, ask me to create a new data, then format the VMC , save, go into game, and I change a few settings and save, IGR quit.
Then I run GT4 again, GT4 doesnt recognize the lastest created save in the VMC, ask me to create a new data again...and again...

@Jay-Jay-OPL
Copy link
Contributor

@ckomp, make sure of two things you give enough time for SMB to release the last session before you try to load the same game again via SMB. Best to IGR back to the PS2 Browser then load OPL after a minute or two has gone by.

@ckmop
Copy link
Author

ckmop commented Oct 1, 2018

@ckmop , make sure of two things you give enough time for SMB to release the last session before you try to load the same game again via SMB. Best to IGR back to the PS2 Browser then load OPL after a minute or two has gone by.

I've played a long time in Gran Turismo 4 with SMB VMC before, it works all good, maybe this problem was caused by recent change in VMC? I cant load my old GT4 VMC save either---GT4 asks me to create new data at beginning too.

@sp193
Copy link
Contributor

sp193 commented Oct 1, 2018

With the recent commits, there should be no need to wait or reboot your SMB server or to restart your PS2 between game sessions. That is the premise behind changes to VMC & IGR.

I find it strange that the game asks you to format the memory card when VMC is used. If I am not wrong, OPL's GENVMC module will format the VMC image. So this might be an indicator that it is unable to read the memory card properly. You should try other games. If no other games have new issues or if the new VMC issues are only affecting SMB mode, then it could be related to a lack of memory under SMB mode.

GT4 is known to require IGR to be disabled, for it to work properly. So you should disable IGR.

@TnA-Plastic
Copy link

I suppose it might need the size of the CDVDFSV-Driver + VMC + the others, or it might decrease the performance or even be incompatible...

@ckmop
Copy link
Author

ckmop commented Oct 3, 2018

With the recent commits, there should be no need to wait or reboot your SMB server or to restart your PS2 between game sessions. That is the premise behind changes to VMC & IGR.

I find it strange that the game asks you to format the memory card when VMC is used. If I am not wrong, OPL's GENVMC module will format the VMC image. So this might be an indicator that it is unable to read the memory card properly. You should try other games. If no other games have new issues or if the new VMC issues are only affecting SMB mode, then it could be related to a lack of memory under SMB mode.

GT4 is known to require IGR to be disabled, for it to work properly. So you should disable IGR.

@sp193
I've disabled IGR for GT4, but the problem is all the same.
OPL SMB, VMC on(SCAJ_300.07_0.bin), GT4 asks me to create a new save data (and later force to format) at beginning everytime.
Howerver, Xenosaga Episode 1(SLUS_204.69) with VMC on(SLUS_204.69_0.bin) works no problem.

@TnA-Plastic
Copy link

Does it still work with a physical MC?!

@carl0sjt
Copy link

carl0sjt commented Oct 8, 2018

Yes. Why it wouldnt?

@TnA-Plastic
Copy link

TnA-Plastic commented Oct 8, 2018

Due to a (possible) memory-overflow on the IOP, it MIGHT overwrite a module and can't read a specific part from the MC, resulting in a request to create a new save...

That's atleast one possible explanation...

@Jay-Jay-OPL
Copy link
Contributor

@TnA-Plastic , yes, that might be worth a test.

I just want to suggest anyone testing if this game loads from a MC, that you backup the MC, since it might format the MC. -- Because it seems that it is what it kind of does with the VMC, but not sure if it's a complete format of the entire VMC or just the space it wants to later drop it's game save?! :(

Plus make sure that your MC on SLOT 1 (mc0:) isn't your FMCB installed MC. Best to always keep your FMCB installed MC on SLOT 2 (mc1:). And leave a normal MC on SLOT 1 for most of your MC Game Saves.

@J013k
Copy link
Contributor

J013k commented Oct 11, 2019

I've still this issue through ETH with e.g. Gran Turismo 3 on r1387.
I mean, after creating VMC, launching game, while I want to save settings
game is prompting me to format MC, I can save game etc.

When I'll launch this game one more time and I want to save I'm still getting message to format MC.

@zappepappe
Copy link

Copy from https://www.psx-place.com/threads/open-ps2-loader-v0-9-3.13415/page-27:

Zarper:

So, hearing that people had issues with VMC in GT3 through SMB I decided it would be fun to bisect the issue... it wasn't.
There seem to have been a lot of issues with VMC at the time that this regression was introduced, making it hard to pin down the exact commit that made it happen.

I'll just present my findings so that anyone that wants to can dig a bit deeper and maybe find something.

These revision are in chronological order, even though the names are a bit off (the auto naming code in OPL is a bit wonky from time to time).
Good indicates a revision that is able to load GT3 with VMC and access the data inside it.
Skip = Not able to load GT3 with VMC.
Bad = Able to load but no data on VMC.

OPL r1173-Beta-7d23b38 - Good
OPL r1174-Beta-8dbaaae - Skip
OPL r1175-Beta-f574ea3 - Skip
OPL r1176-Beta-9272dd9 - Skip
OPL r1177-Beta-6dbfc72 - Skip
OPL r1178-Beta-cd88afc - Skip
OPL r1179-Beta-6ccedb7 - Skip
OPL r1180-Beta-0f59471 - Skip
OPL r1181-Beta-40be3fc - Skip
OPL r1182-Beta-5251100 - Skip
OPL r1183-Beta-d25a8ea - Skip
OPL r1184-Beta-1f793f4 - Skip
OPL r1185-Beta-45049f8 - Skip
OPL r1186-Beta-1cd46b9 - Skip
OPL r1187-Beta-7919818 - Skip
OPL r1188-Beta-ad182dc - Skip
OPL r1189-Beta-5205963 - Bad
OPL r1189-Beta-05d06ad - Skip
OPL r1190-Beta-9df6607 - Skip
OPL r1191-Beta-70fb5f5 - Skip
OPL r1193-Beta-a3e2fe0 - Bad
OPL r1194-Beta-35ffe2a - Bad

Here are all the revisions if anyone would like to try themselves. 

Zarper:

After a bit of trail and error I believe I've found something. I'm not a programmer, so I don't know why it works and if it's wrong/correct.
But adding back
Code:

void DeviceDeinit(void)
{
smb_Disconnect();
}

in "device.smb.c" that was removed in 8dbaaae, VMC starts to work again.

Latest OPL with the line added: https://www.sendspace.com/file/2intcx

sp193:

That line was deleted from this commit because I moved it to deviceUnmount(), which I forgot to call. This was corrected later on.

You need to also check whether the VMC file could be opened by OPL. If it displayed the error message about the VMC file, then the VMC cannot be used in that session.

Before that series of commits, it was also not possible to boot the same game again with VMC, due to OPL not releasing the handle during IGR. 

Zarper:

That was one of the reasons I said it was hard to bisect due to multiple issues with VMC at the same time.

Without "void DeviceDeinit(void){smb_Disconnect();}" GT3 loads fine and there is a MC in slot 1, but it is empty.
With it the game loads fine and the MC has saved data on it.
I provided a build of OPL r1319 with the line re-added to make it easy to test in my previous post. 

@TnA-Plastic
Copy link

This doesn't happen on HDD and USB, but only SMB correct?
The unmount-test is interesting as well, but it seems this might be a a workaround for a bug elsewhere. Weird...

@J013k
Copy link
Contributor

J013k commented Oct 11, 2019

I've only additionally tried GT3 through HDD and everything with VMC was fine.
Tested only 8 MB with r1387.
Settings was loaded, there was no need to format "memory card" after re-launch game.

@zappepappe
Copy link

zappepappe commented Oct 11, 2019

I did a bit more poking around with this and found that if I changed the function inside _shutdown() in cdvdman.c to DeviceUnmount() it worked as well.
Maybe a more correct solution?
ebfabec

@sp193
Copy link
Contributor

sp193 commented Oct 12, 2019

If you must change this, I guess changing the DeviceDeinit() function for SMB would be better because calling a different function from cdvdman_deinit() would be akin to changing the meaning and purpose behind these functions.

Since cdvdman_deinit is called during module shutdown, I guess it could have something to do with the game doing an IOP reboot. But I had concerns that closing the connection from this function would not work, due to the interrupt context. Apparently not.

@zappepappe
Copy link

Any idea why only the VMC/SMB combo would have this problem?

@zappepappe
Copy link

So I made another patch with the previously found fix of putting smb_Disconnect() back into SMB DeviceDeinit().
Is that enough to make a pull request, or does it need anything else?
1b22941

@sp193
Copy link
Contributor

sp193 commented Oct 13, 2019

If you are going to do that, why not copy both calls to smb_CloseAll() and smb_disconnect() to DeviceDeinit()? Or maybe just call DeviceUnmount() from DeviceDeinit().

There may be a need to alter smb_CloseAll and smb_disconnect to avoid double execution over the file descriptors.

As for why it only matters for SMB, maybe it is because this is SMB and it has different code for supporting the protocol. If it is caused by a sudden IOP reset, it may be encountering a data loss due to the reboot.

@zappepappe
Copy link

zappepappe commented Oct 13, 2019

I did try with both smb_CloseAll() and smb_Disconnect() in DeviceDeinit(). But as I couldn't see a difference while testing, the original DeviceDeinit() only used smb_Disconnect(), not being entirely sure exactly what the functions do and wanting to change the code as little as possible. I decided to just add smb_Disconnect() back. Would there be a benefit having both?

If it isn't obvious already, I'm not a coder. I know a bit of command line and can with a bit of fiddling get git to do mostly what I need. Maybe force something to compile after altering something (!=fix). Anything more involved and I basically have no clue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants