deveee
Posts: 4
Joined: Tue Oct 17, 2017 9:44 pm

Supertuxkart on Raspberry Pi

Tue Oct 17, 2017 10:08 pm

Hi,

I think that current git version (and upcoming 0.9.3 version) should work on Raspberry Pi. At least it works fine on Android devices with OpenGL ES renderer. The GLES renderer works also with mesa drivers on x86/x64 linux.

One thing that I'm not sure is if creating GLES context using EGL is enough to get hardware acceleration on RPi. It's probably true for vc4 driver, but I have no idea what about the proprietary one.

And second thing is that I'm not sure if STK will automatically fallback to legacy device (OpenGL ES 2.0), or maybe it will try to use GLES 3.0. AFAIK the Raspberry Pi GPU is only GLES 2.0. So if it will try to use GLES 3.0 (if no message about outdated/unsupported drivers), then something like this line should be added to graphical_restrictions.xml:

<card os="linux" disable="ForceLegacyDevice"/>


To enable GLES renderer in STK, you have to compile it with:

cmake .. -DUSE_GLES2=1

It would be nice if someone could test it, because currently I don't have access to any RPi device. And I can make some fixes before the 0.9.3 release.

User avatar
Gavinmc42
Posts: 1867
Joined: Wed Aug 28, 2013 3:31 am

Re: Supertuxkart on Raspberry Pi

Wed Oct 18, 2017 8:10 am

Been waiting for this for a few years.
It would be cool, especially if the network multiplay works.
Get kids playing then coding their own karts and designing tracks.

I try to avoid playing this with the kid now, he laughs too much when he beats me every single time :(
However a networked game setup with a few more Pi's will impress his friends.
Mini game arcade in the basement? Google for plans time?

Warzone2100 is now working pretty good with the OpenGL the Pi has now, 0AD at least boots.
6? months ago both had trouble.

If I knew how to compile I would give it a try, time to learn?
If it does work sudo apt-get install supertuxkart next?

Good multiplayer games on Pi's are not that common.
Kids love Supertuxkart :D
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
rpiMike
Posts: 451
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Supertuxkart on Raspberry Pi

Wed Oct 18, 2017 8:41 am

I've built it from the latest code :

https://github.com/supertuxkart/stk-code

Unfortunately the game only gets as far as showing the 'loading clock' and the game characters across the bottom - then appears to lock up the Pi except for the mouse cursor.

Video : https://youtu.be/oZ3-Zslsox8

deveee
Posts: 4
Joined: Tue Oct 17, 2017 9:44 pm

Re: Supertuxkart on Raspberry Pi

Wed Oct 18, 2017 9:58 am

Thanks a lot for testing!

Ok, so it at least created OpenGL ES context and shows some reasonable info in GL vendor/renderer/version.

You can try to disable HD textures and set lower textures size. This is what is set for Android by default. In ~/.config/supertuxkart/0.8.2/config.xml:

enable_high_definition_textures="0"
max_texture_size="256"

Or you can even set 128 for testing.

User avatar
rpiMike
Posts: 451
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Supertuxkart on Raspberry Pi

Wed Oct 18, 2017 10:30 am

Adding those 2 settings worked :)

deveee
Posts: 4
Joined: Tue Oct 17, 2017 9:44 pm

Re: Supertuxkart on Raspberry Pi

Wed Oct 18, 2017 11:39 am

That's great :)

Ok, so I will add these two params to graphical restrictions.

How much fps do you have in Hacienda or Cornfield Crossing?

I'm not sure what about "apt-get install supertuxkart". I think that using GLES for all arm devices in Debian repositories doesn't have a sense, because the GL renderer has more features and some devices may have proper OpenGL support. Maybe just create a ppa repository.

And not sure if you can check the proprietary driver and provide a log from console?

User avatar
rpiMike
Posts: 451
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Supertuxkart on Raspberry Pi

Wed Oct 18, 2017 12:05 pm

Full screen at 1280x720, on my slightly overclocked Pi3, with Cornfield Crossing I'm getting FPS 19/30/52 (I guess that's min,current,max?)

stdout.log :

