Minetest on Rasbpberry Pi

User avatar
AgentNagel42
Member
 
Posts: 33
Joined: Tue Sep 09, 2014 15:41
In-game: AgentNagel42

Re: Minetest on Rasbpberry Pi

by AgentNagel42 » Fri Sep 04, 2015 12:19

Lol I could only afford for my pi as my pc up until a couple months ago, I used my friends computer for minetest. lol.
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

Re: Minetest on Rasbpberry Pi

by philipbenr » Fri Sep 04, 2015 16:25

I heard it runs better on the raspberry pi 2... Quad core @ 900MHz ARM Cortex v7 It is overclockable, and some have even made it to 1GHz fine. The 1GB of RAM really helps too.
 

Amicadi
Member
 
Posts: 13
Joined: Fri Sep 04, 2015 00:40

Re: Minetest on Rasbpberry Pi

by Amicadi » Fri Sep 04, 2015 19:36

benrob0329 wrote:I have an Rpi2, I could try building MT from source. I don't do much with it, it pretty much just sits around with Drupal running on top of Apache, so it wouldn't matter if it Sat there for a couple days compiling.


Heh, it doesn't take couple of days. Compile times are around 1 hour for Irrlicht and around 30 mins for Minetest (Compiling directly at Rasperry Pi 2 device). My built (OpenGL 2.1) got running at 3fps. Then I spent hours trying to compile Irrlicht with OpenGL ES support without luck.
 

Amicadi
Member
 
Posts: 13
Joined: Fri Sep 04, 2015 00:40

Re: Minetest on Rasbpberry Pi

by Amicadi » Fri Sep 04, 2015 19:59

philipbenr wrote:I heard it runs better on the raspberry pi 2... Quad core @ 900MHz ARM Cortex v7 It is overclockable, and some have even made it to 1GHz fine. The 1GB of RAM really helps too.


At the profiler (F5 x 2) can be seen that the mainloop_draw is at 100% almost constantly. Other loops take almost no processing time. I believe the issue is OpenGL / OpenGL ES
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: Minetest on Rasbpberry Pi

by Sokomine » Fri Sep 04, 2015 20:16

Amicadi wrote:Heh, it doesn't take couple of days. Compile times are around 1 hour for Irrlicht and around 30 mins for Minetest (Compiling directly at Rasperry Pi 2 device). My built (OpenGL 2.1) got running at 3fps. Then I spent hours trying to compile Irrlicht with OpenGL ES support without luck.

That's a pretty bad result. The compile time is fine - doesn't matter if it takes a while to compile. But 3 fps is really a bit low. Far lower than on smartphones and tablets. Of course the view range is low there. The resolution and view range may matter as well.
A list of my mods can be found here.
 

Amicadi
Member
 
Posts: 13
Joined: Fri Sep 04, 2015 00:40

Re: Minetest on Rasbpberry Pi

by Amicadi » Fri Sep 04, 2015 22:13

Sokomine wrote:That's a pretty bad result. The compile time is fine - doesn't matter if it takes a while to compile. But 3 fps is really a bit low. Far lower than on smartphones and tablets. Of course the view range is low there. The resolution and view range may matter as well.


That result is for Raspberry pi 2 with no overclocking running Minitest at window size 800x600 running at official raspbian-2015-05-05 Xserver with display configured as 1184x624 pixels.

With these extra options:

enable_3d_clouds = false
enable_particles = false
enable_shaders = false
leaves_style = opaque
viewing_range_nodes_min = 48
viewing_range_nodes_max = 48

So, very very low as you can see. Even with viewport on my feet I get no fps change, stuck at 2-3 fps. Pretty low and unplayable. Android Minetest is OK, tho... and just because irrlicht is compiled with OPENGL ES support for android version, I guess :-)
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

Re: Minetest on Rasbpberry Pi

by philipbenr » Fri Sep 04, 2015 22:32

I heard there was a way to get Minetest to run at 20ish fps on a raspberry pi model B+. 4aiman and a couple others did get it running... Take a bit of time searching and you'll find it...
 

Amicadi
Member
 
Posts: 13
Joined: Fri Sep 04, 2015 00:40

Re: Minetest on Rasbpberry Pi

by Amicadi » Fri Sep 04, 2015 22:54

philipbenr wrote:I heard there was a way to get Minetest to run at 20ish fps on a raspberry pi model B+. 4aiman and a couple others did get it running... Take a bit of time searching and you'll find it...


Do you mean this?

