Skip to content

Raspberry Pi

Alexander V. Wolf edited this page Oct 9, 2024 · 35 revisions

Stellarium on Raspberry Pi

The Raspberry Pi is a very popular family of single-board computers for many kinds of programming experiments and hardware tinkering projects. Don't expect a super computer, but you should get typically over 10 frames per seconds, which should be enough for many applications where you don't want to waste too much energy. (E.g. solar/battery powered observatory.) I get 18fps on a 1400x1050 screen with Satellites not shown.

NOTE Issue #550 indicates problems with texture memory on the model 3B(+) which are out of our hands. You could attempt to reduce the size of the DSO (nebula) textures. Also, DSS and HiPS surveys are likely to fail for the same reasons.

UPDATE In version 23.1 there is a new option which you should add to your config.ini:

[astro]
nebula_texture_decimation = 8

A factor of 8 (or even 16) will make the DSO pictures more diffuse, but helps to conserve memory. DSS and HiPS are not affected and will still not work well, so just disable their buttons.

For Raspberry OS ("bookworm", 2024), you must

  • activate the "X11 backend" in raspi-config, Advanced options, Wayland, X11.
  • follow the building instructions for Linux. You will not have QtWebEngineView, but the rest should work.

For the previous Raspberry OS ("bullseye", 2021), you must

  • activate the "OpenGL Driver" in raspi-config, Advanced options, Full KMS.
  • activate "Glamor" in raspi-config, Advanced options.
  • follow the building instructions for Linux. You will not have QtWebEngineView, but the rest should work.

2021-11: Ubuntu Mate 20.04 LTS on RPi3B+ installed, but never really made it to the desktop.

2022-07: Ubuntu Mate 22.04 LTS on RPi4 (4GB) installed. Compiles with Qt6 and runs. (Follow Linux instructions.)

First Impressions, Limitations

The new driver seems to work pretty well in many cases, but some hardware limitations persist (observed in ~2018-23)

  • The limited memory on Raspberry Pi 3 is the worst problem, causing most of the following. To be still useful, edit config.ini: add an entry astro/nebula_texture_decimation=8 to reduce DSO texture memory requirements.
  • On Raspberry Pi 3, color selection by pressing the color swatches in the GUI causes a crash. We don't know why, please find out and send a patch!
  • You cannot show your own landscapes or 3D sceneries with any textures larger than 2048x2048 pixels. Also the built-in "Sterngarten" scenery will not work.
  • The Scenery3D plugin should be used with Perspective Projection only. All other projections require too much texture memory.
  • It seems that some bug prevents OBJ planets from being rendered. Keep this option disabled!
  • If you want higher framerate, consider disabling the Satellites plugin, or at least think about reducing number of satellites to the ones you are critically interested in. Also, don't load too many minor bodies.
  • The DSS layer seems to work for short periods, then the X server fails. It may have to do with limitations of texture memory. You can try to press Ctrl-Alt-Backspace to restart it, but sometimes you will have to reboot if the graphics failed.

Notes for building Stellarium

You may want to install a swap file or enlarge an existing, otherwise you may run out of virtual memory when compiling. For Raspberry OS, just edit /etc/dphys-swapfile and increase the swapfile size to e.g. CONF_SWAPSIZE=512, then reboot. For other distributions, follow e.g.
https://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/

If you are doing the compile on your Pi, follow the Linux instructions but use the command

nice make -j4

Otherwise, you may lose control of the pi with all cores busy. Or run with

make -j3

to keep one core free for other tasks.

Raspberry Pi Model 4B

  • 2019-10-10: Stellarium works great out of the box. Install Raspbian, clone the GIT repo, install Linux build dependencies, and
   mkdir build; cd build
   cmake -DCMAKE_BUILD_TYPE="Release" ../stellarium
   nice make -j4 

On a model with 4GB you don't need a larger swap file. Within 16 minutes, Stellarium was built, with about 17fps at FullHD resolution. Without satellites, 22fps.

  • 2020-01-29: On an aarch64 build, we found (#940) you need to convince MESA to run without issues:

    MESA_GL_VERSION_OVERRIDE=3.0 MESA_GLSL_VERSION_OVERRIDE=130 stellarium

  • 2024-01-02: On an aarch64 build, we found (#3569) you need to convince MESA to run without issues Qt6- and Qt5-based Stellarium in X11-session:

    MESA_GLES_VERSION_OVERRIDE=2.0 MESA_GLSL_VERSION_OVERRIDE=130 stellarium

  • 2024-05-12: On Ubuntu 24.04 arm64, install raspi-config and activate wayland. Then install Stellarium from ppa:stellarium/daily, and call with: QT_QPA_PLATFORM=xcb ./stellarium --opengl-compat. You may set the environment variable permanently and configure another, STEL_OPTS=--opengl-compat, for a permanent setting.