[info ] [FileManager]: Data files will be fetched from: '../../data/'
[info ] [FileManager]: Data files will be fetched from: '../../data/../../stk-assets/'
[info ] [FileManager]: User directory is '/home/pi/.config/supertuxkart/0.8.2/'.
[info ] [FileManager]: Addons files will be stored in '/home/pi/.local/share/supertuxkart/addons/'.
[info ] [FileManager]: Screenshots will be stored in '/home/pi/.local/share/supertuxkart/screenshots/'.
[info ] [FileManager]: User-defined grand prix will be stored in '/home/pi/.local/share/supertuxkart/grandprix/'.
[info ] [FileManager]: Asset 0 will be loaded from '../../data/challenges/'.
[info ] [FileManager]: Asset 1 will be loaded from '../../data/gfx/'.
[info ] [FileManager]: Asset 2 will be loaded from '../../data/grandprix/'.
[info ] [FileManager]: Asset 3 will be loaded from '../../data/gui/'.
[info ] [FileManager]: Asset 4 will be loaded from '../../data/../../stk-assets/library/'.
[info ] [FileManager]: Asset 5 will be loaded from '../../data/../../stk-assets/models/'.
[info ] [FileManager]: Asset 6 will be loaded from '../../data/../../stk-assets/music/'.
[info ] [FileManager]: Asset 7 will be loaded from '../../data/replay/'.
[info ] [FileManager]: Asset 8 will be loaded from '../../data/../../stk-assets/tracks/'.
[info ] [FileManager]: Asset 9 will be loaded from '../../data/../../stk-assets/sfx/'.
[info ] [FileManager]: Asset 10 will be loaded from '../../data/shaders/'.
[info ] [FileManager]: Asset 11 will be loaded from '../../data/skins/'.
[info ] [FileManager]: Asset 12 will be loaded from '../../data/../../stk-assets/textures/'.
[info ] [FileManager]: Asset 13 will be loaded from '../../data/ttf/'.
[info ] [FileManager]: Asset 14 will be loaded from '../../data/po/'.
[verbose ] translation: Env var LANGUAGE = 'en_GB.UTF-8'.
[verbose ] translation: Language 'English (Great Britain)'.
[warn ] tinygettext: jbo.po: warning: ignoring, unknown language
[warn ] tinygettext: no.po: warning: ignoring, unknown language
[warn ] tinygettext: no_NO.po: warning: ignoring, unknown language
[warn ] tinygettext: sc.po: warning: ignoring, unknown language
[warn ] tinygettext: sco.po: warning: ignoring, unknown language
[warn ] tinygettext: jbo.po: warning: ignoring, unknown language
[warn ] tinygettext: no.po: warning: ignoring, unknown language
[warn ] tinygettext: no_NO.po: warning: ignoring, unknown language
[warn ] tinygettext: sc.po: warning: ignoring, unknown language
[warn ] tinygettext: sco.po: warning: ignoring, unknown language
[info ] IrrDriver: OpenGL version: 2.1
[info ] IrrDriver: OpenGL vendor: Broadcom
[info ] IrrDriver: OpenGL renderer: Gallium 0.4 on VC4 V3D 2.1
[info ] IrrDriver: OpenGL version string: OpenGL ES 2.0 Mesa 13.0.6
[info ] GLDriver: EXT texture format BGRA8888 Present
[warn ] irr_driver: Driver doesn't support shader-based pipeline. Re-creating device to workaround the issue.
[info ] IrrDriver: OpenGL version: 2.1
[info ] IrrDriver: OpenGL vendor: Broadcom
[info ] IrrDriver: OpenGL renderer: Gallium 0.4 on VC4 V3D 2.1
[info ] IrrDriver: OpenGL version string: OpenGL ES 2.0 Mesa 13.0.6
[info ] GLDriver: EXT texture format BGRA8888 Present
[warn ] irr_driver: Using the fixed pipeline (old GPU, or shaders disabled in options)
[info ] HTTPRequest: Downloading http://addons.supertuxkart.net/dl/xml/news.xml
[info ] addons: Using cached addons.xml.
[info ] HTTPRequest: Downloading http://addons.supertuxkart.net/dl/image ... 517f49.png
[info ] HTTPRequest: Downloading http://addons.supertuxkart.net/dl/image ... 3e4cd1.jpg
[info ] GrandPrixManager: Loading Grand Prix files from ../../data/grandprix/
[info ] GrandPrixManager: Loading Grand Prix files from /home/pi/.local/share/supertuxkart/grandprix/
[warn ] OpenGL: OpenGL version is too old!
[verbose ] RaceManager: Nb of karts=4, ghost karts:0 ai:3 players:1

