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.37k stars 2.19k forks source link

Games that still hang or crash trying to play a video #3338

Closed hrydgard closed 8 years ago

hrydgard commented 11 years ago

Our video playback is now working pretty well but there are apparently a few edge cases left. Here are the ones I know of that likely have this problem, let's collect them here.

PSMF:

MPEG:

Uncategorized:

dbz400 commented 10 years ago

It is audioTimestampStep

audioTimestampStep = 4180; // For audio play at 44100 Hz (2048 samples / 44100 * mpegTimestampPerSecond == 4180)

dbz400 commented 10 years ago

For Mai_Hime_Senretsu, it can go in-game (however it watch CG to the end it still will hang up)

screen00223

dbz400 commented 10 years ago

Marvel Ultimate Alliance 2 should be on the list (PSMF) #4324

dbz400 commented 10 years ago

The following can be cross out now :)

Mai Hime - Senretsu Shin Fuuka Gakuen Gekitoushi The Warriors Obscure The Aftermath (#2203) (MPEG) Dead Head Fred (#5003)

dbz400 commented 10 years ago

Just for reference here . For Ore no Dungeon, it got stuck at scePsmfGetEPWithTimestamp() .Whenever it writes the epid back to struct , video hang up.

if (Memory::IsValidAddress(entryAddr)) {
    Memory::WriteStruct(entryAddr, &psmf->EPMap[epid]);
}
dbz400 commented 10 years ago

Motorstorm: Arctic Edge video is start working in latest build now :) though still cannot in-game

screen00129 screen00130

dbz400 commented 10 years ago

Parappa The Rapper should be okay now to playback the CG as below .

screen00298 screen00299

dbz400 commented 10 years ago

Please add Bust-a-Move Deluxe (MPEG) , video is not working and suppose to playback TAITO logo

dbz400 commented 10 years ago

Please add Alien Vs Predator: Requiem #4546

thedax commented 10 years ago

