[LAU] setting fluidsynth as a service in debian/systemd

Tito Latini tito.01beta at gmail.com
Fri Oct 3 17:45:38 UTC 2014


On Thu, Oct 02, 2014 at 10:16:18PM +0200, Federico Bruni wrote:
> Hi
> 
> you are my last resource.

ok, it's a good start for a soap opera

> I'm trying to start fluidsynth in daemon mode (-s) at the startup. At 
> first I tried to adapt a guide for Arch but I realized that in Debian 
> (sid) the configuration is different:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760210
> 
> I'm using systemd. I've tried several times to write a proper 
> fluidsynth.service but I always failed.

I don't use systemd so I cannot test it, however the file used by
archlinux is

https://projects.archlinux.org/svntogit/packages.git/tree/trunk/fluidsynth.systemd?h=packages/fluidsynth

If the rule "After=sound.target" implies "start fluidsynth after the
start of the audio server", it should work.

If you want to use a config file for the environment variables,
a template/example is

https://projects.archlinux.org/svntogit/packages.git/tree/trunk/fluidsynth.conf?h=packages/fluidsynth

so `-a jack' if you use jack and `-m jack' if you use jack midi, etc.

    fluidsynth -a help
    fluidsynth -m help

> Requested a period size of 64, got 940 instead
> [...]
> Requested 16 periods, got 8 instead

Probably the correct parameters with `-a alsa' (no jack,
no pulseaudio, etc) in this case are

    fluidsynth -is -a alsa -r 48000 -z 1024 -c 8

because I presume 940 is "1024 * 44100 / 48000".

If systemd fails (or for other reasons), it is possible to write a
simple script where the core is

    nohup fluidsynth -is -a jack -m jack -r 48000 \
          /usr/share/sounds/sf2/FluidR3_GM.sf2 > /dev/null &

set/get the settings with netcat, telnet, etc:

    nc -q1 localhost 9800 <<< settings

    echo set synth.gain 0.5 > /dev/tcp/localhost/9800

and stop with
    
    pkill fluidsynth


More information about the Linux-audio-user mailing list