ppsspp icon indicating copy to clipboard operation
ppsspp copied to clipboard

The Warriors freezes / has video sync problems in all videos after #8867

Open LunaMoo opened this issue 8 years ago • 26 comments

Someone wrote that game get's stuck at logo in 1.3, so I checked, goes to 0/0 fps at the start of short video/animated logo, audio of this video still plays, but nothing happens after that. Refreshing the screen by pause/unpause will show black screen with 60/60 fps.

There are 2 differences between working and freezing in the log, one of them is new warning when it freezes:

W[ME]: HLE\sceMpeg.cpp:1667 Audio end reach. pts: 423617 dts: 327327

another is:

25:13:621 readThread   I[KERNEL]: HLE\sceKernelThread.cpp:2119 sceKernelExitThread(0)
25:13:644 user_main    I[ME]: HW\MediaEngine.cpp:86 FF: deprecated pixel format used, make sure you did set range correctly
25:13:645 user_main    I[ME]: HW\MediaEngine.cpp:86 FF: No accelerated colorspace conversion found from yuv420p to rgba.

where in earlier/working builds this thread exit was after those 2 info lines.

Both logs ~ https://gist.github.com/LunaMoo/64d78e7a55f20bf89f7d5b0d3a2a197b and in case it's any useful debug logs ~ http://www.mediafire.com/download/uzx387yf7dpd8x6/the+warriors+ppsspplog.7z

Update: as mentioned in the discussion below - https://github.com/hrydgard/ppsspp/pull/9014/commits/f70f05668fc419dc241eaaf44c64e6cd68a1f9e6 helps a bit, movies are still freezing, just not permanently.

LunaMoo avatar Sep 18 '16 17:09 LunaMoo

Just to be sure, can you check which commit introduced the change? I'm guessing dcc2541b7192b63bf46541065d8ba071eab00bbe.

Maybe this is a timing thing that was just accidentally working. But the difference in logging is because it's not decoding as early yet, until it has the data. I guess the most likely thing is that it's waiting incorrectly long now...

-[Unknown]

unknownbrackets avatar Sep 18 '16 17:09 unknownbrackets

Well it wasn't that one, will update when I find the culprit. Edit: it's https://github.com/hrydgard/ppsspp/pull/8867/commits/558b4620e8643ef46c1bf0d45cba5eae75e26860

LunaMoo avatar Sep 18 '16 17:09 LunaMoo

Does it help to reapply c03f6c23ed4958e95f931c38f0eaf35597fca1ba?

-[Unknown]

unknownbrackets avatar Sep 24 '16 22:09 unknownbrackets

Kind of ~ doesn't freeze anymore, but the FPS get all wrong with it, jumping between 0/0 and 30/30 while the movies are playing. Edit: Such jumping of fps is normal for static loading screens in this game, and it still exits thread earlier than in older/working versions, so still seems to be the timing issue.

LunaMoo avatar Sep 24 '16 23:09 LunaMoo

Well, 0/0 means that nothing is being drawn to the screen. Many games do that during loading screens.

In an earlier version, this would cause us to "fast forward". The problem is, sometimes games would play music and sound effects during this loading period - and so that audio would also fast forward. So now we delay, but we show 0/0 to indicate that we've literally rendered 0 frames in this second.

I wonder how it was working before without that commit, though. Hmm.

-[Unknown]

unknownbrackets avatar Sep 25 '16 00:09 unknownbrackets

In case I wasn't clear by jumping fps, I ment the movie constantly pauses in rather annoying way every few frames, maybe every second which is exactly how loading screens that come after videos does behave. Suspect it's using wrong thread and that's why sets fps in weird ~ loading screen ~ way when it shouldn't. Still much better than just hanging there.

LunaMoo avatar Sep 25 '16 02:09 LunaMoo

Ah. So the timing was also fine before #8867?

-[Unknown]

