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.03k stars 2.15k forks source link

PowerPC defaults to x86_64 for ffmpeg #15490

Open CloudyProton opened 2 years ago

CloudyProton commented 2 years ago

Platform

Linux / BSD

Compiler and build tool versions

cmake version 3.18.4

Operating system version

Debian 11 ppc64le

Build commands used

cmake /home/user/ppsspp make -j 4

What happens

Most of ppsspp builds successfully but make fails on the ffmpeg module

[100%] Building CXX object CMakeFiles/PPSSPPSDL.dir/UI/Theme.cpp.o [100%] Linking CXX executable PPSSPPSDL /usr/bin/ld: ffmpeg/linux/x86_64/lib/libavformat.a(allformats.o): Relocations in generic ELF (EM: 62) /usr/bin/ld: ffmpeg/linux/x86_64/lib/libavformat.a(allformats.o): Relocations in generic ELF (EM: 62) /usr/bin/ld: ffmpeg/linux/x86_64/lib/libavformat.a(allformats.o): Relocations in generic ELF (EM: 62) /usr/bin/ld: ffmpeg/linux/x86_64/lib/libavformat.a(allformats.o): Relocations in generic ELF (EM: 62) /usr/bin/ld: ffmpeg/linux/x86_64/lib/libavformat.a(allformats.o): Relocations in generic ELF (EM: 62) /usr/bin/ld: ffmpeg/linux/x86_64/lib/libavformat.a: error adding symbols: file in wrong format collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/PPSSPPSDL.dir/build.make:634: PPSSPPSDL] Error 1 make[1]: *** [CMakeFiles/Makefile2:563: CMakeFiles/PPSSPPSDL.dir/all] Error 2 make: *** [Makefile:160: all] Error 2

~/ppsspp/ffmpeg/linux only contains directories for the following architectures: aarch64 armv7 mips32 riscv64 x86 x86_64

CMakeError.log

PPSSPP version affected

current master

Last working version

No response

Checklist

CloudyProton commented 2 years ago

I tried running cmake with -USE_SYSTEM_FFMPEG=ON although it still tries through the ffmpeg/linux/x86_64/ path. Is there some other way to prefer the system installed ffmpeg?

unknownbrackets commented 2 years ago

It probably requires some changes to CMakeLists.txt to actually detect PowerPC. PPSSPP once had a PowerPC jit (which I think was buggy), but it wasn't getting maintained and we had to remove it because we had to make larger changes and it wasn't getting tested. Since then, there hasn't been a lot of testing.

You can probably look at this and adjust it to use outside Wii U: https://github.com/hrydgard/ppsspp-ffmpeg/blob/master/wiiu.sh (this will be in ffmpeg/wiiu.sh in your ppsspp source directory.)

We don't recommend system FFmpeg, although I'm not sure why -DUSE_SYSTEM_FFMPEG=ON wouldn't work. The reason is that PSP games were coded to play videos in a pretty specific way - a way that is pretty frowned upon these days by developers. The latest versions of FFmpeg have removed these "bad" APIs, which is great for FFmpeg, but bad for an emulator that's meant to run games that were developed many years before people decided those ways of doing things were "bad." The version of FFmpeg we use (3.0.2) is more forgiving to these outdated techniques.

We have some compatibility with newer FFmpeg versions, but it means that some of the things PSP games can do don't work. Most games don't use them (luckily), but there are several which do.

Really, we should create a new video and audio processing library from scratch that matches what the PSP offered developers. Even the old FFmpeg version is not accurate, it's just better than the latest versions. Hasn't happened yet, just because rewriting something that complex is a lot of work, and the old version of FFmpeg works fairly well.

-[Unknown]