philipbenr wrote:
Hiradur wrote: Did somebody try glshim for hardware acceleration?
https://github.com/lunixbochs/glshim


//EDIT: It works. I tested it with MT 0.3.1. Text is unreadable, some textures are distorted but the framerate ranges from 3-20fps I guess (although it goes down the longer you play).

Tutorial on how to set up glshim:
http://www.raspberrypi.org/phpBB3/viewt ... 4&p=479445


I also found this:

xranby wrote:I get between 11-15fps when I am running minetest from Raspbian using the new Mesa3d vc4 OpenGL 2 driver on a RaspberryPi 2
You can read more about this new driver here: https://www.raspberrypi.org/forums/view ... 05#p802205


I haven't tried yet, but I believe that Minetest compiled along with irrlicht with OpenGL ES support (as Minetest android version is compiled) would be the correct way (and would have better performance) for Raspberry pi. or?
 

User avatar
AgentNagel42
Member
 
Posts: 33
Joined: Tue Sep 09, 2014 15:41
In-game: AgentNagel42

Re: Minetest on Rasbpberry Pi

by AgentNagel42 » Fri Sep 04, 2015 23:18

This seems promising, if we could build it and somehow solve the "slowing over time" somehow. It would take some optimising, I'm gunna try and get in touch with one of the devs over at the pi forum and see if we can get some help
 

Amicadi
Member
 
Posts: 13
Joined: Fri Sep 04, 2015 00:40

Re: Minetest on Rasbpberry Pi

by Amicadi » Sat Sep 05, 2015 12:29

Minetest with glshim at Rasberry pi 2 executed as:

LD_LIBRARY_PATH=/home/pi/glshim/lib LIBGL_FB=1 minetest

Fails with this output:

libGL:loaded: libbcm_host.so
libGL:loaded: libvcos.so
libGL:loaded: /opt/vc/lib/libGLESv1_CM.so
libGL:loaded: libEGL.so
ACTION[Main]: Irrlicht Could not create GLX window
ERROR[Main]: Could not initialize game engine

Same failure and output for Minetest at raspbian-2015-05-05 repository and the version compiled by me (along with irrlicht 1.8.2 with OpenGL support)

I guess this is because glshim only translates Open GL 1 to OpenGL ES 1???. Bloboats works very nicely with glshim at raspberry pi 2, tho :-)

So, now I am trying Minetest with Mesa3d vc4 OpenGL 2 (which translates OpenGL 1 and 2.1 to OpenGL ES 1 and 2) https://www.raspberrypi.org/forums/view ... 05#p802205 ... just to check if Minetest is playable with this driver at RPI2
 

User avatar
FreeLikeGNU
Member
 
Posts: 119
Joined: Tue Oct 28, 2014 02:50
GitHub: FreeLikeGNU
IRC: freelikegnu
In-game: FreeLikeGNU

Re: Minetest on Rasbpberry Pi

by FreeLikeGNU » Sun Sep 06, 2015 22:11

I'd be happy just to run MT as a server on an RPi2, has anyone found this to work well?
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

Re: Minetest on Rasbpberry Pi

by philipbenr » Sun Sep 06, 2015 23:28

I have heard that it runs fine. I think that was even stated earlier in the thread...
 

Amicadi
Member
 
Posts: 13
Joined: Fri Sep 04, 2015 00:40

Re: Minetest on Rasbpberry Pi

by Amicadi » Mon Sep 07, 2015 00:09

I tested today the available raspbian patched with Mesa3d vc4 OpenGL 2 images at http://sukzessiv.net/~gohai/vc4-buildbot/build/ (at the moment of writing this post 20150808-1312-vc4-image.zip and 20150821-1625-vc4-image.zip) and I was able to run Minetest in none of them. Minetest terminates with no output log... I was able to run and play for a while with the Processing 3D application. But, well, raspbian patched with Mesa3d vc4 OpenGL 2 looks like is right now in development state, so I think I'll keep looking at it.
 

Dartmouth
Member
 
Posts: 121
Joined: Sat Dec 06, 2014 14:39
IRC: pilino1234

Re: Minetest on Rasbpberry Pi

by Dartmouth » Mon Sep 07, 2015 06:41

Yes, minetestserver runs nicely on the RPi, although I haven't tried with several players or heavier mods (technic + pipeworks or mobs) yet. Mapgen is just a bit slower, but it doesn't really hinder gameplay.
 

Ivà
Member
 
