Raspberry Pi

From Elvanör's Technical Wiki
Jump to navigationJump to search

Setup & Installation

  • PINN is an easy OS installation tool coupled with a boot loader. With it you can easily install several OSes on a single SD card, which makes it easier to multi boot on different distributions. Each distribution can be used for a different purpose (LibreELEC for Kodi, RetroArch for gaming, Raspberry Pi OS for general purpose, etc).
  • It seems that PINN strangely does not allow you custom configuration of the partition of the SD card. Partitions are created according to the chosen OSes you want to install, but you can not reserve more space for a given OS if you want to. Of course, you can use gparted after installation to change it as you want.
  • Normally the OS boot selection is done via keyboard / mouse when booting. For me, this is not ideal as many RPi systems will not be connected to a mouse or keyboard. However, there is a way to change the boot partition (and thus the selected boot distribution) via a text configuration file. So it's relatively easy to write scripts to change the OS via SSH (it requires SSH support for login in all installed OSes, though).

Raspberry Pi OS (Official OS)

  • This is based on Debian. You can install very easily Kodi via apt-get. Installing RetroArch is sometimes possible via the Libretro Ubuntu PPA (Personal Package Archives) but not recommended, as an Ubuntu PPA can conflict with a pure Debian system (some packages for current versions of RetroArch won't be up to date, etc). It's better to install RA via flatpak (see RetroArch page for more information).
  • For Kodi, to play H265 movies (4K) you will probably need the followind added to your config.txt file (located in /boot/):
  • Update: the dtoverlay=rpivid-v4l2 line is apparently obsolete and no longer needed.
  • For the Catchup TV addon to work, you will also need to install the kodi-inputstream-adaptive via apt-get.
  • Commands to perform the equivalent of a Gentoo emerge --sync && emerge --update world && emerge -a --depclean:
apt update
apt full-upgrade
apt autoremove
  • Other useful apt commands:
apt list
apt list --installed
  • By default Raspberry Pi OS is configured with automatic upgrades. This can be problematic. You can disable this by removing the unattended-upgrades:
sudo apt remove unattended-upgrades
  • With an old LG TV, screen would remain black after a boot into Rasperry Pi OS (the same screen would work on Gentoo or RetroPie, or another screen would work in Raspberry Pi OS). To fix this, I ran raspi-config to setup console boot rather than an X session by default, I added hdmi_safe=1 to config.txt and I wrote the following login script (to place in /etc/profile.d/elvanor.sh):
if pgrep -x "Xorg" >/dev/null
       if pgrep -x "kodi" >/dev/null
               echo "All good"
               echo "Starting Kodi"
               sleep 5
       echo "Starting Lightdm"
       sleep 5
       sudo systemctl restart lightdm
  • Connecting devices via Bluetooth works. You can pair and connect DualSense PS 5 controllers without any issues, then use them in RetroArch. You must pair the devices on the desktop environment; there seems to be no way to rename a device (which is not convenient, since two controllers will appear with the same name).
  • Be careful of the output devices when using PulseAudio. By default the output device might be the wrong one and if the application does not have an interface to change it (such as Kodi or VLC), there will be no sound. It was the case for instance with RetroArch. One way to get rid of that issue is to install pavucontrol, then disable the unused audio output devices so that only the correct one remains.

Gentoo on the Raspberry Pi

  • It seems Gentoo would mostly work on the RPi, but I did not invest too much time. One of the default image in PINN is Gentoo and it works. It even comes pre-installed with Kodi (but not Retroarch) which is great, although I don't know if .
  • You will mostly want to reinstall Kodi with the webserver USE flag to include support for remote control via the Kore Android application.