Megaman Maverick Hunter X can be added to the list (https://github.com/hrydgard/ppsspp/issues/3318). It's supposed to play a 4 second long video before the first developer logo appears, but it doesn't, instead hanging on a screen with the text "Accessing" until the user presses start to skip it. The game's other videos play perfectly fine, however. This game falls under the MPEG category.

unknownbrackets commented 10 years ago

Well, I think we want to keep this to games that hang and are therefore unplayable (FF2 isn't on the list either.)

-[Unknown]

sum2012 commented 10 years ago

Please add "SBK-09 Superbike World Championship " PSMF problem http://forums.ppsspp.org/showthread.php?tid=2728&pid=70799#pid70799

sum2012 commented 10 years ago

Street Supremacy test on v0.9.6-666 video no problem http://forums.ppsspp.org/showthread.php?tid=1359&pid=70796#pid70796

sum2012 commented 10 years ago

Add Pacman World 3 (scempeg problem) http://forums.ppsspp.org/showthread.php?tid=1276&pid=70885#pid70885

sum2012 commented 10 years ago

Add Crimson Room Reverse (PSMF problem) http://forums.ppsspp.org/showthread.php?tid=5877&pid=70999#pid70999

hrydgard commented 10 years ago

Added, thanks.

dbz400 commented 10 years ago

Ore no Dungeon should be okay now , it is not hanging in CLIMAX logo (but wondering any more video after this logo or go striaght to title ? )

KingPepper commented 10 years ago

Would Dynasty Warriors (ULUS10004) be one to add to this issue?, due to its slow playing video's IE...15 Fps, even though the rest of the game runs at 30 Fps.

sum2012 commented 10 years ago

Add last one Xyanide: Resurrection (scempg problem) http://forums.ppsspp.org/showthread.php?tid=1984&pid=71031#pid71031

These 2 days I have tested a lot of games in http://forums.ppsspp.org/forumdisplay.php?fid=14 :)

dbz400 commented 10 years ago

Regarding Bust-A-Move , the video stop with this error

58:25:385 user_main I[ME]: HLE\sceMpeg.cpp:368 sceMpegInit() 58:25:385 user_main I[ME]: HLE\sceMpeg.cpp:379 sceMpegRingbufferQueryMemSize(4800) 58:25:385 user_main I[ME]: HLE\sceMpeg.cpp:1132 sceMpegQueryMemSize() 58:25:385 user_main I[IO]: HLE\sceIo.cpp:842 stdout: Can't allocate memory for Mpeg Ring Buffer 58:25:385 user_main I[ME]: HLE\sceMpeg.cpp:1123 sceMpegFinish(...)

dbz400 commented 10 years ago

I normally see the packet size is 512 .This one is 4800 ?

sum2012 commented 10 years ago

JPCSP trace log of Bust-A-Move(psp hang) 05:54:47 user_main - sceMpegRingbufferQueryMemSize 0x12C0 = 0x9D9E00 05:54:47 user_main - sceMpegQueryMemSize = 0xB3DB

PPSSPP Log: https://gist.github.com/sum2012/c42b577c857a2f4b8283 08:36:140 user_main N[ME]: HLE\sceMpeg.cpp:377 10329600 = sceMpegRingbufferQueryMemSize(4800) 08:36:140 user_main N[ME]: HLE\sceMpeg.cpp:1130 65536 = sceMpegQueryMemSize()

Seem only sceMpegQueryMemSize result differcult

sum2012 commented 10 years ago

edit2: real PSP also hang this game ..........

sum2012 commented 10 years ago

JPCSP no problem log: https://gist.github.com/sum2012/f3563ca747598605954c Hmm 06:20:26 INFO hle.sceMpeg - user_main - sceMpegInit 06:20:26 DEBUG hle.sceMpeg - user_main - finishMpeg 06:20:26 DEBUG hle.sceMpeg - user_main - finishStreams 06:20:26 DEBUG hle.sceMpeg - user_main - sceMpegRingbufferQueryMemSize packets=0x12C0 06:20:26 DEBUG hle.sceMpeg - user_main - sceMpegQueryMemSize mode=0x0 06:20:26 DEBUG hle.sceMpeg - user_main - sceMpegRingbufferConstruct ringbufferAddr=0x088CF2C8, packets=0x12C0, data=0x0913FE80, size=0x9D9E00, callbackAddr=0x0885C800, callbackArgs=0x88CF28C 06:20:26 DEBUG hle.sceMpeg - user_main - sceMpegCreate mpeg=0x088CF2FC, data=0x09B19C90, size=0x10000, ringbufferAddr=0x088CF2C8, frameWidth=0x200, mode=0x0, ddrtop=0x0 06:20:26 DEBUG hle.sceMpeg - user_main - finishStreams 06:20:26 DEBUG hle.sceMpeg - user_main - sceMpegAvcDecodeMode mpeg=0x88CF2FC, modeAddr=0x088CF29C 06:20:26 DEBUG hle.sceMpeg - user_main - sceMpegQueryStreamOffset mpeg=0x88CF2FC, bufferAddr=0x09FFEDD0, offsetAddr=0x088CF304 06:20:26 INFO hle.scePsmf - user_main - Found PSMF MPEG video stream data: streamID=0xE0, privateStreamID=0x0, unk1=0x20, unk2=0xFB, EPMapOffset=0x0, EPMapEntriesNum=0, videoWidth=480, videoHeight=272 06:20:26 INFO hle.scePsmf - user_main - Found PSMF MPEG audio stream data: streamID=0xBD, privateStreamID=0x0, unk1=0x20, unk2=0x4, audioChannelConfig=2, audioSampleFrequency=2 06:20:26 INFO hle.sceMpeg - user_main - Using MPEG file for streaming: UmdIsoVirtualFile[UmdIsoFile(name='null', length=0x137800, startSector=0x81B0), sectorBlockMode=false]

dbz400 commented 10 years ago

Xyanide: Resurrection stucks at below .Comment out it works again but break others.

if (ctx->mediaengine->IsNoAudioData()) {
    INFO_LOG(ME, "Audio end reach. pts: %i dts: %i", (int)sceAu.pts, (int)ctx->mediaengine->getLastTimeStamp());
    result = PSP_ERROR_MPEG_NO_DATA;
}

screen00412

sum2012 commented 10 years ago

This one make Pacman World 3 ,Obscure The Aftermath and Xyanide: Resurrection happy :) Do this change still break other game?

if (ctx->mediaengine->IsNoAudioData()) {
    INFO_LOG(ME, "Audio end reach. pts: %i dts: %i", (int)sceAu.pts, (int)ctx->mediaengine->getLastTimeStamp());
    if (mpegRingbuffer.packetsFree >= 1020 && mpegRingbuffer.packets == 1024){
        mpegRingbuffer.packetsFree = mpegRingbuffer.packets;
        Memory::WriteStruct(ctx->mpegRingbufferAddr, &mpegRingbuffer);
    }
    else if (mpegRingbuffer.packetsFree !=0)
    result = PSP_ERROR_MPEG_NO_DATA;
}
dbz400 commented 10 years ago

Tested with few other games with CG playback that we fixed previously and looks good.

sum2012 commented 10 years ago

Test a bit more, Xyanide: Resurrection crash after in-game. It cannot exit from Audio end reach after video

sum2012 commented 10 years ago

Add 3 games, Innocent Life - A Futuristic Harvest Moon (scempeg and scepsmf) http://forums.ppsspp.org/showthread.php?tid=4644&pid=71400#pid71400 Widgets Odyssey (scempeg and scepsmf) http://forums.ppsspp.org/showthread.php?tid=2241&pid=71424#pid71424 Patapon 3 #5298 (sceMpeg and scepsmf)

dbz400 commented 10 years ago

Crimson Room Reverse , Alien vs Predator: Requiem and Ore no Dungeon has been fixed in latest build and can be closed.

dbz400 commented 10 years ago

Xyanide: Resurrection startup video should be okay now though still crash in-game .

@sum212 , how about Pacman World 3 in latest build ? (i don't have this game to test unfortunately)

sum2012 commented 10 years ago

@raven02 Well done fix Crimson Room Reverse

v0.9.6-873-g4d00a9b
Pacman World 3 black screen after second video scempeg debug log https://gist.github.com/sum2012/f623128d260f61e823be

dbz400 commented 10 years ago

I see .

sum2012 commented 10 years ago

Mark Pacman World 3 hack fix https://github.com/hrydgard/ppsspp/pull/5398

ghost commented 10 years ago

Kurohyo2 DEMO http://www.pspdemocenter.com/page.php?id=3969

The movie of this game from v0.9.6-260-g0fa3e0b #4965 becomes a black screen on the way, and a game stops it.

Please see recording video. https://drive.google.com/folderview?id=0By8WbS_hvsesbnBBdDhEenJFLVE&usp=sharing npjh90274_1 npjh90274_2

dbz400 commented 10 years ago

Can you try it in framebuffer to memory mode or non-buffered mode? to see if it stills black screen

It probably it is buffered rendering mode issue only.

dbz400 commented 10 years ago

When black screen in play psmf , i can see this one . Probably related to BindFramebufferColor ?

42:13:885 user_main W[SCEGE]: GLES\Framebuffer.cpp:820 FBO created from existing depthbuffer as color, 00110000/00110000 and 00088000/00110000 42:13:885 user_main W[SCEGE]: GLES\Framebuffer.cpp:820 FBO created from existing depthbuffer as color, 00110000/00110000 and 00000000/00110000 42:13:885 user_main W[SCEGE]: GLES\Framebuffer.cpp:820 FBO created from existing depthbuffer as color, 00110000/00110000 and 00110000/00110000

unknownbrackets commented 10 years ago

Well, there are two issues here. One is that the subtitles are displaying over a black screen. Without looking too hard, I'm guessing it's a dmac/memcpy/blocktransfer sort of issue. It looks vaguely like one and it's drawing to various different framebuffers at the time.

The other is, if that func returns an error, the game hangs after the video. If it fills the struct with some data, then it works. However, it's very clear that on error, it doesn't fill the struct with data (per tests.)

JpcspTrace is dying for some reason, so I can't tell for sure, but I'm using its psmf/libpsmfplayer prxs, and the same psmf calls leading up to the call, and I get an error with all the same parameters. And the struct stays with exactly the same values as before.

It's possible that the struct is on the stack (have not checked yet), and just happens to have the right invalid data in it on the PSP due to syscall funcs writing into stack space, but doesn't in PPSSPP because we don't use the stack. But, not sure.

Edit: on the PSP, the value before the func enters is 0. Unfortunately, JpcspTrace mysteriously dies within the func so I can't tell the return value or if it changed anything. But, in PPSSPP, the value is non zero. So it's a bug in the game most likely. Ugh.

-[Unknown]

dbz400 commented 10 years ago

The "subtitles are displaying over a black screen" works in non-buffered mode somehow but not buffered rendering mode (framebuffer to memory works okay as well)

Already check dmac and blocktransfer , seems to be not using them.

dbz400 commented 10 years ago

Xyandie can be go in-game now in latest build bot.

ules00634_00000

unknownbrackets commented 10 years ago

Maybe due to the audio fix? That's nice. How about Pacman?

-[Unknown]

dbz400 commented 10 years ago

Mostly yes. I don't have Pacman 3.Probably need @sum2012 to test it here.

sum2012 commented 10 years ago

In think merge #5977 first better.Moreover I am at work

sum2012 commented 10 years ago

edit:@raven02 Pacman 3 The intro video part do not have problem in v0.9.8-549-ga5b27b6

dbz400 commented 10 years ago

so i think it is fixed/good now for pac-man 3 ?

sum2012 commented 10 years ago

Wait somoene test deeper in ppsspp forum

dbz400 commented 10 years ago

Meanwhile , just tested Kurohyo 2 again .The black screen issue as mentioned @jack00 is still happening but it is in buffered renedering mode . Non buffered one is prefectly fine.

Whenever subitlte showup , the background will become black

dbz400 commented 10 years ago

Framebuffer read mode also correct .

npjh50562_00009

xsacha commented 10 years ago

So most of these issues are resolved now. I'm wondering if it's time to remove USE_FFMPEG?

hrydgard commented 10 years ago

As the 360 port appears to be dead, I would think so. There's no platform that we care about that FFMPEG can't easily be built for.