Currently Online

Latest Posts

Topic: Playing / Compiling on Raspberry

Hasi50
Avatar
Topic Opener
Joined: 2015-12-28, 15:19
Posts: 182
OS: MacOS
Version: 1.2 (selfcompiled master etc)
Ranking
Widelands-Forum-Junkie
Location: DE - near Frankfurt
Posted at: 2016-08-01, 12:57

I bought a (https://de.wikipedia.org/wiki/Raspberry_Pi) recently and dedicated a seperate 32G SD-Card to try to compile Widelands.

First I installed the R18 release that can be downloaded from the normal repositories. This was usable after disabling OpenGL. Using
<code>widelands --xres=1920 --yres=1016 --opengl=0 --depth=16 --fullscreen=yes</code> gave me a playable Game on my Full-HD Display. I started to play a single player game and this was fine, so far.

I then tried to compile this myself. The receipe for Linux (Debian) workend out fine until the first binray was linked and ld was killed with "Out of memory".
To make linking possible I did two things: I changed <code>/etc/dphys-swapfile</code> to use <code>CONF_SWAPFACTOR=1</code> and not <code>CONF_SWAPSIZE=100<code>.
And I added this config to <code>CMakeLists.txt</code>

<code># Necessary to avoid ld process gets killed or uses all the swapspace on low-memory systems, e.g. Raspberry Pi<br />
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker --no-keep-memory")</code>

and I used <code>./compile.sh -n</code> to avoid building some Tools I will not need any time soon.
After this compiling was possible but took about 30 Minutes.
When starting widelands it stopped with an Assertion I must investigate further:

<code>widelands: /home/pi/widelands-repo/trunk/src/graphic/graphic.cc:114:
void Graphic::initialize(const Graphic::TraceGl&, int, int, bool):
Assertion »(((disp_mode.format) && ((((disp_mode.format) >> 28) & 0x0F) != 1)) ?
((((disp_mode.format) == SDL_PIXELFORMAT_YUY2) || ((disp_mode.format) == SDL_PIXELFORMAT_UYVY) || ((disp_mode.format) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1)
: (((disp_mode.format) >> 0) & 0xFF)) == 4« failed.</code>

Any expert for this please help
</code>


Here are the widelands where people may dwell, walking around care that evrythings well.

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2016-08-01, 13:16

Which version did you try to compile yourself? The graphics system has changed a lot since b18, so trying to debug this for b18 doesn't make much sense now.


Busy indexing nil values

Top Quote
Hasi50
Avatar
Topic Opener
Joined: 2015-12-28, 15:19
Posts: 182
OS: MacOS
Version: 1.2 (selfcompiled master etc)
Ranking
Widelands-Forum-Junkie
Location: DE - near Frankfurt
Posted at: 2016-08-01, 14:20

The assertion is a bit obfuscated by some macro: assert(SDL_BYTESPERPIXEL(disp_mode.format) == 4); Is this such a hard precondition?


Here are the widelands where people may dwell, walking around care that evrythings well.

Top Quote
Hasi50
Avatar
Topic Opener
Joined: 2015-12-28, 15:19
Posts: 182
OS: MacOS
Version: 1.2 (selfcompiled master etc)
Ranking
Widelands-Forum-Junkie
Location: DE - near Frankfurt
Posted at: 2016-08-01, 14:47

Removing the assertion allows the games to start, but it it so slow that I cannot use it. Do we always need openGL now?


Here are the widelands where people may dwell, walking around care that evrythings well.

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2016-08-01, 15:02

Yes, software rendering was very slow and outdated, so we removed it. B18 still has software rendering.

You have an option to build with glbinding instead of glew though, no idea if this helps:

$ mkdir build && cd build
$ cmake -DOPTION_USE_GLBINDING:BOOL=ON -DCMAKE_BUILD_TYPE:STRING="Debug" .. && make
$ cd src
$ ./widelands --datadir=../..

Busy indexing nil values

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2016-08-02, 08:59

I see that you have created a new branch to deal with the memory issue face-smile.png

Can you make this optional in the compile script, like I did for the website?


Busy indexing nil values

Top Quote
Hasi50
Avatar
Topic Opener
Joined: 2015-12-28, 15:19
Posts: 182
OS: MacOS
Version: 1.2 (selfcompiled master etc)
Ranking
Widelands-Forum-Junkie
Location: DE - near Frankfurt
Posted at: 2016-08-02, 10:16

Hello Gun: about that memory Branch: Im am not sure which condition to use for this Flag. Can I depend on the Amount of Ram? Maybe I will just leave it as a comment for the next one trying?

OK, here some more findings: With https://www.raspberrypi.org/blog/another-new-raspbian-release/ there is an experimental support for an opengl driver using the GPU. To use a Full-HD dispalye with 16-Bit colors this will need 32G of Ram wit 32Bits/Pixel it will need 128Ram, for the GPU, wich will decrease the main memory, though. I found that some Games work fine now (never heard about Oolite before ;-). But Widelands ist just waiting for something, it does not consume any CPU and does not crash (for now).

Ill do some more experiments, but it looks like WL will not make it to the Raspi without some real enthusiast, sorry


Here are the widelands where people may dwell, walking around care that evrythings well.

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2016-08-02, 13:43

Thanks for trying this out in any case! face-smile.png


Busy indexing nil values

Top Quote