Emulator Issues #9799
closed[Linux] Emulator Window updating *very* slowly (~1 frame/minute)
0%
Description
Game Name?
SSB Melee (probably not relevant)
Game ID?
GALE01
MD5 Hash?
0e63d4223b01d9aba596259dc155a174
What's the problem? Describe what went wrong.
Dolphin starts fine but when starting the game, the emulator Window is not drawing anything for a long time. After about 5-10 minutes of waiting the the emulation is drawn but each frame takes about a minute or more to be drawn (while 1 CPU is running at 100%).
What steps will reproduce the problem?
Happens every time.
Which versions of Dolphin did you test on? Does using an older version of Dolphin solve your issue? If yes, which versions of Dolphin used to work?
This happens on git tip at 04e6aaf419feb18e7b2f2be19aabd4b34660ce31 .
What are your PC specifications?
Linux Arch 4.8.0-1-testing #12 SMP PREEMPT Sun Sep 18 00:59:15 CEST 2016 x86_64 GNU/Linux
Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz
RX 480 Nitro 8GB
mesa 12.0.3-1
Is there any other relevant information? (e.g. logs, screenshots,
configuration files)
strace says it's (slowly) reading from somewhere (/dev/input/event* it seems) but not with a lot of success:
read(23, 0x38d6728, 6984) = -1 EAGAIN (Resource temporarily unavailable)
read(23, 0x38d6710, 7008) = -1 EAGAIN (Resource temporarily unavailable)
read(24, 0x38af1f0, 6144) = -1 EAGAIN (Resource temporarily unavailable)
read(25, 0x38b94e0, 6144) = -1 EAGAIN (Resource temporarily unavailable)
read(26, 0x38cf510, 6144) = -1 EAGAIN (Resource temporarily unavailable)
read(27, 0x38e0e30, 6144) = -1 EAGAIN (Resource temporarily unavailable)
write(6, "\1\0\0\0\0\0\0\0", 8) = 8
futex(0x3543380, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x3517120, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x1886c04, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x1886c00, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1
futex(0x1886c04, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x1886c00, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1
recvmsg(21, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="#\203\362\6\26\0\0\0\2\0\10\0c\232\32\0%\0\0\0\276\4\0\0\276\4\0\0\5\0\200\0"..., iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 120
recvmsg(21, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(21, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
read(20, "H\340W\0\0\0\0T\213\n\0\0\0\0\0\4\0\4\0\340\0\7\0H\340W\0\0\0\0"..., 8208) = 72
read(20, 0x38d2df0, 8160) = -1 EAGAIN (Resource temporarily unavailable)
read(20, 0x38d2dd8, 8184) = -1 EAGAIN (Resource temporarily unavailable)
read(20, 0x38d2dc0, 8208) = -1 EAGAIN (Resource temporarily unavailable)
read(22, 0x38ca560, 12384) = -1 EAGAIN (Resource temporarily unavailable)
read(23, 0x38d6710, 7008) = -1 EAGAIN (Resource temporarily unavailable)
read(24, 0x38af1f0, 6144) = -1 EAGAIN (Resource temporarily unavailable)
read(25, 0x38b94e0, 6144) = -1 EAGAIN (Resource temporarily unavailable)
read(26, 0x38cf510, 6144) = -1 EAGAIN (Resource temporarily unavailable)
read(27, 0x38e0e30, 6144) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x1886c04, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x1886c00, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1
futex(0x1886c04, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x1886c00, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1
recvmsg(21, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="#\203\362\6\26\0\0\0\3\0\10\0\313\233\32\0%\0\0\0\276\4\0\0\276\4\0\0\5\0\200\0"..., iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 120
recvmsg(21, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(21, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
read(20, "H\340W\0\0\0\0\33\252\16\0\0\0\0\0\1\0\35\0\2\0\0\0H\340W\0\0\0\0"..., 8208) = 216
read(20, 0x38d2e80, 8016) = -1 EAGAIN (Resource temporarily unavailable)
read(20, 0x38d2e68, 8040) = -1 EAGAIN (Resource temporarily unavailable)
read(20, 0x38d2e50, 8064) = -1 EAGAIN (Resource temporarily unavailable)
read(20, 0x38d2e38, 8088) = -1 EAGAIN (Resource temporarily unavailable)
read(20, 0x38d2e20, 8112) = -1 EAGAIN (Resource temporarily unavailable)
read(20, 0x38d2e08, 8136) = -1 EAGAIN (Resource temporarily unavailable)
read(20, 0x38d2df0, 8160) = -1 EAGAIN (Resource temporarily unavailable)
read(20, 0x38d2dd8, 8184) = -1 EAGAIN (Resource temporarily unavailable)
read(20, 0x38d2dc0, 8208) = -1 EAGAIN (Resource temporarily unavailable)
read(22, 0x38ca560, 12384) = -1 EAGAIN (Resource temporarily unavailable)
read(23, 0x38d6710, 7008) = -1 EAGAIN (Resource temporarily unavailable)
read(24, 0x38af1f0, 6144) = -1 EAGAIN (Resource temporarily unavailable)
read(25, 0x38b94e0, 6144) = -1 EAGAIN (Resource temporarily unavailable)
read(26, 0x38cf510, 6144) = -1 EAGAIN (Resource temporarily unavailable)
read(27, 0x38e0e30, 6144) = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(21, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(21, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
read(20, 0x38d2dc0, 8208) = -1 EAGAIN (Resource temporarily unavailable)
read(22, 0x38ca560, 12384) = -1 EAGAIN (Resource temporarily unavailable)
read(23, 0x38d6710, 7008) = -1 EAGAIN (Resource temporarily unavailable)
read(24, 0x38af1f0, 6144) = -1 EAGAIN (Resource temporarily unavailable)
read(25, 0x38b94e0, 6144) = -1 EAGAIN (Resource temporarily unavailable)
read(26, 0x38cf510, 6144) = -1 EAGAIN (Resource temporarily unavailable)
read(27, 0x38e0e30, 6144) = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(21, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(21, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
read(20, 0x38d2dc0, 8208) = -1 EAGAIN (Resource temporarily unavailable)
read(22, 0x38ca560, 12384) = -1 EAGAIN (Resource temporarily unavailable)
read(23, 0x38d6710, 7008) = -1 EAGAIN (Resource temporarily unavailable)
read(24, 0x38af1f0, 6144) = -1 EAGAIN (Resource temporarily unavailable)
read(25, 0x38b94e0, 6144) = -1 EAGAIN (Resource temporarily unavailable)
gdb says:
(gdb) bt
#0 0x00000000006461a5 in std::min (__a=@0x7f6f7434aeb0: 13777, __b=@0x7f6f7434aea8: 20000)
at /usr/include/c++/6.2.1/bits/stl_algobase.h:200
#1 0x0000000000645984 in CoreTiming::Advance ()
at /home/silvan/build/dolphin/Source/Core/Core/CoreTiming.cpp:344
#2 0x0000000000762553 in Interpreter::SingleStep (this=0x12c0c08 Interpreter::getInstance()::instance)
at /home/silvan/build/dolphin/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp:200
#3 0x000000000074c99b in PowerPC::SingleStep ()
at /home/silvan/build/dolphin/Source/Core/Core/PowerPC/PowerPC.cpp:268
#4 0x000000000064d075 in Gecko::RunCodeHandler ()
at /home/silvan/build/dolphin/Source/Core/Core/GeckoCode.cpp:182
#5 0x00000000006718c4 in PatchEngine::ApplyFramePatches ()
at /home/silvan/build/dolphin/Source/Core/Core/PatchEngine.cpp:219
#6 0x00000000006e3e23 in SystemTimers::PatchEngineCallback (userdata=0, cyclesLate=1)
at /home/silvan/build/dolphin/Source/Core/Core/HW/SystemTimers.cpp:172
#7 0x000000000064592e in CoreTiming::Advance ()
at /home/silvan/build/dolphin/Source/Core/Core/CoreTiming.cpp:335
#8 0x0000000041ce7039 in ?? ()
#9 0x0000000000000000 in ?? ()
So it seems to be hanging somewhere in CoreTiming::Advance->std::min. That seems to be borne out by my git bisect result which says that the following commit is the culprit:
first bad commit: [1bcd129683549db3581801a6220e531a558567c2] Interpreter: Fix CoreTiming contract¶
reverting this commit fixes the issue, but I don't know why.
Updated by mathieui about 8 years ago
Please bisect in order to find out in which revision a regression happened (if any).
Updated by Shugyousha about 8 years ago
mathieui wrote:
Please bisect in order to find out in which revision a regression happened (if any).
I already did :)
The offending commit is this one:
first bad commit: [1bcd129683549db3581801a6220e531a558567c2] Interpreter: Fix CoreTiming contract
reverting this commit fixes the issue for me.
Updated by JMC4789 about 8 years ago
Can you test what happens if you turn off gecko codes?
Updated by Shugyousha about 8 years ago
JMC4789 wrote:
Can you test what happens if you turn off gecko codes?
I checked that all AR codes are off and deactivated the "Netplay Community Settings" which was the only active Gecko Code.
After deactivating that Gecko Code the emulator worked again as usual! There seems to be an issue with how the bisected commit and this Gecko Code interact.
I don't think this should make a difference but gcc (version 6.2.1 20160830) complains that it cannot inline this function so I have to remove this compiler directive in order to compile dolphin.
diff --git a/Source/Core/Core/PowerPC/MMU.cpp b/Source/Core/Core/PowerPC/MMU.cpp
index e5b669e..77250b0 100644
--- a/Source/Core/Core/PowerPC/MMU.cpp
+++ b/Source/Core/Core/PowerPC/MMU.cpp
@@ -161,7 +161,7 @@ BatTable dbat_table;
static void GenerateDSIException(u32 _EffectiveAddress, bool _bWrite);
template <XCheckTLBFlag flag, typename T, bool never_translate = false>
-__forceinline static T ReadFromHardware(u32 em_address)
+static T ReadFromHardware(u32 em_address)
{
if (!never_translate && UReg_MSR(MSR).DR)
{
Just thought I would mention this here in the unlikely event that this has some impact on the debugging.
Updated by JosJuice about 8 years ago
- Is duplicate of Emulator Issues #9792: Low performance or crashes when using Gecko codes added