Mint 22.1 + Kodi 21.2 + Beelink Mini S12

March 8, 2025 6:46 pm

The latest in my series on the subject, this follows the last upgrade in 2023: Mint 21 + Kodi 19 + Intel NUC i3.

I’ve replaced my aging Intel NUC with a Beelink Mini S12. The fan seemed to have a bearing beginning to fail. I figured I better get on replacing it while it was giving me forewarning rather than waiting for it to catastrophically fail (and before more tariffs increased prices further). I had looked into just replacing the fan, but couldn’t find a part I could guarantee would work. And it was 11 years old. And the Beelink Mini S12 was only $160 and offered a significant leap in processing power, storage, and RAM while lowering electrical usage.

I bought this one. The Beelink Mini S12 with Intel N100 processor, 16 GB RAM, and 500 GB SSD.

My first challenge was getting the Beelink to boot off a USB drive. For whatever reason it didn’t like the drive I was using and after futzing around for a while I tried another one, it booted fine, and I got Mint 22.1 installed without issue.

Install Kodi

The Kodi PPA is no longer maintained and the recommended solution is the Flatpak.

$ flatpak install flathub tv.kodi.Kodi
# To fix pipewire access (maybe not necessary?):
$ sudo flatpak override tv.kodi.Kodi --filesystem=xdg-run/pipewire-0

How to get audio passthrough working correctly changed again in this release. Theoretically the most recent versions of Pipewire handle it correctly with Kodi “out of the box,” but the version of Pipewire installed in Mint 22.1 was not doing it.

This goes hand in hand with configuring the machine to auto-boot into Kodi directly and skip loading a Cinnamon user session.

Create a script to launch Kodi with ALSA:

$ mkdir ~/Scripts
$ touch ~/Scripts/kodi_custom_session_launcher
$ chmod +x ~/Scripts/kodi_custom_session_launcher
$ nano ~/Scripts/kodi_custom_session_launcher

File Contents:

#!/bin/bash
flatpak run tv.kodi.Kodi --audio-backend=alsa

Create a custom XSession entry which we can select from the login screen:

$ sudo nano /usr/share/xsessions/Kodi_ALSA.desktop

And the file contents:

[Desktop Entry]
Name=Kodi with ALSA
Comment=This session will start KODI Media Center
Exec=/home/kyle/Scripts/kodi_custom_session_launcher
TryExec=/home/kyle/Scripts/kodi_custom_session_launcher
Type=Application

Now if you log out you should be able to select “Kodi with ALSA” as a session option from your login manager.  In Mint, this is accomplished by clicking the circle to the right of the user name.

As in the past, after a little fussing and some restarts I eventually saw the correct audio targets in the Kodi settings and everything seems to be happy with the audio passthrough support.

When running as a flatpak, the Kodi configuration is in a new location:
/home/kyle/.var/app/tv.kodi.Kodi/data

I set up some stuff in Kodi’s advanced settings file to disable the splash screen and hide the ext4 file system’s “lost+found” directories.

$ nano ~/.var/app/tv.kodi.Kodi/data/userdata/advancedsettings.xml

File contents:

<?xml version="1.0" encoding="UTF-8"?>
<advancedsettings>
  <splash>false</splash>
  <video>
    <excludefromlisting>
      <regexp>lost\+found</regexp>
    </excludefromlisting>
    <excludefromscan>
      <regexp>lost\+found</regexp>
    </excludefromscan>
    <excludetvshowsfromscan>
      <regexp>lost\+found</regexp>
    </excludetvshowsfromscan>
  </video>
</advancedsettings>

IR Remote Control

The Beelink Mini S12 doesn’t have a built-in IR receiver like the NUC did. So I bought a FLIRC USB IR Receiver. The system sees it as a keyboard, so you don’t do any configuration with Linux’s built-in IR receiver support. Instead run the FLIRC configuration tool. It helpfully has a Kodi configuration mode which shows you all the keyboard commands that Kodi understands and trivially lets you map buttons on your remote to those commands.

Here’s my configuration which maps the buttons to the same ones I’ve been using on my Onkyo RC-764m remote using remote code 33003:

Lyrion Music Server

Logitech Media Server is dead, but Logitech rather graciously handed the project over to the community (presumably with the requirement that they not use Logitech’s name). The community rebranded it the Lyrion Music Server.

I downloaded the package for version 9.0.1 from
https://downloads.lms-community.org/LyrionMusicServer_v9.0.1/lyrionmusicserver_9.0.1_amd64.deb

And to install:

$ sudo apt install ./lyrionmusicserver_9.0.1_amd64.deb

Preferences are stored at /var/lib/squeezeboxserver/prefs

External Hard Drives

I’m still having issues with the external hard drives disappearing and needing to be remounted. I’ve slightly updated my script from the last post as I discovered there were 2 possible failure modes to check when deciding if a disk needed to be remounted:

#!/usr/bin/bash
needed_to_remount=false
if ! mountpoint -q /mnt/TV || ! ls /mnt/TV > /dev/null; then
  needed_to_remount=true
  mount /mnt/TV
fi

if ! mountpoint -q /mnt/General || ! ls /mnt/General > /dev/null; then
  needed_to_remount=true
  mount /mnt/General
fi

if ! mountpoint -q /mnt/Movies || ! ls /mnt/Movies > /dev/null; then
  needed_to_remount=true
  mount /mnt/Movies
fi

if ! mountpoint -q /mnt/4TB_Storage || ! ls /mnt/4TB_Storage > /dev/null; then
  needed_to_remount=true
  mount /mnt/4TB_Storage
fi

if [ "$needed_to_remount" == "true" ]; then
  echo "$(date) Needed to remount disks"
fi

And the cronjob in /etc/crontab that runs this scripts every minute:

# Work around external drives being unmounted randomly
* * * * * root /home/kyle/Scripts/remount_disks.sh >> /var/log/remount_disks.log

Leave a Reply

Your email address will not be published. Required fields are marked *