PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.83k stars 1.63k forks source link

Test Drive: IPU hang in middle of Event 5 #1863

Closed MrCK1 closed 3 years ago

MrCK1 commented 7 years ago

PCSX2 version: PCSX2 1.5.0-20170315183046 - compiled on Mar 15 2017

PCSX2 options: Defaults, SkipMPEG hack and EE cyclerate -3 (for loading screen) - testing with normal cyclerate still had no effect

Plugins used: Defaults

Description of the issue: Game hangs in middle of Event 5 while driving.

How to reproduce the issue: Start Event 5, game will hang at the 2nd police roadblock.

Last known version to work: Unknown

PC specifications: i5-6600k@4.7Ghz, GTX 1070 SC, Windows 10 64-bit

Emulog: http://pastebin.com/zPY1uXbR

FlatOutPS2 commented 7 years ago

Disable the SkipMPEG hack then try again.

MrCK1 commented 7 years ago

@FlatOutPS2 Disabling it had no effect, it still hangs in the same place.

prafullpcsx2 commented 7 years ago

A memory card save before event 5 and a savestate before the hang point may prove useful.

MrCK1 commented 7 years ago

I'll have to post them in a few hours. Right now I need my beauty rest ;)

MrCK1 commented 7 years ago

@prafullpcsx2 @FlatOutPS2 Here's the memory card before and a savestate during event 5. (rename to .7z)

testdrive_ipuhang.pdf

FlatOutPS2 commented 7 years ago

I have no use for those. :p I did manage to reproduce the issue with the PAL version.

prafullpcsx2 commented 7 years ago

I can't manage to reproduce the issue with my US version. Loaded the memory card save, started event 5, cleared it in one go and reached event 6.

MrCK1 commented 7 years ago

The game chugs a little further when using "Ignore DMAC writes when it is busy" but still freezes shortly after the checkpoint behind the police cars. The debug logs so far don't show anything blatantly wrong either 😛

MrCK1 commented 7 years ago

@prafullpcsx2 What US disk do you have (SLUS-XXXXX) and what settings did you test with? Unless the issue is somehow bios related, it seems odd that you are the only one who can't reproduce it.

MrCK1 commented 7 years ago

Quick update on this - it seems that IPU_CTRL is getting stuck sending a continuous busy signal, causing the hang. I'll post a log later.

prafullpcsx2 commented 7 years ago

@MrCK1 Mine is also 202.13 and your memory card save loads fine with that. I was using default settings to test it but I had skipmpeghack enabled. Will try again after disabling that and see if I can reproduce the issue.

MrCK1 commented 7 years ago

@prafullpcsx2 @refractionpcsx2

void SetBusy(bool busy=true)
    {
        BUSY = busy ? 0x80000000 : 0;

According to IPU.h, 0x80000000 is equivalent to a busy signal right?

Here's the full log: https://pastebin.com/7qVtEeVQ

End portion where the hang occurs.

eReg(001b47e4 1b33382a): HwWrite32    @ 0x10002000/IPU_CMD          <- 0x40000000
IPU (001b47e4 1b33382a): write32: IPU_CMD=0x40000000
IPU (001b47e4 1b33382a): FDEC command. Skip 0x0 bits, FIFO 0x0 qwords, BP 0x0, CHCR 0x30000005
eReg(001cd998 1b333835): HwRead32     @ 0x10002010/IPU_CTRL         -> 0x80000000
IPU (001cd998 1b333846): ipu0Interrupt: 1b333846
eReg(001cd998 1b333846): HwRead32     @ 0x10002010/IPU_CTRL         -> 0x80000000
IPU (001cd998 1b33384e): ipu1Interrupt 1b33384e:
IPU1 running when IPU1 DMA disabled! CHCR 30000005 QWC 0
eReg(001cd998 1b33384e): HwRead32     @ 0x10002010/IPU_CTRL         -> 0x80000000
IPU (001cd998 1b333886): ipu0Interrupt: 1b333886
eReg(001cd998 1b333886): HwRead32     @ 0x10002010/IPU_CTRL         -> 0x80000000
eReg(001cd998 1b3338b0): HwRead32     @ 0x10002010/IPU_CTRL         -> 0x80000000
IPU (001cd998 1b3338c6): ipu0Interrupt: 1b3338c6
eReg(001cd998 1b3338c6): HwRead32     @ 0x10002010/IPU_CTRL         -> 0x80000000
prafullpcsx2 commented 7 years ago

@MrCK1 Can you please also make a separate gsdx HW issue from this game? when ingame press start and menu text is invisible. It becomes visible with preload data frame but font is messed up.

FlatOutPS2 commented 7 years ago

@prafullpcsx2 https://github.com/PCSX2/pcsx2/issues/1739 issue already exists. ;)

FlatOutPS2 commented 7 years ago

@MrCK1 Can you try event 5 with this:

MrCK1 commented 7 years ago

@FlatOutPS2 It works great but there's a bit of stutter while driving now (drops to 40s/30s, but that might be due to high drawcalls on the GS and unrelated to this) - one of which was at the point where the game used to freeze. Did it end up being an IPU issue after all? An interesting thing to note is that these billboards are no longer corrupt upon approach in the patched .exe.

Edit: Right now on the same track, sometimes I encounter points where the game locks up/core usage goes to 0 for a few seconds and then resumes without a problem

Before: gsdx_20170421203206

After: gsdx_20170421203324

prafullpcsx2 commented 7 years ago

I tried every possible setting but I can't reproduce the hang issue (with or without skipmpeg). Also the billboards were never corrupt for me. I checked the crc and mine is different than yours so most probably all these issues are related to specific version of the game.

MrCK1 commented 7 years ago

@FlatOutPS2 Any status on this, or will a PR be in the works later?

FlatOutPS2 commented 7 years ago

Any status on this, or will a PR be in the works later?

I still need to do some work on the code, and then test it on a couple of games. Once that's done I'll make a PR.

The short lock ups you experienced are likely caused by my fix, I had one of those too at some point. The file I posted was an early hacky fix just meant to confirm if it worked for you too. I've not experienced the issue since I made a better version of the fix.

MrCK1 commented 7 years ago

OK. Unless you already fixed it, there is also corruption for a brief second before the first Atari FMV starts.

MrCK1 commented 7 years ago

@FlatOutPS2 any update on the this "patch" so far? A 1.6 release target would be nice :P

MrCK1 commented 6 years ago

@FlatOutPS2 when you get a chance, can you post a new URL or make a quick PR so I can test this code again? I'd like to look at other games with IPU problems.

FlatOutPS2 commented 6 years ago

@MrCK1 It would be better if you could make a blockdump for a couple of those games so I can look into fixing those along with this issue.