unknownbrackets avatar Sep 25 '16 02:09 unknownbrackets

Yes, videos ran at 30/30 without any problems.

LunaMoo avatar Sep 25 '16 02:09 LunaMoo

@LunaMoo Can you try to apply the mpeg hang code fix to find out which commit break the timing ?

sum2012 avatar Sep 25 '16 03:09 sum2012

As mentioned earlier everything started from https://github.com/hrydgard/ppsspp/pull/8867/commits/558b4620e8643ef46c1bf0d45cba5eae75e26860 new fix doesn't change timing from the broken version.

One interesting thing I just noticed observing longer videos ~ here's broken:

52:56:807 user_main    I[ME]: HW\MediaEngine.cpp:86 FF: deprecated pixel format used, make sure you did set range correctly
52:56:808 user_main    I[ME]: HW\MediaEngine.cpp:86 FF: No accelerated colorspace conversion found from yuv420p to rgba.
53:00:286 user_main    W[ME]: HLE\sceMpeg.cpp:1671 Audio end reach. pts: 406898 dts: 1081080
53:13:727 readThread   I[KERNEL]: HLE\sceKernelThread.cpp:2120 sceKernelExitThread(0)

meanwhile when it's working

57:35:048 readThread   I[ME]: HW\MediaEngine.cpp:86 FF: deprecated pixel format used, make sure you did set range correctly
57:35:049 readThread   I[ME]: HW\MediaEngine.cpp:86 FF: No accelerated colorspace conversion found from yuv420p to rgba.
58:19:201 readThread   I[KERNEL]: HLE\sceKernelThread.cpp:2119 sceKernelExitThread(0)

