I really want to use the dual core mode under linux. so i took a look at the code and searched for the problem myself.
The main problem seems to be, that the X11Lib isn't thread safe.
The problem is that the Core.cpp of Dolphin starts two threads. They are called "Video Thread" and "CPU Thread".
But this ONLY happens in dual core mode, in single core mode these both threads are just ONE, so there is no conflict in accessing X11Lib.
By putting in some debug lines I found 2 locations in the code where there is active polling of XEvents with XNextEvent(...) , one in GLUtil.cpp and the other in PadSimple.cpp.
I'am pretty sure that there is a problem. I testet a few things:
I ran Zelda TP, the intro plays a few seconds, then the game crashes with either: "Dolphin: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0"
or "Dolphin: xcb_io.c:242: process_responses: Assertion `(((long) (dpy->last_request_read) - (long) (dpy->request)) <= 0)' failed."
When i comment out the polling in PadSimple: The intro works, but no keyboard input
Then i created a mutex for X11Lib access in GLUtil and PadSimple, but that doesn't really work as i wished. But the game seems to crash a little bit later, i could even play now a WHOLE minute sometimes
So i guess there must be another active thread or something that i have missed.
The funny thing is that nJoy plugin works, its using SDL, maybe its worth thinking about rewriting PadSimple using SDL instead X11Lib directly.
The main problem seems to be, that the X11Lib isn't thread safe.
The problem is that the Core.cpp of Dolphin starts two threads. They are called "Video Thread" and "CPU Thread".
But this ONLY happens in dual core mode, in single core mode these both threads are just ONE, so there is no conflict in accessing X11Lib.
By putting in some debug lines I found 2 locations in the code where there is active polling of XEvents with XNextEvent(...) , one in GLUtil.cpp and the other in PadSimple.cpp.
I'am pretty sure that there is a problem. I testet a few things:
I ran Zelda TP, the intro plays a few seconds, then the game crashes with either: "Dolphin: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0"
or "Dolphin: xcb_io.c:242: process_responses: Assertion `(((long) (dpy->last_request_read) - (long) (dpy->request)) <= 0)' failed."
When i comment out the polling in PadSimple: The intro works, but no keyboard input

Then i created a mutex for X11Lib access in GLUtil and PadSimple, but that doesn't really work as i wished. But the game seems to crash a little bit later, i could even play now a WHOLE minute sometimes

So i guess there must be another active thread or something that i have missed.
The funny thing is that nJoy plugin works, its using SDL, maybe its worth thinking about rewriting PadSimple using SDL instead X11Lib directly.