[warn ] material: Track uses deprecated texture 'redwhite.png'
[info ] Singleton: Destroyed singleton.
[info ] Singleton: Destroyed singleton.
[info ] Singleton: Destroyed singleton.
[info ] Singleton: Destroyed singleton.

User avatar
rpiMike
Posts: 451
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Supertuxkart on Raspberry Pi

Wed Oct 18, 2017 12:53 pm

SuperTuxKart running at 1280x720 on my Pi3 :

https://youtu.be/fPd2G_qc_jk

deveee
Posts: 4
Joined: Tue Oct 17, 2017 9:44 pm

Re: Supertuxkart on Raspberry Pi

Wed Oct 18, 2017 8:01 pm

Ok, now I force max texture size <= 256 for Raspberry Pi:
https://github.com/supertuxkart/stk-cod ... 9b4ec953bd

So now it should work without any additional modifications.

ianosburn
Posts: 11
Joined: Tue Jan 22, 2013 7:38 pm

Re: Supertuxkart on Raspberry Pi

Sun Dec 17, 2017 9:29 pm

Hi, did this ever get put in a ppa or do we need to compile from source to get this working in raspbian stretch? Thanks.

User avatar
rpiMike
Posts: 451
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Supertuxkart on Raspberry Pi

Mon Dec 18, 2017 2:58 pm

As far as I am aware you still need to compile from source.

ianosburn
Posts: 11
Joined: Tue Jan 22, 2013 7:38 pm

Re: Supertuxkart on Raspberry Pi

Thu Dec 28, 2017 10:28 pm

Thanks. I tried to compile the latest git version of stk-code using GLESv2 but even with the GLES2 flag set during cmake it fails as an addon apparently still looks for GLES3.

