hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.39k stars 2.19k forks source link

Stuck issue with Mega Man Maverick Hunter X #3318

Closed hdd60311 closed 8 years ago

hdd60311 commented 11 years ago

Reported form http://forums.ppsspp.org/showthread.php?tid=384&pid=41935#pid41935 when run this game it freezes at ACCESS page, press start button can continue it.

1

unknownbrackets commented 9 years ago

Do note that because the call can flood logs, we don't log duplicate sceMpegRingbufferAvailableSize return values.

I had a lead at one point on what this might be - I can't remember if it was from a log or something, but I think sceMpegRingbufferPut rejects invalid packets, and we don't. Not sure if that would actually fix this.

Anyway, you can see in the log that it returns an error sometimes: sceMpegRingbufferPut 0x9FB7464, 0x20, 0x2 = 0x806101FE

-[Unknown]

sum2012 commented 9 years ago

Thanks @unknownbrackets
I will install back VS2013 to test this

unknownbrackets commented 9 years ago

FYI, you can install both at the same time. I have 2008, 2010, 2012, and 2013 I think... haven't really used 2008 for a while, should probably uninstall it...

-[Unknown]

sum2012 commented 9 years ago

@unknownbrackets This commit work but make other games have problem https://github.com/sum2012/ppsspp/commit/7662f3e8fb72f3478a084737c94ab1246c23a581 Log: https://drive.google.com/file/d/0B3OaSdeV0L8kZnFzbUpPMWtuYTA/view?usp=sharing

unknownbrackets commented 9 years ago

Hmm, interesting. Well, there are probably other rules to how exactly it returns the error. I think the best way to understand it will be using a PSP and sending different data at it to see when it responds with the error code.

-[Unknown]

daniel229 commented 9 years ago

The versions around 0.9.1-716-g86caa70 may working sometime. It randomly happens thses 1.stuck on access screen. 2.skip all videos. 3.all videos work. not perfect,it plays the opening video twice http://youtu.be/Yg8J20ql9D4

01

sum2012 commented 9 years ago

@unknownbrackets I give log to jpcsp. it fixed in https://github.com/gid15/jpcsp/commit/f2a701b5f425f2ad67e012e9c423a1d35ffd3e93 and https://github.com/gid15/jpcsp/commit/8d10998a784ccac3be6b7c8ca3f9a9b372df3fea

unknownbrackets commented 8 years ago

With some testing, I've determined that this behavior varies by mpeg version.

The behavior here changed in version 1.05. Versions 1.01 - 1.04 all exhibit this behavior, but I've only tested 1.05 and 1.10 for the latter. After 1.05, it seems the mpeg library was always part of firmware. But it doesn't seem the sdkver affects this; I think all versions on firmware don't do this validation.

Based on my tests so far, sending even one invalid packet at the start is enough to get the error code back. But it can also happen with valid packets - it's all about alignment.

If I have a buffer of 512 packets, and it's empty, I can add up to 1024 packets (yes, really), no error. It will wrap around and fill the buffer twice. No errors. I haven't checked decoding, so it's either the offset into the ring or # of packets, but if that offset + the number I add exceeds 2 * capacity, it generates this error pretty consistently (regardless of size.)

Edit: Hmm, there's more interaction here with the # of packets returned. Maybe it's actually when it hits a boundary in some way...

Note that, it still calls the callback, and still reads in the packets. I can read in 2048 packets, and it'll ask for all of them. It's only a problem if the callback actually (with multiple iterations, of course) returns >= 2 * capacity - offset.

Anyway, I'm not sure if this latter behavior is important here, although it's the more interesting one. What seems to happen in this log is that there's space, and it rejects the packet. I can reproduce this one reliably by adding a single garbage data packet.

As such, I believe jpcsp's behavior is incorrect. FYI @gid15.

-[Unknown]

sergiobenrocha2 commented 8 years ago

It completely hangs now with 1.2.1

sum2012 commented 8 years ago

@sergiobenrocha2 Do you mean start button cannot skip ?

l12436 commented 8 years ago

according to my test, start button can not skip..., complete stock right there.

sum2012 commented 8 years ago

Press "space bar" for keyboard for pc

l12436 commented 8 years ago

it will immediately stock when it show access. press space bar is not work. event esc is not working.

sum2012 commented 8 years ago

What is your os ? windows , linux

l12436 commented 8 years ago

linux ubuntu 14.04.4 kernel 4.2

sum2012 commented 8 years ago

So it don't work for linux. We need to wait @unknownbrackets fix it.

l12436 commented 8 years ago

OK, thanks

sonikokaruto commented 8 years ago

Exact same thing is happening on the libreto version for the raspberry pi

klyoungblood commented 8 years ago

The Pi thread on the forums mentioned that SDL only polls inputs on video updates, which means SDL-based version including Linux and Pi can never register the button press to skip the broken video.

sum2012 commented 8 years ago

v1.2.2-658-gce8d2be-windows-amd64 good log: https://gist.githubusercontent.com/sum2012/d91a5d6c8459b7e03db704ecdf0b1cab/raw/63e0f90094b8ecb0fe84d48dc5f5bf5a3fa299b1/gistfile1.txt

Voltkraken42 commented 8 years ago

I have a similar issue on Openemu (core version 0.9.9.1) on Mac. It tells me about the autosave function and then goes to accessing, but it's just a static picture. How could you help me with this? (I'm not that good with changing code, and Terminal doesn't work on my mac.) About the space/start thing, start is mapped to return on my Mac.

unknownbrackets commented 8 years ago

There's no workaround for SDL, afaik. This has been fixed in a new version, so v0.9.9.1 will forever not work. It will be in something like v1.3 (which hasn't been released yet.) If you want it now, you need to use a git build (check the downloads page.)

-[Unknown]