Thanks Marcus, I think I will just use the shell script solution you proposed, since I don't use Frescobaldi all the time. Thanks again for all your help!
--- Knute Snortum (via Gmail) On Sun, Aug 9, 2020 at 4:27 AM Marcus Weseloh <mar...@weseloh.cc> wrote: > > Hi Knute, > > as your Ubuntu is using pulseaudio as sound server by default, alsa is > configured to use pulseaudio as the output "sink". So if you want to > keep the default system configuration of your ubuntu, then it makes > sense to use the FluidSynths pulseaudio driver as alsa will simply > forward all audio to pulseaudio anyway. > > That the FluidSynth user service works fine when started manually but > breaks when enabled and executed at login seems to indicate a timing > problem. I suspect that pulseaudio just takes a little too long to > start accepting connections. So you could try to add a little delay to > your unit file, maybe with an ExecStartPre command: > > [Service] > ExecStartPre=/bin/sleep 10 > > Please bear in mind that once started, FluidSynth is always "active", > even when you don't send MIDI events to it. So when you start it > automatically at boot, then it will constantly eat some CPU cycles and > also cause pulseaudio to have a higher load. So when you need it > mainly as a synth for Frescobaldi, another solution could be to simply > create a shell script that starts fluidsynth and frescobaldi together. > > Cheers > Marcus > > Am Fr., 7. Aug. 2020 um 17:33 Uhr schrieb Knute Snortum <ksnor...@gmail.com>: > > > > Thanks, Marcus. > > > > I disabled the system config for fluidsynth and enabled the user > > config. I took PulseAudio out of the config and just used ALSA. > > Status looks good and MIDI plays from Frescobaldi when I start the > > process "manually" after boot. But when I reboot, I get no MIDI > > output and systemctl --user static fluidsynth produces this: > > > > fluidsynth.service - FluidSynth launched in server mode > > Loaded: loaded > > (/home/knute/.config/systemd/user/fluidsynth.service; enabled; vendor > > preset: enabled) > > Active: active (running) since Fri 2020-08-07 08:18:57 PDT; 1min 18s > > ago > > Main PID: 1810 (fluidsynth) > > CGroup: > > /user.slice/user-1000.slice/user@1000.service/fluidsynth.service > > └─1810 /usr/bin/fluidsynth -a alsa -m alsa_seq -i -l -s > > -p FluidSynth /usr/share/sounds/sf2/FluidR3_GM.sf2 > > > > Aug 07 08:18:57 knute-NUC7PJYH systemd[1798]: Started FluidSynth > > launched in server mode. > > Aug 07 08:18:57 knute-NUC7PJYH fluidsynth[1810]: fluidsynth: warning: > > Failed to set thread to high priority > > Aug 07 08:19:27 knute-NUC7PJYH fluidsynth[1810]: ALSA lib > > pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Timeout > > Aug 07 08:19:27 knute-NUC7PJYH fluidsynth[1810]: fluidsynth: error: > > Failed to open the "default" audio device > > Aug 07 08:19:27 knute-NUC7PJYH fluidsynth[1810]: Failed to create the > > audio driver > > > > Any ideas why ALSA is trying to connect to PulseAudio? Is there some > > other way for me to start FluidSynth at boot time? > > > > --- > > Knute Snortum > > (via Gmail) > > > > On Thu, Aug 6, 2020 at 3:21 PM Marcus Weseloh <mar...@weseloh.cc> wrote: > > > > > > Hi Knute, > > > > > > you say that you used a user unit file file in .config/systemd/user/, > > > but the output from the status command is a report from a system unit > > > file in /lib/systemd/system/fluidsynth.service. > > > > > > If you want to use user-unit files, you need to prefix all systemctl > > > commands with --user. So you could try the following: > > > > > > First make sure your system-wide fluidsynth unit is stopped: > > > $ sudo systemctl stop fluidsynth > > > > > > Then reload your user-systemd just to be on the safe side: > > > $ systemctl --user daemon-reload > > > > > > Then try to activate your user-unit and check it's status: > > > $ systemctl --user start fluidsynth > > > $ systemctl --user status fluidsynth > > > > > > Cheers > > > Marcus > > > > > > > > > Am Do., 6. Aug. 2020 um 23:08 Uhr schrieb Knute Snortum > > > <ksnor...@gmail.com>: > > > > > > > > Thanks, Ceresa, I read that whole thread but it doesn't seem to apply > > > > to my situation. > > > > > > > > I am on Ubuntu 20.04, using systemd now to try to start FluidSynth. I > > > > learned that PulseAudio won't start as root, so I added my service to > > > > ~/.config/systemd/user. It looks like this: > > > > > > > > [Unit] > > > > Description=FluidSynth launched in server mode > > > > After=sound.target > > > > > > > > [Service] > > > > ExecStart=/usr/bin/fluidsynth -a pulseaudio -m alsa_seq -i -l -s -p > > > > FluidSynth /usr/share/sounds/sf2/FluidR3_GM.sf2 > > > > > > > > [Install] > > > > WantedBy=default.target > > > > > > > > But when I do a systemctl status fluidsynth, I see this: > > > > > > > > fluidsynth.service - FluidSynth > > > > Loaded: loaded (/lib/systemd/system/fluidsynth.service; enabled; > > > > vendor preset: enabled) > > > > Active: failed (Result: exit-code) since Thu 2020-08-06 08:47:37 > > > > PDT; 5h 6min ago > > > > Process: 838 ExecStart=/usr/bin/fluidsynth -a pulseaudio -m > > > > alsa_seq /usr/share/sounds/sf2/FluidR3_GM.sf2 (code=exited, > > > > status=255/EXCEPTION) > > > > Main PID: 838 (code=exited, status=255/EXCEPTION) > > > > > > > > Aug 06 08:47:36 knute-NUC7PJYH systemd[1]: Started FluidSynth. > > > > Aug 06 08:47:37 knute-NUC7PJYH fluidsynth[838]: fluidsynth: error: > > > > Failed to create PulseAudio connection > > > > Aug 06 08:47:37 knute-NUC7PJYH fluidsynth[838]: Failed to create the > > > > audio driver > > > > Aug 06 08:47:37 knute-NUC7PJYH fluidsynth[838]: FluidSynth runtime > > > > version 2.1.1 > > > > Aug 06 08:47:37 knute-NUC7PJYH fluidsynth[838]: Copyright (C) > > > > 2000-2020 Peter Hanappe and others. > > > > Aug 06 08:47:37 knute-NUC7PJYH fluidsynth[838]: Distributed under the > > > > LGPL license. > > > > Aug 06 08:47:37 knute-NUC7PJYH fluidsynth[838]: SoundFont(R) is a > > > > registered trademark of E-mu Systems, Inc. > > > > Aug 06 08:47:37 knute-NUC7PJYH systemd[1]: fluidsynth.service: Main > > > > process exited, code=exited, status=255/EXCEPTION > > > > Aug 06 08:47:37 knute-NUC7PJYH systemd[1]: fluidsynth.service: Failed > > > > with result 'exit-code'. > > > > > > > > Any ideas why the PulseAudio connection fails? > > > > > > > > --- > > > > Knute Snortum > > > > (via Gmail) > > > > > > > > > > > > --- > > > > Knute Snortum > > > > (via Gmail) > > > > > > > > > > > > On Wed, Aug 5, 2020 at 2:41 PM Ceresa Jean-Jacques > > > > <jean-jacques.cer...@orange.fr> wrote: > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > > > > > >How would you start FluidSynth at startup automatically? - > > > > > > > > > > > > > > > > > > > > Here possible solution. > > > > > > > > > > https://lists.nongnu.org/archive/html/fluid-dev/2020-01/msg00032.html > > > > > > > > > > jjc > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > fluid-dev mailing list > > > > > fluid-dev@nongnu.org > > > > > https://lists.nongnu.org/mailman/listinfo/fluid-dev > > > > > > > > _______________________________________________ > > > > fluid-dev mailing list > > > > fluid-dev@nongnu.org > > > > https://lists.nongnu.org/mailman/listinfo/fluid-dev > > > > > > _______________________________________________ > > > fluid-dev mailing list > > > fluid-dev@nongnu.org > > > https://lists.nongnu.org/mailman/listinfo/fluid-dev > > > > _______________________________________________ > > fluid-dev mailing list > > fluid-dev@nongnu.org > > https://lists.nongnu.org/mailman/listinfo/fluid-dev > > _______________________________________________ > fluid-dev mailing list > fluid-dev@nongnu.org > https://lists.nongnu.org/mailman/listinfo/fluid-dev _______________________________________________ fluid-dev mailing list fluid-dev@nongnu.org https://lists.nongnu.org/mailman/listinfo/fluid-dev