I basically followed the README.md for stk-code (from https://github.com/supertuxkart/stk-code).

On the first try cmake failed as EGL_INCLUDE_DIR and EGL_LIBRARY were not set. So the command I used for the cmake was:

Code: Select all

cmake .. -DUSE_GLES2=1 -DEGL_INCLUDE_DIR=/opt/vc/include -DEGL_LIBRARY=/usr/lib/arm-linux-gnueabihf/libEGL.so.1
which completed successfully. However when I call make -j 4, it fails with output to stderr of:

Code: Select all

In file included from /home/pi/supertuxkart/stk-code/src/graphics/abstract_renderer.hpp:21:0,
                 from /home/pi/supertuxkart/stk-code/src/graphics/irr_driver.hpp:36,
                 from /home/pi/supertuxkart/stk-code/src/addons/zip.cpp:22:
/home/pi/supertuxkart/stk-code/src/graphics/gl_headers.hpp:47:27: fatal error: GLES3/gl3.h: No such file or directory
 #    include <GLES3/gl3.h>
                           ^
compilation terminated.
make[2]: *** [CMakeFiles/supertuxkart.dir/src/addons/zip.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/pi/supertuxkart/stk-code/src/graphics/abstract_renderer.hpp:21:0,
                 from /home/pi/supertuxkart/stk-code/src/graphics/irr_driver.hpp:36,
                 from /home/pi/supertuxkart/stk-code/src/guiengine/widgets/model_view_widget.hpp:25,
                 from /home/pi/supertuxkart/stk-code/src/guiengine/widgets.hpp:29,
                 from /home/pi/supertuxkart/stk-code/src/states_screens/dialogs/addons_loading.hpp:24,
                 from /home/pi/supertuxkart/stk-code/src/states_screens/addons_screen.hpp:24,
                 from /home/pi/supertuxkart/stk-code/src/addons/news_manager.cpp:24:
/home/pi/supertuxkart/stk-code/src/graphics/gl_headers.hpp:47:27: fatal error: GLES3/gl3.h: No such file or directory
 #    include <GLES3/gl3.h>
                           ^
compilation terminated.
make[2]: *** [CMakeFiles/supertuxkart.dir/src/addons/news_manager.cpp.o] Error 1
make[1]: *** [CMakeFiles/supertuxkart.dir/all] Error 2
make: *** [all] Error 2
Despite the -DUSE_GLES2=1, it seems to be expecting GLES3.

As someone who has successfully complied it, can you give me a any pointers?

Thanks very much

ianosburn
Posts: 11
Joined: Tue Jan 22, 2013 7:38 pm

Re: Supertuxkart on Raspberry Pi

Fri Dec 29, 2017 10:35 pm

I should add this is on a Pi3 using a new install of Raspbian Lite Stretch.

I’ve also asked this question on the stk freegamedev forum.

Be great if this can be made to work. I’ll then offer to update the README.md on github with Pi specific compilation instructions.

Any idea what’s going wrong?

jdonald
Posts: 34
Joined: Fri Nov 03, 2017 4:36 pm

Re: Supertuxkart on Raspberry Pi

Sat Dec 30, 2017 4:52 am

Code: Select all

$ apt-file search gl3.h
khronos-api: /usr/include/khronos-api/GLES3/gl3.h
libgles2-mesa-dev: /usr/include/GLES3/gl3.h
It appears you didn't install libgles2-mesa-dev. If you were following README.md, unfortunately on the surface it omits sudo apt install libgles2-mesa-dev libegl1-mesa-dev because it's primarily geared toward the OpenGL configuration.

Unrelated: Some time back I posted a hacked Irrrlicht that can use the legacy Broadcom driver with Minetest. However, it can't be easily tested here because the stk-code repo embeds its own version of Irrlicht (v1.8) which is pretty different with regards to CEGLManager.cpp. @deveee is STK necessarily tied to this or could it be upgraded to v1.9?

User avatar
rpiMike
Posts: 451
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Supertuxkart on Raspberry Pi

Sat Dec 30, 2017 9:01 am

ianosburn wrote:
Fri Dec 29, 2017 10:35 pm
I should add this is on a Pi3 using a new install of Raspbian Lite Stretch.

I’ve also asked this question on the stk freegamedev forum.

Be great if this can be made to work. I’ll then offer to update the README.md on github with Pi specific compilation instructions.

Any idea what’s going wrong?
As far as I am aware Supertuxkart needs to be run within the Desktop. So you should be using Raspbian Stretch with Desktop.

brownpaperandstring
Posts: 1
Joined: Sat Dec 30, 2017 11:47 am

Re: Supertuxkart on Raspberry Pi

Sat Dec 30, 2017 11:55 am

I tried remaking with the gles2 flag, but whilst I can just about get to the start of a race now, I am getting less than 1fps. I tried turning the graphics right down to 128 and putting the os flag in graphical restrictions (although I also did an apt-get of what seems to be 0.9.2 so I have two versions)

I am really out of practice with Linux desktop stuff so it’s a bit of an uphill struggle atm, I am not even sure how to check which of my builds is the one that’s running.. I’m using a rasbpi3b with a standard raspbian install, updated.

I guess I need to work out how to remove properly the version(s) I built and rebuild to be sure.

User avatar
rpiMike
Posts: 451
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Supertuxkart on Raspberry Pi

Sat Dec 30, 2017 2:58 pm

brownpaperandstring wrote:
Sat Dec 30, 2017 11:55 am
I tried remaking with the gles2 flag, but whilst I can just about get to the start of a race now, I am getting less than 1fps. I tried turning the graphics right down to 128 and putting the os flag in graphical restrictions (although I also did an apt-get of what seems to be 0.9.2 so I have two versions)

I am really out of practice with Linux desktop stuff so it’s a bit of an uphill struggle atm, I am not even sure how to check which of my builds is the one that’s running.. I’m using a rasbpi3b with a standard raspbian install, updated.

I guess I need to work out how to remove properly the version(s) I built and rebuild to be sure.
Have you enabled the OpenGL driver in raspi-config ?

ianosburn
Posts: 11
Joined: Tue Jan 22, 2013 7:38 pm

Re: Supertuxkart on Raspberry Pi

Sat Dec 30, 2017 8:14 pm

Great! Spot on with the missing libgles2-mesa-dev libegl1-mesa-dev packages.

That was also the reason I was having to specify EGL_INCLUDE and EGL_LIBRARY too. cmake now works with just -DUSE_GLES2=1.

Compiling as we speak. I've also enables OpenGL with full KMS.

Should I allocated 256MB to the GPU using raspi-config or does it not matter? 128MB allocated currently.

ianosburn
Posts: 11
Joined: Tue Jan 22, 2013 7:38 pm

Re: Supertuxkart on Raspberry Pi

Sat Dec 30, 2017 10:13 pm

Well it compiled but runs at less than 1FPS.

Some things to note:

This is on a dual boot Raspbian Stretch Full on a Pi3b. The dual boot means it cannot be overclocked by raspi-config.

I used -DUSE_GLES2=1 and put<card os="linux" disable="ForceLegacyDevice"/> in graphical_restrictions.xml

Edited config.xml with enable_high_definition_textures="0" and max_texture_size="128".

GPU memory set to 256MB.

In game options graphics level set to 1 and music off.

I turned on OpenGL and tried it with both full KMS and fake KMS.

Despite all that, its unusable and less than 1FPS.

I've no idea how the YouTube video got to 30FPS without smoke coming out of it!

Any ideas how to get it to usable performance?

jdonald
Posts: 34
Joined: Fri Nov 03, 2017 4:36 pm

Re: Supertuxkart on Raspberry Pi

Sun Dec 31, 2017 12:50 am

Runs at ~30 fps on a Pi 3 for me, no overclocking.
ianosburn wrote:
Sat Dec 30, 2017 10:13 pm
Well it compiled but runs at less than 1FPS.
I know you said you tried OpenGL with full KMS but this really sounds like the typical symptoms of when it's disabled. What framerate does glxgears report? (sudo apt install mesa-utils). If anything less than 60, I would double-check that you rebooted after running sudo raspi-config to select the driver, and that dtoverlay=vc4-kms-v3d is present in /boot/config.txt
ianosburn wrote:
Sat Dec 30, 2017 10:13 pm
I used -DUSE_GLES2=1 and put<card os="linux" disable="ForceLegacyDevice"/> in graphical_restrictions.xml

Edited config.xml with enable_high_definition_textures="0" and max_texture_size="128".
deveee's commit 1a9cf6a already takes care of this so it isn't necessary to configure texture sizes via config.xml. I also didn't make any edits to graphical_restrictions.xml, so could that be causing the problem?
brownpaperandstring wrote:
Sat Dec 30, 2017 11:55 am
(although I also did an apt-get of what seems to be 0.9.2 so I have two versions)
I recall the Raspbian Apt repository has 0.8.2 nowadays (and it's unusable), so remove this complication by running sudo apt remove supertuxkart

User avatar
rpiMike
Posts: 451
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Supertuxkart on Raspberry Pi

Thu Jan 04, 2018 9:50 am

ianosburn wrote:
Sat Dec 30, 2017 10:13 pm
Well it compiled but runs at less than 1FPS.

Some things to note:

This is on a dual boot Raspbian Stretch Full on a Pi3b. The dual boot means it cannot be overclocked by raspi-config.

I used -DUSE_GLES2=1 and put<card os="linux" disable="ForceLegacyDevice"/> in graphical_restrictions.xml

Edited config.xml with enable_high_definition_textures="0" and max_texture_size="128".

GPU memory set to 256MB.

In game options graphics level set to 1 and music off.

I turned on OpenGL and tried it with both full KMS and fake KMS.

Despite all that, its unusable and less than 1FPS.

I've no idea how the YouTube video got to 30FPS without smoke coming out of it!

Any ideas how to get it to usable performance?
Are you using BerryBoot for your dual booting - I don't believe OpenGL will work with this.

ianosburn
Posts: 11
Joined: Tue Jan 22, 2013 7:38 pm

Re: Supertuxkart on Raspberry Pi

Mon Jan 08, 2018 9:29 am

Yes. I think you’ve hit on hit - thank you. I did a make clean and checked the OpenGL settings. It all seemed to be set correctly so couldn’t understand it.

Given the issues with squashfs and updating I can see why most people give multi boot Pi a miss.

Thanks - you’ve solved something that was driving me crazy.

Do you know a good solution otherwise I’ll move to the same - the inconvenience is worth it to not run into issues.

ianosburn
Posts: 11
Joined: Tue Jan 22, 2013 7:38 pm

Re: Supertuxkart on Raspberry Pi

Thu Jan 11, 2018 8:49 am

Garbled my previous message. If you know a good multiboot solution please let me know.

I’m planning to go single boot cards only - it’s been too problematic using BerryBoot.

Thanks.

User avatar
Gavinmc42
Posts: 1867
Joined: Wed Aug 28, 2013 3:31 am

Re: Supertuxkart on Raspberry Pi

Thu Jan 11, 2018 9:07 am

If you know a good multiboot solution please let me know.
Net boot from a x86 Pi-Server?
Could have RetroPi/Raspbian/PiCore..... options?
Have not tired this yet, need to find a spare x86 box.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 3 guests