Posts: 115
Joined: Sun Feb 22, 2015 07:11
GitHub: melzua
IRC: melzua
In-game: melzua

Re: Minetest on Rasbpberry Pi

by Ivà » Mon Sep 07, 2015 07:50

FreeLikeGNU wrote:I'd be happy just to run MT as a server on an RPi2, has anyone found this to work well?


I have an RPi 1 (1 not 2 :) ) running a home personal server with 3 people playing on it simultaneously and it works reasonably well.

Bottleneck on RPi1 is the lack of CPU power, so for example when it generates new map freezes for a while.
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: Minetest on Rasbpberry Pi

by 4aiman » Mon Sep 07, 2015 12:06

Ivà is right.

Generating a whole map on a desktop and then copying that to RPi helps to run almost any subgame relatively "normal" if the use of entities and serialization is restricted (i.e. no mobs, as few "minetest.show_formspec" calls as possible, as few writes to a disk as possible).


Just a note: use qemu or cross-compiler to compile for armhf. RPi does that very slow (it took my nearly 6 hours for my RPi to download all dependencies, libs, compile those and finally start a server).
 

Amicadi
Member
 
Posts: 13
Joined: Fri Sep 04, 2015 00:40

Re: Minetest on Rasbpberry Pi

by Amicadi » Tue Sep 08, 2015 13:17

I continued trying to compile Minetest as client with OpenGL ES 2 for enjoying a decent framerate in my Raspberry pi 2.

Finally I got Irrlicht (ogl-es branch) compiled with OpenGL ES 1 and 2 support.

Then, I continued compiling Minetest:

cmake . -DBCMHOST=1 -DENABLE_GLES=1

returned:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
-- *** Will build version 0.4.13-dev ***
-- cURL support enabled.
-- GetText disabled.
-- Sound enabled.
-- Found system OpenGL ES 2 library: /usr/lib/arm-linux-gnueabihf/libGLESv2.so;/usr/lib/arm-linux-gnueabihf/libX11.so;/usr/lib/arm-linux-gnueabihf/libXext.so;/usr/lib/arm-linux-gnueabihf/libGLESv2.so
-- Could NOT find Freetype (missing:  FREETYPE_INCLUDE_DIRS)
-- LuaJIT not found, using bundled Lua.
-- Using GMP provided by system.
-- LevelDB not found!
-- Redis not found!
-- Using bundled JSONCPP library.
-- SpatialIndex not found!
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    BCMHOST


-- Build files have been written to: /home/pi/minetest


and after: make -j 4

