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

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

Open
LunaMoo opened this issue Sep 18, 2016 · 26 comments
Open
Labels
PSMF / MPEG Issue involves scePsmf or sceMpeg video playback.
Milestone

Comments

@LunaMoo
Copy link
Collaborator

LunaMoo commented Sep 18, 2016

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 - f70f056 helps a bit, movies are still freezing, just not permanently.

@unknownbrackets
Copy link
Collaborator

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

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 unknownbrackets added this to the v1.3.1 milestone Sep 18, 2016
@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Sep 18, 2016

Well it wasn't that one, will update when I find the culprit.
Edit: it's 558b462

@sum2012 sum2012 added the PSMF / MPEG Issue involves scePsmf or sceMpeg video playback. label Sep 22, 2016
@unknownbrackets
Copy link
Collaborator

Does it help to reapply c03f6c2?

-[Unknown]

@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Sep 24, 2016

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.

@unknownbrackets
Copy link
Collaborator

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]

@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Sep 25, 2016

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.

@unknownbrackets
Copy link
Collaborator

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

-[Unknown]

@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Sep 25, 2016

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

@sum2012
Copy link
Collaborator

sum2012 commented Sep 25, 2016

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

@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Sep 25, 2016

As mentioned earlier everything started from 558b462 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:|)

@unknownbrackets
Copy link
Collaborator

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]

@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Sep 25, 2016

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 558b462#diff-d75a9bd0fb70784215db5632c8b16019L357
another two here 558b462#diff-d75a9bd0fb70784215db5632c8b16019L293
and forcing bool MediaEngine::SetupStreams() to always return false or remove the check to fallback to old behaviour / restoring this 558b462#diff-d75a9bd0fb70784215db5632c8b16019L265

Trying those 3 changes separately still results in broken timing/pauses in the video. :|
Edit: also keeping 558b462#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).

@unknownbrackets
Copy link
Collaborator

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]

@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Oct 5, 2016

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
Copy link
Collaborator Author

LunaMoo commented Oct 6, 2016

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
Copy link
Collaborator Author

LunaMoo commented Oct 6, 2016

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.

@unknownbrackets unknownbrackets changed the title The Warriors freezes at intro after #8867 The Warriors freezes / has video sync problems in all videos after #8867 Oct 7, 2016
@LunaMoo LunaMoo modified the milestones: v1.4.0, v1.3.1 Jan 31, 2017
@hrydgard hrydgard modified the milestones: v1.5.0, v1.4.0 Mar 15, 2017
@ZT-1
Copy link

ZT-1 commented Jun 26, 2017

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.

@hrydgard hrydgard modified the milestones: v1.5.0, v1.6.0 Nov 14, 2017
@hrydgard hrydgard modified the milestones: v1.6.0, v1.7.0 Mar 24, 2018
@sum2012
Copy link
Collaborator

sum2012 commented Nov 22, 2020

35510f0
Make video play not slowly,But the video is slower compare to real psp

@hrydgard hrydgard modified the milestones: v1.11.0, v1.12.0 Dec 14, 2020
@hrydgard hrydgard modified the milestones: v1.12.0, v1.13.0 Aug 28, 2021
@Nugss
Copy link

Nugss commented Jan 16, 2022

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

@SilentMRG
Copy link

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.

@IrfanH495
Copy link

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

@hrydgard hrydgard modified the milestones: Future-Prio, v1.17.0 Sep 7, 2023
@swan-blip
Copy link

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?

@IrfanH495
Copy link

@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

11_720p.mp4

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

@sum2012
Copy link
Collaborator

sum2012 commented Nov 24, 2023

my hack no more work 35510f0

@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Nov 25, 2023

"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.

@hrydgard hrydgard modified the milestones: v1.17.0, v1.18.0 Jan 19, 2024
hrydgard added a commit that referenced this issue Sep 11, 2024
This reverts to the old behavior before we started parsing mpeg headers,
that is, in 558b462 which is part of #8867.

LunaMoo has this under "HackFixVideo" in his build.

See #8991. This doesn't really "fix" that, but works around it.
hrydgard added a commit that referenced this issue Sep 11, 2024
This reverts to the old behavior before we started parsing mpeg headers,
that is, in 558b462 which is part of #8867.

LunaMoo has this under "HackFixVideo" in his build.

See #8991. This doesn't really "fix" that, but works around it.
@hrydgard
Copy link
Owner

I've ported over @LunaMoo 's HackFixVideo, though I renamed it to be more technically descriptive, see commit above.

Not closing this issue since the problem remains in our ffmpeg parser, but untagging it for 1.18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PSMF / MPEG Issue involves scePsmf or sceMpeg video playback.
Projects
None yet
Development

No branches or pull requests

9 participants