Closed solarmystic closed 11 years ago
@raven02 I just another try.Can you try this code hack work or not ? (I work) if (inbytes > 0 && inbytes == atrac->atracBytesPerFrame) change to if (inbytes > 0 && inbytes == atrac->atracBytesPerFrame && SamplesNum < finish) {
I'm using 32bit build as well .Will try your code.
It works well and no crash . @unknownbrackets , what do you think ?
The following one seems to be the function called to crash
Atrac3plus_Decoder::Decode(atrac->decoder_context, atrac->data_buf + atrac->decodePos, inbytes, &decodebytes, buf);
int ret = frame_decoder(context, inbuf, inbytes, &channels, &buf);
@sum2012 , i think it just somehow skipped the decoding at all as there should be conversation among those soliders as well as background music.
@raven02 So that I call this one is a hack code.
Does it work fine in JPCSP still? I noticed some of the results from the tests I did were implemented in JPCSP:
http://code.google.com/p/jpcsp/source/detail?r=3392 (again I realize it uses a different decoder...)
-[Unknown]
Yep, JPCSP seems to be changed the logic for BufferInfoForResetting. Trying to figure out hw to translate them to here
// Assuming "atracBytesPerFrame" bytes in the input file for each "maxSamples" samples.
int inputFileSampleOffset = inputBuffer.isFileEnd() ? 0 : inputFileDataOffset + sample / maxSamples * atracBytesPerFrame;
int resetWritableBytes = inputBuffer.isFileEnd() ? 0 : inputBuffer.getMaxSize();
int resetNeededBytes = inputBuffer.isFileEnd() ? 0 : atracBytesPerFrame * 2;
Seems to be affecting Tales of the World Radiant Mythology 3 as well, most likely.
http://forums.ppsspp.org/showthread.php?tid=1807&pid=50652#pid50652
-[Unknown]
I think that should fix\work arround this before major release
I think it would be good to know if the new atrac3+ ffmpeg implementation did same crash here.
This issue should be labelled with the atrac3+ label.
This game no longer crashes upon starting a New Game after https://github.com/hrydgard/ppsspp/pull/4221 was merged into master.
However, it cannot be considered fixed yet, as the BGM just stops playing instead at that segment instead of crashing, so a bug is still present.
Notably, the crash related to atrac3+ when loading a savegame in GTA Vice City Stories https://github.com/hrydgard/ppsspp/issues/3805#issuecomment-24659414 also no longer occurs after the maxim stuff got merged to master as well, consider that one fixed.
Logfile is also spamming these lines repeatedly too:
48:08:716 mix sound th I[ME]: HW\MediaEngine.cpp:108 FF: GHA amplitude mode 0
48:08:716 mix sound th I[ME]: HW\MediaEngine.cpp:108 FF: is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
48:08:716 mix sound th E[ME]: HLE\sceAtrac.cpp:605 avcodec_decode_audio4: Error decoding audio -1163346256
48:08:716 mix sound th E[ME]: HLE\sceAtrac.cpp:793 UNIMPL sceAtracGetInternalErrorInfo(0, 09fcf274)
48:08:716 mix sound th I[ME]: HLE\sceAtrac.cpp:929 sceAtracReleaseAtracID(0)
48:08:816 mix sound th I[ME]: HLE\sceAtrac.cpp:1233 0=sceAtracSetHalfwayBufferAndGetID(08bfec80, 00001000, 00040000)
48:08:816 mix sound th W[ME]: HLE\sceAtrac.cpp:1114 This is an atrac3+ stereo audio
48:08:817 mix sound th I[ME]: HLE\sceAtrac.cpp:735 0=sceAtracGetBufferInfoForResetting(0, 0, 09fcf238)
48:08:848 mix sound th I[ME]: HLE\sceAtrac.cpp:935 sceAtracResetPlayPosition(0, 0, 262144, 0)
48:08:849 mix sound th I[ME]: HLE\sceAtrac.cpp:1248 sceAtracSetLoopNum(0, -1)
probably another case of the game playing junk data, confusing instead of crashing the new Atrac3+ code.
Finally properly fixed with https://github.com/hrydgard/ppsspp/pull/4483 with the https://github.com/hrydgard/ppsspp/commit/225f8efbb9e8c4209723b9ce50b114c263a54403 commit provided by @papel
The game no longer crashes at the aforementioned spot, and the BGM doesn't cut off either, it continues to play throughout the entire sequence.
https://github.com/hrydgard/ppsspp/issues/3805#issuecomment-24659414 in GTA VCS is also properly fixed, with game now playing the appropriate dialogue during that opening scene, with no crashes.
Big thanks to @papel for the responsible commit that fixed it.
Closed.
It is a good news :)
Just to say, I'm pretty certain I can create a test that shows this is not "properly" fixed. It may be fine for now, but that doesn't mean it's what the PSP does, but I don't like things that aren't at all what the PSP does being called "proper." The only proper fix is to make it work the way the PSP observably does. An unknown quantity (possibly zero, probably less than before) of games could depend on correct behavior.
-[Unknown]
Agree, but was the previous behaviour matching the PSP in all cases? If not we are choosing between two hacks, and if we're at that stage, might as well choose the one that fixes the most games. Ideally of course we should match the PSP's behaviour, we need a better testsuite.
Again, I'm just saying it's not a "proper" fix. It may be a "good hack."
-[Unknown]
Right, yeah.
@unknownbrackets and @hrydgard if you own a PSP which is the best tool to examine PSP's behaviour? pspautotests, jpcsptrace?
The combination of the two. However, pspautotests is probably better for testing how something should work. JpcspTrace is better for seeing how it's being used.
-[Unknown]
I'll give it a try to find out how sceAtracGetBufferInfoForResetting should work. First thing to find documentation of these tools.
@unknownbrackets thank you!!!
Sorry for the improper use of "proper", I should've clarified what I meant.
What I meant by "proper" was that the game just exhibits the correct behaviour since the commit instead of being muted like before, not that the fix itself is "proper".
Issue is as stated in the title.
First singular responsible build/commit found via bisecting is v0.9.1-833-gcf8a3e4 https://github.com/hrydgard/ppsspp/commit/cf8a3e4df1cb8f0b6cd1dec8c23952faf2cf19c9 which was merged into master with v0.9.1-842-g00f8ae5 https://github.com/hrydgard/ppsspp/commit/00f8ae5f2d07e8103c3e0eb838ae93762ce6dbdd https://github.com/hrydgard/ppsspp/pull/3772
Last unaffected revision is the one right before the commit was merged into master, v0.9.1-841-g26f935b https://github.com/hrydgard/ppsspp/commit/26f935bbe58d971831b88a97aec6d48995b65997
Problem reproduction:-
Windows Error Report:-
Stack Trace from affected 64bit debug build:-
Stack Trace from affected 32bit debug build:-
Logfile from an affected 64bit debug build until it crashes:- http://www.mediafire.com/download/9g0wbo629ngccuq/ppssppDebug64.7z
Logfile from an affected 32bit debug build until it crashes:- http://www.mediafire.com/download/623e117assjgycz/ppssppDebug32.7z
Temporary solution:-
Play through that entire section without the atrac3+ plugin enabled. Game will not crash if the plugin is either disabled or missing from your ppsspp directory. Game will lack BGM if you do that though.