New wayland backend for threaded EGL/GLSL emulator
Scott Moreau
oreaus at gmail.com
Sun Feb 17 09:35:16 PST 2013
Hi,
For the past week, I've been working on porting Dolphin (the gamecube
emulator)
to run as a wayland client. I am pleased to announce the code is now in a
working
state. There are a few issues but fairly minor, considering this is a
threaded
EGL/GLSL application that works as an X client or a Wayland client. The same
binary can be run in X or Weston, selectable at runtime.
Since dolphin is a threaded application, timing is critical.
I suspect this is related to the bug I ran into, outlined here
https://bugs.freedesktop.org/show_bug.cgi?id=60942
For now, the wayland mainloop seems to be relatively stable using
roundtrips and
usleep. Hopefully I can track down what's going on there so it can dispatch
as intended.
This is quite possibly the first real world application to run as a threaded
wayland-egl client. It is also possibly the first standalone client to
support
X and Wayland platforms simultaneously.
Following is a summary of the current status of the Wayland client features:
What works:
Build time configuration switches for X and Wayland support
Run time platform switch configurable with environment variable
Core Functionality:
Video output
Audio output
Keyboard input
Joystick input
UI Functionality:
Toggle Fullscreen
Pause/Resume Emulation
Save/Load State
Screenshot
Esc to Exit
What doesn't work:
Mouse input
Resizing the window
More Information:
Keys:
Exit: Esc
Toggle Fullscreen: 'f' or Alt+Enter
Pause: 'p'
Save State: Shift+F1-8
Load State: F1-8
Testing:
1) Dolphin has high system requirements for cpu and gpu. It is recommended
to first
install Dolphin from the official channels configured with wxWidgets
frontend in X.
This will let you get familiarized and see if it works at all with your
system.
2) Grab the code from https://github.com/soreau/dolphin-emu wayland-egl
branch and build it.
prefix=$HOME/wayland
export PKG_CONFIG_PATH=$prefix/lib/pkgconfig
git checkout git://github.com/soreau/dolphin-emu.git -b wayland-egl
cd dolphin-emu
mkdir build
cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX=$prefix \
-DCMAKE_PREFIX_PATH=$prefix \
-DUSE_EGL=1 -DDISABLE_WX=1 \
-DUSE_X11=1 -DUSE_WAYLAND=1 \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE=0 \
make
make install
3) Run it:
LD_LIBRARY_PATH=$prefix/lib $prefix/bin/dolphin-emu-nogui -e /path/to/gcm
Notes:
The platform may be selected by setting the environment variable
DOLPHIN_EGL_PLATFORM to "x11" or "wayland".
If this environment variable is not set, it will attempt to select an
appropriate platform automatically.
Gamepad devices with force feedback capabilities work when Dolphin is built
against SDL2.
Resizing shouldn't be too difficult to implement.
This is a first attempt and WIP so the code isn't perfect and there may be
some bugs.
Issues:
Dolphin seems to produce invalid image files for screenshots, though weston
screenshooter works fine even when in fullscreen.
The emulator segfaults on exit in wayland, after a hack to work around
stalling on exit.
There is a bug in mesa with GLSL using UBO's that affects Sandybridge. It
causes relatively minor rendering artifacts and does not inhibit
performance.
Video Clip:
http://www.youtube.com/watch?v=3ZdXu1VM_VQ&feature=youtu.be
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20130217/ee18f774/attachment.html>
More information about the wayland-devel
mailing list