So I followed this guide on how to set up Fluidsynth, and the only step that does not work is having it automatically start at bootup. When I log in, I find that the service is not running, and using the command fluidsynth -is gives me the following input:
FluidSynth runtime version 2.3.5
Copyright (C) 2000-2024 Peter Hanappe and others.
Distributed under the LGPL license.
SoundFont(R) is a registered trademark of Creative Technology Ltd.
fluidsynth: error: Failed to bind server socket: 98
Failed to create the server.
Continuing without it.
fluidsynth: warning: Failed to set thread to high priority
fluidsynth: warning: Failed to set thread to high priority
In order to have it working again, I’d have to disable and then enable back the service via systemctl. Just running systemctl enable without disabling first will not work.
Is there anything I’m missing from the guide? I’m using standard Fedora 40, KDE spin. I use Fluidsynth for general MIDI playback in DOSBox and old Windows games.
What does systemctl enable --now --user fluidsynth.service report?
What files do you have in ~/.config/systemd/user?
I have ~/.config/systemd/user/default.target that I use to start services
and I also see links in ~/.config/systemd/user/graphical-session.target.wants/ on some systems.
Check that fluidsynth.service is listed somewhere.
Since it’s already enabled, it will give no output. But during first time setup, it gives me:
Created symlink /home/yellowdog/.config/systemd/user/default.target.wants/fluidsynth.service → /usr/lib/systemd/user/fluidsynth.service.
What files do you have in ~/.config/systemd/user?
Only one directory named default.target.wants, and inside it has a symlink fluidsynth.service, which is linked to /usr/lib/systemd/user/fluidsynth.service.
The contents of this service file:
Unit]
Description=FluidSynth Daemon
Documentation=man:fluidsynth(1)
After=sound.target
After=pipewire.service
[Service]
# added automatically, for details please see
# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
ProtectSystem=full
ProtectHome=read-only
ProtectHostname=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
# end of automatic additions
# required in order for the above sandboxing options to work on a user unit
PrivateUsers=yes
Type=notify
NotifyAccess=main
EnvironmentFile=/etc/sysconfig/fluidsynth
EnvironmentFile=-%h/.config/fluidsynth
ExecStart=/usr/bin/fluidsynth -is $OTHER_OPTS $SOUND_FONT
[Install]
WantedBy=default.target
Since I couldn’t find out what exactly is the problem, I ended up going the dirty route of making a very simple shell script that basically restarts the service on login:
#!/bin/bash
# this will restart fluidsynth.service after boot up
systemctl restart --now --user fluidsynth.service
It works so far, so I’m gonna call it a solution, unless there’s a good reason not to do this (I’m not an expert Linux user).