I got several errors at final linking with Irrlicht:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Linking CXX executable ../bin/minetest
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(COGLESDriver.o): In function `irr::video::COGLES1Driver::drawVertexPrimitiveList2d3d(void const*, unsigned int, void const*, unsigned int, irr::video::E_VERTEX_TYPE, irr::scene::E_PRIMITIVE_TYPE, irr::video::E_INDEX_TYPE, bool)':
/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLESDriver.cpp:773: undefined reference to `glPointSizePointerOES'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(COGLESDriver.o): In function `irr::video::COGLES1Driver::uploadClipPlane(unsigned int)':
/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLESDriver.cpp:3098: undefined reference to `glClipPlanef'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(COGLESExtensionHandler.o): In function `irr::video::COGLES1ExtensionHandler::initExtensions(irr::video::COGLES1Driver*, bool)':
/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLESExtensionHandler.cpp:248: undefined reference to `eglGetProcAddress'
/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLESExtensionHandler.cpp:249: undefined reference to `eglGetProcAddress'
/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLESExtensionHandler.cpp:250: undefined reference to `eglGetProcAddress'
/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLESExtensionHandler.cpp:251: undefined reference to `eglGetProcAddress'
/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLESExtensionHandler.cpp:255: undefined reference to `eglGetProcAddress'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(COGLESExtensionHandler.o):/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLESExtensionHandler.cpp:259: more undefined references to `eglGetProcAddress' follow
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(COGLES2Driver.o): In function `irr::video::COGLES2Driver::testEGLError()':
/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLES2Driver.cpp:1663: undefined reference to `eglGetError'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::initialize(irr::SIrrlichtCreationParameters const&, irr::video::SExposedVideoData const&)':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:48: undefined reference to `eglGetDisplay'
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:66: undefined reference to `eglInitialize'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::terminate()':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:88: undefined reference to `eglMakeCurrent'
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:90: undefined reference to `eglTerminate'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::generateSurface()':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:160: undefined reference to `eglChooseConfig'
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:249: undefined reference to `eglCreateWindowSurface'
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:252: undefined reference to `eglCreateWindowSurface'
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:259: undefined reference to `eglBindAPI'
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:263: undefined reference to `eglSwapInterval'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::destroySurface()':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:274: undefined reference to `eglMakeCurrent'
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:276: undefined reference to `eglDestroySurface'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::generateContext()':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:310: undefined reference to `eglCreateContext'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::destroyContext()':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:329: undefined reference to `eglMakeCurrent'
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:330: undefined reference to `eglDestroyContext'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::activateContext(irr::video::SExposedVideoData const&)':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:337: undefined reference to `eglMakeCurrent'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::swapBuffers()':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:354: undefined reference to `eglSwapBuffers'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::testEGLError()':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:360: undefined reference to `eglGetError'
collect2: ld returned 1 exit status
src/CMakeFiles/minetest.dir/build.make:4826: recipe for target 'bin/minetest' failed
make[2]: *** [bin/minetest] Error 1
CMakeFiles/Makefile2:132: recipe for target 'src/CMakeFiles/minetest.dir/all' failed
make[1]: *** [src/CMakeFiles/minetest.dir/all] Error 2
Makefile:133: recipe for target 'all' failed
make: *** [all] Error 2


Here I got stuck. Looking around for a solution I found Megaf's attempt trying the same and with same result: https://gist.github.com/Megaf/bcae0c623ca46ca29773

Any ideas?
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: Minetest on Rasbpberry Pi

by 4aiman » Tue Sep 08, 2015 13:31

The last time I've tried, it worked like a charm...
I'll try to build the latest dev MT by tomorrow's morning and let you know about it.

PS: what is BCMHOST?
 

Amicadi
Member
 
Posts: 13
Joined: Fri Sep 04, 2015 00:40

Re: Minetest on Rasbpberry Pi

by Amicadi » Tue Sep 08, 2015 14:01

4aiman wrote:The last time I've tried, it worked like a charm...
I'll try to build the latest dev MT by tomorrow's morning and let you know about it.

PS: what is BCMHOST?


Did you try building Minetest with OpenGL ES support and it worked? If so... you are my man :-)

BCMHOST? you are right, I have no idea. I think I saw it somewhere or maybe something at my .bash_history from other compilation (EDIT: yes, from glshim), but I see that it is completely ignored at cmake :-P

Indeed, BCMHOST=1 flag should be: -DRUN_IN_PLACE=1

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
CMake Warning:
  Manually-specified variables were not used by the project:

    BCMHOST


Still, recompiling as:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
cmake . -DRUN_IN_PLACE=1 -DENABLE_GLES=1
make -j 4


I got same error.
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: Minetest on Rasbpberry Pi

by 4aiman » Wed Sep 09, 2015 06:14

I did, and it worked...
... but that was a little while ago :)


I've tried to compile the latest MT last night, but sadly it didn't finish even half of it when I came up.
And I'll be too late at home today to be able to check what's going on or to post some updates here.
So, it looks like Friday will be the day.


I also have an RPi emu, so I'm trying to build there right now.
 

Ivà
Member
 
Posts: 115
Joined: Sun Feb 22, 2015 07:11
GitHub: melzua
IRC: melzua
In-game: melzua

Re: Minetest on Rasbpberry Pi

by Ivà » Wed Sep 09, 2015 06:48

4aiman wrote:I've tried to compile the latest MT last night, but sadly it didn't finish even half of it when I came up.


Uhmmmm... 4aiman I compile the git MT server on my RPi 1 in about 90 minutes. I don't use any special trick to do it and my RPI 1 is only slightly overclocked (800 MHz).
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: Minetest on Rasbpberry Pi

by 4aiman » Wed Sep 09, 2015 07:42

Try performing a "clean" compilation and see the difference.

BTW, if you're able to do what is needed, then it would be cool to share your way of doing it and free me from performing useless activity ;)
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: Minetest on Rasbpberry Pi

by 4aiman » Wed Sep 09, 2015 11:41

@Amicadi

You need to either build OGLES Irrlicht or supply a egl header and library.
The first way worked for me. (Haven't try the second way at all.)

Anyway, you'll need to install libgl-mesa-x11-dev (look through this thread to find the exact name - it's not that long)
I
Then search for header and libs in /opt/vc/include and use those to build the client.


PS: This
http://dev.minetest.net/CMake_Options wrote:OpenGL ES
EGL_INCLUDE_DIR - directory that contains egl.h
EGL_LIBRARY - path to libEGL.a/libEGL.so
OPENGLES2_INCLUDE_DIR - directory that contains gl2.h
OPENGLES2_LIBRARY - path to libGLESv2.a/libGLESv2.so

doesn't work without ENABLE_GLES=1
 

Amicadi
Member
 
Posts: 13
Joined: Fri Sep 04, 2015 00:40

Re: Minetest on Rasbpberry Pi

by Amicadi » Wed Sep 09, 2015 12:03

4aiman wrote:@Amicadi

You need to either build OGLES Irrlicht or supply a egl header and library.
The first way worked for me. (Haven't try the second way at all.)

Anyway, you'll need to install libgl-mesa-x11-dev (look through this thread to find the exact name - it's not that long)
I
Then search for header and libs in /opt/vc/include and use those to build the client.


PS: This
http://dev.minetest.net/CMake_Options wrote:OpenGL ES
EGL_INCLUDE_DIR - directory that contains egl.h
EGL_LIBRARY - path to libEGL.a/libEGL.so
OPENGLES2_INCLUDE_DIR - directory that contains gl2.h
OPENGLES2_LIBRARY - path to libGLESv2.a/libGLESv2.so

doesn't work without ENABLE_GLES=1


Yes at raspbian2015-05-05:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
pi@pi ~ $ apt-cache search libgl mesa x11
libgl1-mesa-dev - free implementation of the OpenGL API -- GLX development files
libgl1-mesa-dri - free implementation of the OpenGL API -- DRI modules
libgl1-mesa-dri-dbg - Debugging symbols for the Mesa DRI modules
libgl1-mesa-dri-experimental - free implementation of the OpenGL API -- Extra DRI modules
libgl1-mesa-dri-experimental-dbg - Debugging symbols for the experimental Mesa DRI modules
libgl1-mesa-glx - free implementation of the OpenGL API -- GLX runtime
libgl1-mesa-glx-dbg - Debugging symbols for the Mesa GLX runtime
libgl1-mesa-swx11 - free implementation of the OpenGL API -- runtime
libgl1-mesa-swx11-dbg - free implementation of the OpenGL API -- debugging symbols
libgl1-mesa-swx11-dev - free implementation of the OpenGL API -- development files


I was missing libgl1-mesa-swx11-dev, in its place i had libgl1-mesa-dev:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
dpkg: libgl1-mesa-dev: dependency problems, but removing anyway as you requested:
 libglu1-mesa-dev depends on libgl1-mesa-dev | libgl-dev; however:
  Package libgl1-mesa-dev is to be removed.
  Package libgl-dev is not installed.
  Package libgl1-mesa-dev which provides libgl-dev is to be removed.
 libglu1-mesa-dev depends on libgl1-mesa-dev | libgl-dev; however:
  Package libgl1-mesa-dev is to be removed.
  Package libgl-dev is not installed.
  Package libgl1-mesa-dev which provides libgl-dev is to be removed.
(Reading database ... 92051 files and directories currently installed.)
Removing libgl1-mesa-dev ...


After that, sudo apt-get install libgl1-mesa-swx11-dev and recompiling the whole thing with best hopes :-)
Last edited by Amicadi on Wed Sep 09, 2015 12:06, edited 1 time in total.
 

Ivà
Member
 
Posts: 115
Joined: Sun Feb 22, 2015 07:11
GitHub: melzua
IRC: melzua
In-game: melzua

Re: Minetest on Rasbpberry Pi

by Ivà » Wed Sep 09, 2015 12:05

4aiman wrote:Try performing a "clean" compilation and see the difference.

BTW, if you're able to do what is needed, then it would be cool to share your way of doing it and free me from performing useless activity ;)


As I said before I don't do any special trick, just git clone, cmake and make. Note that I said that I'm only compiling the server, not irrlicht or opengl or something else.
 

Dartmouth
Member
 
Posts: 121
Joined: Sat Dec 06, 2014 14:39
IRC: pilino1234

Re: Minetest on Rasbpberry Pi

by Dartmouth » Wed Sep 09, 2015 15:36

Compiling the server took me less than half an hour on the quadcore RPi2...
 

Amicadi
Member
 
Posts: 13
Joined: Fri Sep 04, 2015 00:40

Re: Minetest on Rasbpberry Pi

by Amicadi » Thu Sep 10, 2015 01:15

@4aiman Thank for your help

Irrlicht-ogl-es (from http://svn.code.sf.net/p/irrlicht/code/branches/ogl-es/ ) is compiled with:

#define _IRR_COMPILE_WITH_OPENGL_
#define _IRR_COMPILE_WITH_OGLES1_
#define _IRR_COMPILE_WITH_OGLES2_
#define _IRR_COMPILE_WITH_EGL_MANAGER_
#define _IRR_COMPILE_WITH_GLX_MANAGER_
#define _IRR_COMPILE_WITH_X11_DEVICE_

make clean && make

Minetest is compiled as:

make clean
cmake . -DRUN_IN_PLACE=TRUE -DENABLE_GLES=1 -DEGL_INCLUDE_DIR=/opt/vc/include/EGL -DEGL_LIBRARY=/usr/lib/arm-linux-gnueabihf/libEGL.so -DOPENGLES2_INCLUDE_DIR=/opt/vc/include/GLES2 -DOPENGLES2_LIBRARY=/usr/lib/arm-linux-gnueabihf/libGLESv2.so -DFREETYPE_INCLUDE_DIR_freetype2=/usr/include/freetype2 -DFREETYPE_INCLUDE_DIR_ft2build=/usr/include/freetype2 -DFREETYPE_LIBRARY=/usr/lib/arm-linux-gnueabihf/libfreetype.a -DIRRLICHT_INCLUDE_DIR=/home/pi/irrlicht/ogl-es/include -DIRRLICHT_LIBRARY=/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a
make -j 4

In the system are installed these packages:

libegl1-mesa-dev - free implementation of the EGL API -- development files
libgegl-dev - Generic Graphics Library (development files)
libgles2-mesa-dev - free implementation of the OpenGL|ES 2.x API -- development files
libgl1-mesa-swx11-dev - free implementation of the OpenGL API -- development files


still, getting these errors at linking time:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Linking CXX executable ../bin/minetest
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(COGLESDriver.o): In function `irr::video::COGLES1Driver::drawVertexPrimitiveList2d3d(void const*, unsigned int, void const*, unsigned int, irr::video::E_VERTEX_TYPE, irr::scene::E_PRIMITIVE_TYPE, irr::video::E_INDEX_TYPE, bool)':
/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLESDriver.cpp:773: undefined reference to `glPointSizePointerOES'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(COGLESDriver.o): In function `irr::video::COGLES1Driver::uploadClipPlane(unsigned int)':
/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLESDriver.cpp:3098: undefined reference to `glClipPlanef'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(COGLESExtensionHandler.o): In function `irr::video::COGLES1ExtensionHandler::initExtensions(irr::video::COGLES1Driver*, bool)':
/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLESExtensionHandler.cpp:248: undefined reference to `eglGetProcAddress'
/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLESExtensionHandler.cpp:249: undefined reference to `eglGetProcAddress'
/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLESExtensionHandler.cpp:250: undefined reference to `eglGetProcAddress'
/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLESExtensionHandler.cpp:251: undefined reference to `eglGetProcAddress'
/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLESExtensionHandler.cpp:255: undefined reference to `eglGetProcAddress'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(COGLESExtensionHandler.o):/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLESExtensionHandler.cpp:259: more undefined references to `eglGetProcAddress' follow
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(COGLES2Driver.o): In function `irr::video::COGLES2Driver::testEGLError()':
/home/pi/irrlicht/ogl-es/source/Irrlicht/COGLES2Driver.cpp:1663: undefined reference to `eglGetError'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::initialize(irr::SIrrlichtCreationParameters const&, irr::video::SExposedVideoData const&)':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:48: undefined reference to `eglGetDisplay'
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:66: undefined reference to `eglInitialize'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::terminate()':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:88: undefined reference to `eglMakeCurrent'
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:90: undefined reference to `eglTerminate'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::generateSurface()':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:160: undefined reference to `eglChooseConfig'
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:249: undefined reference to `eglCreateWindowSurface'
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:252: undefined reference to `eglCreateWindowSurface'
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:259: undefined reference to `eglBindAPI'
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:263: undefined reference to `eglSwapInterval'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::destroySurface()':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:274: undefined reference to `eglMakeCurrent'
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:276: undefined reference to `eglDestroySurface'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::generateContext()':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:310: undefined reference to `eglCreateContext'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::destroyContext()':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:329: undefined reference to `eglMakeCurrent'
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:330: undefined reference to `eglDestroyContext'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::activateContext(irr::video::SExposedVideoData const&)':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:337: undefined reference to `eglMakeCurrent'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::swapBuffers()':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:354: undefined reference to `eglSwapBuffers'
/home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a(CEGLManager.o): In function `irr::video::CEGLManager::testEGLError()':
/home/pi/irrlicht/ogl-es/source/Irrlicht/CEGLManager.cpp:360: undefined reference to `eglGetError'
collect2: ld returned 1 exit status
src/CMakeFiles/minetest.dir/build.make:4827: recipe for target 'bin/minetest' failed
make[2]: *** [bin/minetest] Error 1
CMakeFiles/Makefile2:136: recipe for target 'src/CMakeFiles/minetest.dir/all' failed
make[1]: *** [src/CMakeFiles/minetest.dir/all] Error 2
Makefile:133: recipe for target 'all' failed
make: *** [all] Error 2
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: Minetest on Rasbpberry Pi

