Closed i30817 closed 10 years ago
It seems like this is related to ATRAC3+ decoding. It doesn't crash at all without the savestate?
-[Unknown]
Not that i could tell. It was just pure luck (ok lots of savescumming) that i saved before the crash.
Uploaded the save to my google drive since i was worried about mediafire deleting it https://drive.google.com/file/d/0BzxkBmaf1EiWcDR4MGkyWXppSjg/edit?usp=sharing
Does this still happen since the ffmpeg update?
-[Unknown]
Yes. I debugged it and got this out:
Program received signal SIGSEGV, Segmentation fault.
0x0000000000ac2341 in ff_atrac3p_generate_tones (ch_unit=
(complete backtrace is useless btw, lots of #1 0x8000000080ac1c18 in ?? () lines, i don't know why) I suppose i should build a debug version of the included ffmpeg too? Apparently it isn't built by cmake but distributed already built?
edit: from this code apparently, if i found the right file: ffmpeg/libavcodec/atrac3plusdsp.c
if (tones_now->pend_env.has_stop_point &&
tones_now->pend_env.stop_pos >= tones_next->curr_env.start_pos) {
If you could reduce this to a test case and punt it to Max it would probably be fixed. If that is, it isn't the fault of the save state saving or something.
Oh, you probably need to rebuild ffmpeg. I don't think the distributed one was updated yet.
Just go in there are run ./linux_x86-64.sh
(or ./linux_x86.sh
as the case may be.)
-[Unknown]
It gives a few deprecation warnings and a full blown undefined reference later:
edit: user error, see next post
edit2: it wasn't :(
/home/i30817/Documents/Netbeans_projects/ppsspp/ffmpeg/linux/x86_64/lib/libavcodec.a(mpegvideo_enc.o): In function ff_dct_encode_init': /home/i30817/Documents/Netbeans_projects/ppsspp/ffmpeg/libavcodec/mpegvideo_enc.c:229: undefined reference to
ff_h263dsp_init'
/home/i30817/Documents/Netbeans_projects/ppsspp/ffmpeg/linux/x86_64/lib/libavcodec.a(h263dec.o): In function ff_h263_decode_init': /home/i30817/Documents/Netbeans_projects/ppsspp/ffmpeg/libavcodec/h263dec.c:127: undefined reference to
ff_h263dsp_init'
collect2: error: ld returned 1 exit status
make[2]: * [PPSSPPSDL] Error 1
make[1]: * [CMakeFiles/PPSSPPSDL.dir/all] Error 2
make: *\ [all] Error 2
adding #include "h263dsp.h", which contains the definition, on those files but it did nothing useful for some reason, maybe it's wrong. Error only occurs when linking PPSSPPSDL, not before, when building ffmpeg with the linux_x86-64.sh... but those files are all libavcodec.a ones.
Try removing the mjpeg encoder: https://github.com/hrydgard/ppsspp-ffmpeg/commit/5037e3627327907d989f83fa595041a84e9f2f9e#commitcomment-5177869
-[Unknown]
I actually suspect something like this: http://cmake.3232098.n2.nabble.com/static-library-linking-problem-td7584444.html
It would make sense if it tried to access those functions as if it was C++ and they're actually mangled as C. So building in the sh file gives no prob, and trying to verify the functions in the C++ linker of static files blows up although they're all inside the same .a file.
To be clear, what you're suggest there is revert that commit or what?
Well, it could also be that our flags are wrong and we're not ending up with the h263 funcs we need in the library, which we would only get an error about at link time.
-[Unknown]
Well i sincerely don't feel like i'm able to resolve this myself. How would i go about disabling mjpeg like you said?
edit: in the sh file, i see
Well removing --enable-encoder=mjpeg didn't fully resolve it but one of the errors went away. This still remains:
/home/i30817/Documents/Netbeans_projects/ppsspp/ffmpeg/linux/x86_64/lib/libavcodec.a(h263dec.o): In function ff_h263_decode_init': /home/i30817/Documents/Netbeans_projects/ppsspp/ffmpeg/libavcodec/h263dec.c:127: undefined reference to
ff_h263dsp_init'
collect2: error: ld returned 1 exit status
trying to removing ffv1 for good measure now. edit: nope
either 4.8 or 4.9
which parts of PPSSPP use ffmpeg includes?
Never mind, i found them with a grep. I'm going to try to put in the extern "C" thing around those and rebuild to see what's what.
edit: they're all already extern "C". All i found with this grep at least: grep -R --exclude-dir=ffmpeg* "#include" . | grep 'libavcodec/|libavformat/|libswresample/|libswscale/|libavutil'
Well, the undefined reference is from within ffmpeg, so that means it's nothing to do with PPSSPP or C++, most likely.
It could be link order, I suppose, but it worked before, right?
It seems likely to me that something isn't getting compiled and put into the library, but I don't know what/why.
You could try removing "--disable-all" from the sh. ffmpeg will be bigger but maybe it will work.
-[Unknown]
Removing the --disable-everything appears to have worked for building. And the bug is fixed. That is, there is a conspicuous lack of sound when it would crash before, but it's not crashing anymore and the game recovers the sound just a second later anyway. In neither debug or normal builds.
Closed!
Hmm, well, there's something wrong there but tbh I'm pretty sure we have other bugs that cover the general issue. Glad it works now.
We need to figure out that ffmpeg mess...
-[Unknown]
btw @unknownbrackets if youre curious, this is what a log enabled run of that savestate shows in the console (without the crash now) before and during the pause: 01:44:243 idle0 I[COMMON]: Common/ChunkFile.cpp:165 ChunkReader: Loading /home/i30817/.config/ppsspp/PSP/PPSSPP_STATE/NPUG80086_1.00_2.ppst 01:44:524 idle0 I[SCEGE]: GLES/Framebuffer.cpp:1632 Destroying FBO for 00088000 : 480 x 272 x 3 01:44:524 idle0 I[SCEGE]: GLES/Framebuffer.cpp:1632 Destroying FBO for 10198010 : 256 x 128 x 3 01:44:524 idle0 I[SCEGE]: GLES/Framebuffer.cpp:1632 Destroying FBO for 201b8020 : 128 x 64 x 3 01:44:524 idle0 I[SCEGE]: GLES/Framebuffer.cpp:1632 Destroying FBO for 301c0030 : 128 x 64 x 3 01:44:524 idle0 I[SCEGE]: GLES/Framebuffer.cpp:1632 Destroying FBO for 00000000 : 480 x 272 x 3 01:44:526 idle0 I[COMMON]: Common/ChunkFile.h:607 ChunkReader: Done loading /home/i30817/.config/ppsspp/PSP/PPSSPP_STATE/NPUG80086_1.00_2.ppst 01:44:548 swap thread I[SCEGE]: GLES/Framebuffer.cpp:794 Creating FBO for 00088000 : 480 x 272 x 3 01:44:548 swap thread I[SCEGE]: GLES/Framebuffer.cpp:794 Creating FBO for 10198010 : 256 x 128 x 3 01:44:548 swap thread W[SCEGE]: GLES/Framebuffer.cpp:814 FBO reusing depthbuffer, 10198010/00110000 and 00088000/00110000 01:44:548 swap thread I[SCEGE]: GLES/Framebuffer.cpp:794 Creating FBO for 201b8020 : 128 x 64 x 3 01:44:548 swap thread W[SCEGE]: GLES/Framebuffer.cpp:814 FBO reusing depthbuffer, 201b8020/00110000 and 00088000/00110000 01:44:549 swap thread I[SCEGE]: GLES/Framebuffer.cpp:794 Creating FBO for 301c0030 : 128 x 64 x 3 01:44:549 swap thread W[SCEGE]: GLES/Framebuffer.cpp:814 FBO reusing depthbuffer, 301c0030/00110000 and 00088000/00110000 01:44:694 swap thread I[SCEGE]: GLES/Framebuffer.cpp:794 Creating FBO for 00000000 : 480 x 272 x 3 01:45:494 stream threa I[ME]: HLE/sceAtrac.cpp:973 sceAtracReleaseAtracID(1) 01:53:105 stream threa I[ME]: HW/MediaEngine.cpp:84 FF: Invalid gain location: ch=0, sb=1, pos=2, val=32 01:53:105 stream threa E[ME]: HLE/sceAtrac.cpp:608 avcodec_decode_audio4: Error decoding audio -1094995529 01:53:105 stream threa E[ME]: HLE/sceAtrac.cpp:818 UNIMPL sceAtracGetInternalErrorInfo(0, 09fdc254) 01:53:105 stream threa I[ME]: HLE/sceAtrac.cpp:973 sceAtracReleaseAtracID(0) 01:53:242 stream threa I[ME]: HLE/sceAtrac.cpp:1272 0=sceAtracSetDataAndGetID(089d5340, 00020000) 01:53:242 stream threa W[ME]: HLE/sceAtrac.cpp:1162 This is an atrac3+ stereo audio
i've noticed the sound crackles too. But i guess that is another bug.
wait 10 seconds or so, for the 'transformation' to end.
https://drive.google.com/file/d/0BzxkBmaf1EiWcDR4MGkyWXppSjg/edit?usp=sharing