2013-06-09

The state of hardware acceleration on ODROID: 2nd round

Today I have repeated tests with current kernels:

Kernel X11 Driver Resolution glxgears es2gears glmark2-es2 glmark2-es2 --fullscreen
3.0.80 ARM mali 1080p ~ 143 fps ~ 590 fps 137 35
3.0.80 ssvb sunxi 1080p ~ 140 fps ~ 615 fps 151 40
3.0.80 ARM mali 720p ~ 140 fps ~ 600 fps 142 81
3.0.80 ssvb sunxi 720p ~ 144 fps ~ 620 fps 156 92
3.8.13 ARM mali 720p ~ 136 fps ~ 226 fps 61 37
3.8.13 ssvb sunxi 720p ~ 143 fps ~ 226 fps 66 42

Performance seems still halved with 3.8 kernel.
The automated test suite will be released in odroid-wheezy-retro as a script.

2013-06-01

odroid-wheezy-retro 0.0.7 released

0.0.7 released


In this release:
  • kernel 3.0.79 (with disabled fan PWM kern.log verbosity)
  • added xf86-video-sunxifb, you can enable it by copying /etc/X11/Xorg.conf-sunxi to /etc/X11/Xorg.conf
  • added glmark2-es2 binary
  • updated RetroArch binary
  • enabled HDMI 1080p output, (advice: disable it and use instead 720p to use RetroArch)
  • using EXT2 instead of EXT4
  • fixed a few issues related to bootstrapping
ODROID models X/X2/Q are supported by replacing kernel and modules before flashing to SD card, you can get them from mdrjr's builder download area.

Download odroid-wheezy-retro-0.0.7


You can always check the ChangeLog and NextRelease (suggestions are welcome).
Official ODROID forum discussion here.

2013-05-31

The state of hardware acceleration on ODROID (xf86-video-sunxi, xf86-video-mali and kernel 3.8)

Yesterday I tried xf86-video-sunxi (thanks to ssvb, rz2k and xjuan for the support!) and I have to say that this driver bears promise, in particular regarding G2D support, that hopefully in future will bring us 2D hardware acceleration.

The rotating horse is always fun, even when you rotate it.
I have run tests with the following combinations (some old test logs available here):

Kernel X11 Driver Resolution es2gears glmark2-es2 glmark2-es2 --fullscreen glxgears
3.0.79 ARM mali (31 may) 720p ~ 345  fps 160 96 125 fps
3.0.79 ARM mali 720p ~ 345 fps 160 96 125 fps
3.0.79 ssvb sunxi 720p ~ 261 fps 153 89 125 fps
3.8.13 ARM mali (31 may) 720p ~ 226 fps 61 37 ~ 140 fps
3.8.13 ARM mali 720p ~ 226 fps 61 37 ~ 140 fps
3.8.13 ssvb sunxi 720p ~ 226 fps 66 42 ~ 144 fps

Update 8 June 2013: see 2nd round of tests

The compiled sunxi driver and glmark2-es2 are included in version 0.0.7 of the odroid-wheezy-retro SD image.

RetroArch

With both kernels and with both X11 drivers RetroArch performs well in windowed mode (50FPS with rare frame drops with the 3.8 kernel).

Conclusions

  • there is currently a performance issue on kernel 3.8, our beloved mdrjr is working on it
  • glxgears is always software-rendered (see HardwareAcceleration), it's included only for reference
  • 1080p resolution is slow with all configurations, thus I have not targeted it for testing
  • the new Mali drivers (r3p2 released on 31st May) are the same as previous
  • xf86-video-sunxi starts to perform better on kernel 3.8, probably because of the NEON bug that affects 3.0
For now I will keep using kernel 3.0 and ARM mali drivers in odroid-wheezy-retro SD image, however I expect great improvements on both fronts (3.8 kernel and sunxi driver).

2013-05-28

A couple of updates for odroid-wheezy-retro (kernel 3.0.79 and 3.8.13)

I have released 2 scripts to upgrade your odroid-wheezy-retro image to a more recent kernel:


  • upgrade-3.0.75-to-3.0.79.sh, this will upgrade to the most recent 3.0.y kernel. This is currently stable & supported (by me) and will be in next SD image release (0.0.7); also contains a patch to silence the fan message spam in kern.log
  • upgrade-3.0.y-to-3.8.13.sh, this is experimental and subject to change without notice. This script will upgrade to a recent (consider it a nightly build) 3.8 kernel, complete with modules
NOTE: it does not work perfectly with X/X2 e.g. you will have to fix some issues manually
I have not yet decided when to put 3.8 on the odroid-wheezy-retro image - I am going to do some testing before that.

If you are installing 3.8 remember to change your device from /dev/fb6 to /dev/fb1 in /etc/X11/xorg.conf

Official ODROID forum discussion here.

2013-05-27

PCSX-ReARMed on ODROID-U2 (through RetroArch)


These notes are useful to get PCSX-ReARMed (by notaz) running on an ODROID-U2, with full ARM optimizations.