by 4aiman » Thu Sep 10, 2015 08:45

@Ivà (may I call you just "Iva"? I don't have "à" in my kb layouts)
Well, I'm compiling the entire Minetest - client and server :)
Haven't tried to build server only.


@Amicadi
I'm still away from my RPi but I'm using a virtual RPi to build MT at the very moment.
Once I'm done, I'll share the *.img files I use as well as the tutorial on how to setup a virtual Pi.

Gotta go now...
 

Amicadi
Member
 
Posts: 13
Joined: Fri Sep 04, 2015 00:40

Re: Minetest on Rasbpberry Pi

by Amicadi » Thu Sep 10, 2015 19:33

Continuing with Minetest compilation with OpenGL ES support.

Minetest linking is done by the command at /home/pi/minetest/src/CMakeFiles/minetest.dir/link.txt

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
/usr/bin/c++   -DNDEBUG -Wall   -ffast-math -Wall -pipe -funroll-loops -O3 -fomit-frame-pointer  ...Long list of object files... ../bin/minetest -rdynamic -lz /home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a -lGLU -lGL -lX11 -lXext -ljpeg -lbz2 -lpng -lz -lX11 -lXext -lopenal -lvorbisfile -lvorbis -logg -lsqlite3 lua/build/liblua.a -lgmp json/libjsoncpp.a -lGLESv2 -lX11 -lXext -lGLESv2 -lrt -lpthread -ldl -lXxf86vm -lcurl -Wl,-Bstatic -lfreetype cguittfont/libcguittfont.a -Wl,-Bdynamic -ljpeg -lbz2 -lpng -lopenal -lvorbisfile -lvorbis -logg -lsqlite3 -lgmp -lrt -lpthread -ldl -lXxf86vm -lcurl /home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a -lz -Wl,-Bstatic -lfreetype -Wl,-Bdynamic


Here there is somethings missing. As seen, Irrlicht is linked without -lGLESv2 or -lEGL flags and -L/opt/vc/lib is not there which seem to be mandatory according to https://www.raspberrypi.org/forums/view ... 3&p=259277

so, I changed the linking command for:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
/usr/bin/c++   -DNDEBUG -Wall   -ffast-math -Wall -pipe -funroll-loops -O3 -fomit-frame-pointer  ...Long list of object files... ../bin/minetest -rdynamic -lz /home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a -lGLU -lGL -lGLESv2 -lEGL -lX11 -lXext -ljpeg -lbz2 -lpng -lz -lX11 -L/opt/vc/lib -lXext -lopenal -lvorbisfile -lvorbis -logg -lsqlite3 lua/build/liblua.a -lgmp json/libjsoncpp.a -lGLESv2 -lEGL -lX11 -lXext -lrt -lpthread -ldl -lXxf86vm -lcurl -Wl,-Bstatic -lfreetype cguittfont/libcguittfont.a -Wl,-Bdynamic -ljpeg -lbz2 -lpng -lopenal -lvorbisfile -lvorbis -logg -lsqlite3 -lgmp -lrt -lpthread -ldl -lXxf86vm -lcurl /home/pi/irrlicht/ogl-es/lib/Linux/libIrrlicht.a -lz -Wl,-Bstatic -lfreetype -Wl,-Bdynamic


And then I executed the whole command. I succeed linking and I got minetest binary at /home/pi/minetest/bin

I add the line:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
video_driver = ogles2


to minetest.conf and I execute minetest who complains about the shaders location. So, I copied irrlicht media folder (which contains the shaders) to /home/pi and executed it again getting:

Automatically selecting world at [/home/pi/minetest/bin/../worlds/world]
ERROR[Main]: Irrlicht: Bad Display ----> EGL_BAD_DISPLAY
Floating point exception

Am I getting any closer? :-)
 