so matter less when it ends,MediaEngine stuff runs(?) of user_main thread instead of readThread as it should? (That was also primary difference for intro video that I posted logs for earlier, didn't notice concentrating on time:|)

LunaMoo avatar Sep 25 '16 05:09 LunaMoo

So even if you checkout 558b462 where it's broken, and apply the fix there, the timing is already broken? Is there any other part of that commit you can revert to make the timing work again? I'm not sure how it would affect timing...

-[Unknown]

unknownbrackets avatar Sep 25 '16 05:09 unknownbrackets

Yeah that's what I'm saying, just tested again to be sure, that commit + new fix = same result as latest with that fix.

I failed to see what's causing it exactly earlier, but had some luck this time - works again by restoring: two lines here https://github.com/hrydgard/ppsspp/commit/558b4620e8643ef46c1bf0d45cba5eae75e26860#diff-d75a9bd0fb70784215db5632c8b16019L357 another two here https://github.com/hrydgard/ppsspp/commit/558b4620e8643ef46c1bf0d45cba5eae75e26860#diff-d75a9bd0fb70784215db5632c8b16019L293 and forcing bool MediaEngine::SetupStreams() to always return false or remove the check to fallback to old behaviour / restoring this https://github.com/hrydgard/ppsspp/commit/558b4620e8643ef46c1bf0d45cba5eae75e26860#diff-d75a9bd0fb70784215db5632c8b16019L265

Trying those 3 changes separately still results in broken timing/pauses in the video. :| Edit: also keeping https://github.com/hrydgard/ppsspp/commit/558b4620e8643ef46c1bf0d45cba5eae75e26860#diff-d75a9bd0fb70784215db5632c8b16019R399 while restoring only the other two, corrects timing, but breaks the start of each video that ends up black screen.

Edit: Not sure if that will be of any help, but a screenshot of the header from logo pmf: thewarriors logo other video files in this game only change data size, duration and something at 0x76 which I don't know what it is(and yes they all suffer from this issue).

LunaMoo avatar Sep 25 '16 06:09 LunaMoo

Not sure what's wrong, but that just goes back to FFmpeg misparsing the first few frames sometimes. Maybe we're missing something when initializing the stream, or maybe it was accidentally working when it was dropping some frame early on due to the parsing...

-[Unknown]

unknownbrackets avatar Sep 25 '16 20:09 unknownbrackets

The problem still exist here on windows, movies get constant freezing, althrough noticed it completely looses sound letting it run long enough and when that happens, it stops the annoying freezing. Definitely not "no problems", unless it's platform specific limited to windows or you skipped all movies which this issue is about.

LunaMoo avatar Oct 05 '16 16:10 LunaMoo

I have legit copy from PS store, not repacked/dumped in any weird way, even redownloaded to be sure and no - it has nothing to do with my copy.

You sure actual FMV's in game play correctly for you? That is - with proper sound and without micro pauses/freezes and ofc without using some ancient savestates using fresh build with default settings?

Because it's a fact that they do "play", that's the fix that was merged for it does, but they don't play as they should and as they were in older versions and that's the reason this issue is still opened.

You don't have to "start a new game" at all, even the very first movie is bugged ~ the short logo which changes from yellow to red Rstar will freeze for a moment on yelllow Rstar before running the red one which is very noticeable and also desyncs sound. Most other stuff that shows before "press start" screen are videos as well. You can compare what you see to for example this https://www.youtube.com/watch?v=DXDe0AWwNZc which has all of those videos from the start including logos.

LunaMoo avatar Oct 06 '16 02:10 LunaMoo

It's still freezing, just not permanently and still the cause is exactly same commit, so not see any confusion from the title here and also no, this regression was not fixed, just slightly improved and all of this was noted in the actual discussion.

I can add that fact to first post for lazy people, there's no need to open secondary issue for exactly same problem through.

LunaMoo avatar Oct 06 '16 03:10 LunaMoo

Since 1.4.0, it has been playable, but FMV's (not the in game cutscenes) will play very slowly or not play at all and freeze. And dialogue will get skipped from the player and npc's.

ZT-1 avatar Jun 26 '17 22:06 ZT-1

https://github.com/hrydgard/ppsspp/commit/35510f024199a0464e974e84e3aee9b8f2248b3b Make video play not slowly,But the video is slower compare to real psp

sum2012 avatar Nov 22 '20 12:11 sum2012

This is still happen in latest version. Cutscenes works fine in old version v1.3....

Nugss avatar Jan 16 '22 04:01 Nugss

All these problems still persist in version 1.13.2. The FMVs are slow and there is no audio in the intro video, the Rockstar Games logos are also stuttering, and in the game, there is stuttering in some dialogues of the characters and in some parts of the map of the stages, it is a type of stuttering without explanation apparent, because when there are many characters on the screen, stuttering does not occur. It's just weird.

SilentMRG avatar Dec 11 '22 18:12 SilentMRG

the latest build version is good, but I don't hear the character's voice in the opening

IrfanH495 avatar Jun 16 '23 00:06 IrfanH495

Hey, The Warriors is still stuttering on latest version. The intro and cutscenes and the audio are messed up. Is there a fix for those issues?

swan-blip avatar Nov 14 '23 11:11 swan-blip

@swan-blip me, too also waiting for this game to be fixed. but after seeing that it was added to version v1.17.0, I didn't send spam like this

https://github.com/hrydgard/ppsspp/assets/78854859/97adebd0-8ea8-4130-bae8-59b8110a5a70

I was going to spam like that if it hadn't been added to the next version. 😄😄😄

IrfanH495 avatar Nov 24 '23 09:11 IrfanH495

my hack no more work https://github.com/hrydgard/ppsspp/commit/35510f024199a0464e974e84e3aee9b8f2248b3b

sum2012 avatar Nov 24 '23 12:11 sum2012

"HackFixVideo" from my TemporaryHackishBranch still works, not linking the code as I pushed it a lot of time ago without separating it from other changes, but it basically restores previous code via compat hack to make it work. without affecting other games.

LunaMoo avatar Nov 25 '23 01:11 LunaMoo