PCSX2 / pcsx2

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

[BUG - IPU]: Harry Potter the Half Blood Prince - FMV freezing issue. #6271

Open ghost opened 2 years ago

ghost commented 2 years ago

Describe the Bug

In the game Harry Potter the Half Blood Prince, there are multiples FMVs that plays right when selecting the language (French here). When running the game through the emulator, the introduction FMV will manifest weird freezing behaviours.

There are 4 main symptoms:

1 - The FMV can stop itself in any given moment while printing a "FMV ended" (emulator related log) message in the console log.

2 - The EA's custom IPU library will crash on its own with a full blockdump printed in the console log with all the EE's DMA states!

3 - The game TLB miss randomly while starting any given FMV.

4 - The FMV will stutter badly and tears.

Something worth mentioning, all the games using this custom IPU library will manifest the same problem to various degrees:

Reproduction Steps

Load any of the games mentioned earlier, test these, multiple times over, and you will experience a crash at any given time when the IPU library is used.

I will include a blockdump with a savestate for ease of testing.

Expected Behavior

The FMVs in all the games mentioned earlier should play with no issues and at the correct speed, like they does on real hardware.

PCSX2 Revision

v1.7.2834

Operating System

Windows 11

If Linux - Specify Distro

No response

CPU

Intel I9 9900k

GPU

Nvidia RTX 3070

GS Settings

No response

Emulation Settings

No response

GS Window Screenshots

This is a short video of the intro FMV of HP Half Blood to demonstrate the issue within a short clip (the FMV stutters and is as a whole, unstable):

https://user-images.githubusercontent.com/105116470/170889428-56ac03cf-0584-490c-bf1e-d851bd9d729b.mp4

Logs & Dumps

Harry Potter et le Prince de Sang Mêlé (blockdump for broken EA IPU library).zip

refractionpcsx2 commented 2 years ago

does adjusting the EE cycle rate have any impact?

prafullpcsx2 commented 2 years ago

force gif path 3 hack fixes order of the phoenix. Can you try it with this game also to check if it helps?

ghost commented 2 years ago

I can't find the force gif path 3 hack in the list:

image

prafullpcsx2 commented 2 years ago

Emulate Gif fifo

ghost commented 2 years ago

That hack doesn't improve the videos with the Half Blood Prince (nor Hasbro Family Game Night or even Trivial Pursuit).

refractionpcsx2 commented 2 years ago

the EE Timing Hack seems to fix the videos for me on this. The game reports a DMA crash otherwise, but I have no idea why it's reporting it, since the DMA looks to be in a good state? (SIF0 is supposed to stay enabled)

`FMV ended


DMA Crash

General DMA state:

DMA enabled
DMA transfer enabled
Cycle-stealing off
FIFO off
Stall control source unspecified
Stall control drain unspecified
Release cycle 8
DMA Stall interrupt disabled (interrupt state clear)
MFIFO empty interrupt disabled (interrupt state clear)
BUSERR interrupt clear
Stall address 0x00000000

Channel 0 - VIF0

Channel stopped
Channel interrupts disabled (interrupt state set)
Chain mode
Transfer address 0x0054d7e0
Tag address 0x0054d7d0
Transfer size 0 QWs
TTE enabled
TIE disabled
Last tag was 0x7000
No addresses on stack

Channel 1 - VIF1

Channel stopped
Direction to memory
Channel interrupts enabled (interrupt state clear)
Chain mode
Transfer address 0x009e4420
Tag address 0x009e4400
Transfer size 0 QWs
TTE enabled
TIE enabled
Last tag was 0x7000
No addresses on stack

Channel 2 - GIF

Channel stopped
Channel interrupts disabled (interrupt state set)
Chain mode
Transfer address 0x009e43c0
Tag address 0x009e43a0
Transfer size 0 QWs
TTE disabled
TIE disabled
Last tag was 0x7000
No addresses on stack

Channel 3 - fromIPU

Channel stopped
Channel interrupts disabled (interrupt state set)
Normal mode
Transfer address 0x00003600 (scratchpad)
Tag address 0x00000000
Transfer size 0 QWs
TTE disabled
TIE disabled
Last tag was 0x0000

Channel 4 - toIPU

Channel stopped
Channel interrupts enabled (interrupt state clear)
Chain mode
Transfer address 0x016c0730
Tag address 0x0170ea90
Transfer size 0 QWs
TTE disabled
TIE disabled
Last tag was 0x0000

Channel 5 - fromSIF0 [running]

Channel running
Channel interrupts enabled (interrupt state clear)
Chain mode
Transfer address 0x00720e60
Tag address 0x00000000
Transfer size 0 QWs
TTE disabled
TIE enabled
Last tag was 0x0000

Channel 6 - toSIF1

Channel stopped
Channel interrupts disabled (interrupt state set)
Chain mode
Transfer address 0x007366f0
Tag address 0x00021440
Transfer size 0 QWs
TTE disabled
TIE enabled
Last tag was 0x0000

Channel 7 - SIF2

Channel stopped
Direction from memory
Channel interrupts enabled (interrupt state clear)
Normal mode
Transfer address 0x00000000
Tag address 0x00000000
Transfer size 0 QWs
TTE disabled
TIE disabled
Last tag was 0x0000

Channel 8 - fromSPR

Channel stopped
Channel interrupts disabled (interrupt state set)
Normal mode
Transfer address 0x009dddc0
Tag address 0x00000000
Scratchpad address 0x000004d0
Transfer size 0 QWs
TTE disabled
TIE disabled
Last tag was 0x0000

IPU state :

IPU is idle
1 QWs in input FIFO
0 QWs in output FIFO
1 QWs in internal buffers
Error code not detected
Start code not detected
Bitstream is MPEG 2
Frame type is B-frame

`

mrjaredbeta commented 1 year ago

Here are some patches that break out of the false DMA crash loop to continue the FMVs normally. I originally made these for PS3's ps2_netemu, but figured I should post them here:

Harry Potter and the Order of the Phoenix SLUS-21619, SLKA-25271 patch=1,EE,003320c4,double,10000009 SLES-54778, SLES-54779 patch=1,EE,00335e9c,double,10000009

Harry Potter to Fushichou no Kishidan SLPM-66886 patch=1,EE,00337da4,double,10000009

Harry Potter and the Half-Blood Prince SLUS-21808, SLES-55248, SLES-55249 patch=1,EE,004462bc,double,10000009