Amicadi
Member
 
Posts: 13
Joined: Fri Sep 04, 2015 00:40

Re: Minetest on Rasbpberry Pi

by Amicadi » Fri Sep 11, 2015 01:52

I Compiled Irrlich with loglevel set to verbose, and added debug_log_level = 4 to minetest.conf

at first try:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
INFO[Main]: logfile = debug.txt
VERBOSE[Main]: httpfetch_init: parallel_limit=8
INFO[Main]: Message locale is now set to: LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=en_GB.UTF-8;LC_MONETARY=en_GB.UTF-8;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NAME=en_GB.UTF-8;LC_ADDRESS=en_GB.UTF-8;LC_TELEPHONE=en_GB.UTF-8;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=en_GB.UTF-8
VERBOSE[Main]: Determining world path
INFO[Main]: Searching worlds...
INFO[Main]:   In /home/pi/minetest/bin/../worlds:
INFO[Main]: world
INFO[Main]: 1 found.
Automatically selecting world at [/home/pi/minetest/bin/../worlds/world]
VERBOSE[Main]: Determining gameid/gamespec
INFO[Main]: Using world gameid [minetest]
INFO[Main]: Using commanded world path [/home/pi/minetest/bin/../worlds/world]
INFO[Main]: Irrlicht: Irrlicht Engine version 1.9.0
INFO[Main]: Irrlicht: Linux 4.1.6-v7+ #810 SMP PREEMPT Tue Aug 18 15:32:12 BST 2015 armv7l
INFO[Main]: Irrlicht: Creating X window...
INFO[Main]: Irrlicht: Using plain X visual
VERBOSE[Main]: Irrlicht: Visual chosen: : 33
INFO[Main]: Irrlicht: Could not get EGL display.
ERROR[Main]: Irrlicht: Bad Display
INFO[Main]: Irrlicht: Could not make EGL context current.
INFO[Main]: Irrlicht: Using renderer:


So, I made some changes at CEGLManager.cpp (initialize function):

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
        EglWindow = (NativeWindowType)Data.OpenGLLinux.X11Window;
--      EglDisplay = eglGetDisplay((NativeDisplayType)Data.OpenGLLinux.X11Display);
++      //EglDisplay = eglGetDisplay((NativeDisplayType)Data.OpenGLLinux.X11Display);
++      EglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);


Then eglInitialize was sucessful, but then I got this log:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
....
INFO[Main]: Irrlicht: Irrlicht Engine version 1.9.0
INFO[Main]: Irrlicht: Linux 4.1.6-v7+ #810 SMP PREEMPT Tue Aug 18 15:32:12 BST 2015 armv7l
INFO[Main]: Irrlicht: Creating X window...
INFO[Main]: Irrlicht: Using plain X visual
VERBOSE[Main]: Irrlicht: Visual chosen: : 33
INFO[Main]: Irrlicht: EGL version: 1.400000
Segmentation fault -- at COGLES2Driver::COGLES2Driver --> ContextManager->generateSurface()


so I changed CEGLManager::generateSurface() function:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
-- #ifdef EGL_VERSION_1_3
++ // #ifdef EGL_VERSION_1_3
                EGL_RENDERABLE_TYPE, EglOpenGLBIT,
-- #endif
++ //#endif


After this modification, I got:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
....
INFO[Main]: Irrlicht: Irrlicht Engine version 1.9.0
INFO[Main]: Irrlicht: Linux 4.1.6-v7+ #810 SMP PREEMPT Tue Aug 18 15:32:12 BST 2015 armv7l
INFO[Main]: Irrlicht: Creating X window...
INFO[Main]: Irrlicht: Using plain X visual
VERBOSE[Main]: Irrlicht: Visual chosen: : 33
INFO[Main]: Irrlicht: EGL version: 1.400000
INFO[Main]: Irrlicht: Could not get config for EGL display.
Floating point exception


I guess that Irrlicht ogl-es needs some more code for EGL 1.4 to work in other devices than ANDROID_DEVICE. Irrlicht ogl-es 1.9.0 is in alpha version, so, who knows... :-)
 

PreviousNext

Return to Minetest General

Who is online

Users browsing this forum: No registered users and 8 guests