Due to some bug in the current configure/Makefiles, you will not be able to compile&run it succesffully. I got errors like this:
RetroArch [ERROR] :: dylib_load() failed: "pcsx_rearmed_libretro.so: undefined symbol: gteNCLIP_arm".
RetroArch [ERROR] :: Failed to open dynamic library: "pcsx_rearmed_libretro.so"
RetroArch [ERROR] :: Fatal error received in: "load_dynamic()"
And this:
RetroArch [ERROR] :: dylib_load() failed: "pcsx_rearmed_libretro.so: undefined symbol: gteRTPT_neon".
RetroArch [ERROR] :: Failed to open dynamic library: "pcsx_rearmed_libretro.so"
RetroArch [ERROR] :: Fatal error received in: "load_dynamic()"
 
So here you are some instructions to get it running.
First thing, get the libretro port:
git clone https://github.com/libretro/pcsx_rearmed

Apply this patch:

diff --git a/Makefile b/Makefile
index a472492..ed95702 100644
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,9 @@ CXXFLAGS += $(CFLAGS)
 #DRC_DBG = 1
 #PCNT = 1

+ARCH = arm
+HAVE_NEON=1
+
 all: config.mak target_ plugins_

 ifndef NO_CONFIG_MAK
diff --git a/Makefile.libretro b/Makefile.libretro
index 9436c8a..8a0d67a 100644
--- a/Makefile.libretro
+++ b/Makefile.libretro
@@ -97,8 +97,6 @@ else ifeq ($(platform), arm)
    DRC_CACHE_BASE = 0
    BUILTIN_GPU = neon
    ARCH = arm
-   CFLAGS += -marm -mcpu=cortex-a8 -mfpu=neon
-   ASFLAGS += -mcpu=cortex-a8 -mfpu=neon
 else
    TARGET := $(TARGET_NAME)_retro.dll
    CC = gcc

Now you're (almost) set. Run this script:

export CFLAGS='-marm -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard'
export CXXFLAGS='-marm -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard'
export ASFLAGS='-marm -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard'
./configure --enable-neon

make -j5 -f Makefile.libretro platform=arm

And enjoy PCSX-ReARMed on your ODROID :)

Issues

It is very slow! It's not performing very well, although all possible optimizations have been enabled. Update 26 June 2013: It's working very fast! Thanks to Squarepusher for the tip of using platform=arm :)

Furthermore, CSO/ISO are not working. Update 26 June 2013: I don't yet know how to work-around this, will publish a new post when I do

2013-05-18

odroid-wheezy-retro 0.6 released: you get kernel 3.0.75, 24bit HDMI output and wifi support!

As per title I have just released version 0.0.6 of the image that contains:
  • Hardkernel's linux kernel version 3.0.75, that comes with forced 24bit HDMI output (thanks to libv for the patch)
  • extra wifi drivers :)

If you have kernel 3.0.63 and want to upgrade just use the upgrade script from repository.

I am planning to release an even more streamlined release, so keep tuned! :)
Official ODROID forum discussion here.

2013-05-14

Recipe: compiling BSNES debugger (laevateinn) on Linux

BSNES is the best emulator around, there's little to say about that. Unfortunately the debugger is no more available in current higan because of refactoring and othe changes the author is making.

Let's get the last working bsnes debugger, laevateinn, compiling & working (spoiler: it.does.not.work) on Linux:

git clone git://gitorious.org/bsnes/bsnes.git
cd bsnes
git checkout v089
cd bsnes
nano nall/Makefile # replace "gcc-4.7" with "gcc"
make -j3 target=laevateinn

Finally the debugger will be found in out/laevateinn, but we are not yet there! It can only work with "cartridge folders".

So let's compile purify as well, and run it:

cd ..
cd purify
nano nall/Makefile # here replace "gcc-4.6" with "gcc"
make -j3
./purify output your-rom-path/ target-directory/


Now we are ready to run laevateinn:

cd ..
bsnes/out/laevateinn target-directory/

However, I could not use it because it shows me a non-sexy black screen :(
Possibly you might pick up the task from there.

Meanwhile I am using T.Geiger's snes9x debugger and I have contacted the author about sharing the sources (fingers crossed!)

Update 23 July 2013: instructions for Ubuntu 13.04 provided by user Jay Oster
NOTE: bsnes looks for its system ROMs in ~/.config/laevateinn/

Dependencies

$ sudo apt-get update
$ sudo apt-get install git build-essential libgtk2.0-dev libasound2-dev
# FOR PURIFY
$ sudo apt-get install libx11-dev

Build Laevateinn

$ git clone git://gitorious.org/bsnes/bsnes.git
$ cd bsnes
$ git checkout d418eda9
$ vim bsnes/nall/Makefile # replace "gcc-4.7" with "gcc"
$ make -C bsnes -j 8 target=laevateinn install

Build Purify

$ vim purify/nall/Makefile # replace "gcc-4.6" with "gcc"
$ vim purify/Makefile # add "link += `pkg-config --libs x11`"
$ make -C purify -j 8

PUTRIFY your ROM library

$ ./purify/purify output your-rom-path/ target-directory/