Attempting to use Fluidsynth as a daemon

I have another topic here that explains how I’m trying to get music to play for an old game that uses MIDI for its soundtrack. I’ve managed to figure out how to get it started as a daemon but I’m not sure what is happening when I run the command. Things aren’t working properly. This is the output of fluidsynth --audio-driver=pulseaudio /usr/share/soundfonts/FluidR3_GM.sf2

ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_a52.c:1001:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
FluidSynth runtime version 2.3.2
Copyright (C) 2000-2023 Peter Hanappe and others.
Distributed under the LGPL license.
SoundFont(R) is a registered trademark of Creative Technology Ltd.

fluidsynth: warning: Failed to set thread to high priority
fluidsynth: Using PulseAudio driver
Type 'help' for help topics.

> fluidsynth: warning: Failed to set thread to high priority

I looked into setting thread as a high priority here and found a similar problem and output posted here.

I also messed around trying to turn jack server on as well.

Before going any further I figured I’d ask here and see if anyone might be able to help me figure out what direction to head in.

Here’s my inxi output.

System:
  Kernel: 6.1.31-2-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 13.1.1
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.1-x86_64
    root=UUID=40809886-d17c-433b-876f-89a03d053b64 rw quiet splash apparmor=1
    security=apparmor udev.log_priority=3
  Desktop: GNOME v: 44.1 tk: GTK v: 3.24.37 wm: gnome-shell dm: GDM v: 44.1
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop System: Gigabyte product: AB350-Gaming v: N/A
    serial: <superuser required>
  Mobo: Gigabyte model: AB350-Gaming-CF v: x.x serial: <superuser required>
    UEFI: American Megatrends v: F21 date: 02/08/2018
Battery:
  Message: No system battery data found. Is one present?
Memory:
  System RAM: available: 15.57 GiB used: 5.8 GiB (37.3%)
  RAM Report: permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: AMD Ryzen 5 1600 bits: 64 type: MT MCP arch: Zen level: v3
    note: check built: 2017-19 process: GF 14nm family: 0x17 (23) model-id: 1
    stepping: 1 microcode: 0x8001129
  Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
    L1: 576 KiB desc: d-6x32 KiB; i-6x64 KiB L2: 3 MiB desc: 6x512 KiB L3: 16 MiB
    desc: 2x8 MiB
  Speed (MHz): avg: 1947 high: 3690 min/max: 1550/3200 boost: enabled
    scaling: driver: acpi-cpufreq governor: schedutil cores: 1: 1362 2: 1476
    3: 1550 4: 1550 5: 3200 6: 2789 7: 1550 8: 1550 9: 1550 10: 3690 11: 1550
    12: 1550 bogomips: 76669
  Flags: 3dnowprefetch abm adx aes aperfmperf apic arat avic avx avx2 bmi1
    bmi2 bpext clflush clflushopt clzero cmov cmp_legacy constant_tsc cpb
    cpuid cr8_legacy cx16 cx8 de decodeassists extapic extd_apicid f16c
    flushbyasid fma fpu fsgsbase fxsr fxsr_opt ht hw_pstate irperf lahf_lm
    lbrv lm mca mce misalignsse mmx mmxext monitor movbe msr mtrr mwaitx
    nonstop_tsc nopl npt nrip_save nx osvw overflow_recov pae pat pausefilter
    pclmulqdq pdpe1gb perfctr_core perfctr_llc perfctr_nb pfthreshold pge pni
    popcnt pse pse36 rapl rdrand rdseed rdtscp rep_good sep sev sha_ni skinit
    smap smca smep ssbd sse sse2 sse4_1 sse4_2 sse4a ssse3 succor svm svm_lock
    syscall tce topoext tsc tsc_scale v_vmsave_vmload vgif vmcb_clean vme
    vmmcall wdt xgetbv1 xsave xsavec xsaveerptr xsaveopt
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed mitigation: untrained return thunk; SMT vulnerable
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Retpolines, STIBP: disabled, RSB filling,
    PBRSB-eIBRS: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA GP106 [GeForce GTX 1060 3GB] vendor: Micro-Star MSI
    driver: nvidia v: 530.41.03 alternate: nouveau,nvidia_drm non-free: 530.xx+
    status: current (as of 2023-05) arch: Pascal code: GP10x process: TSMC 16nm
    built: 2016-21 pcie: gen: 1 speed: 2.5 GT/s lanes: 16 link-max: gen: 3
    speed: 8 GT/s bus-ID: 08:00.0 chip-ID: 10de:1c02 class-ID: 0300
  Device-2: Logitech CrystalCam driver: snd-usb-audio,uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-2:2 chip-ID: 046d:0894
    class-ID: 0102 serial: <filter>
  Display: x11 server: X.Org v: 21.1.8 with: Xwayland v: 23.1.1
    compositor: gnome-shell driver: X: loaded: nvidia gpu: nvidia display-ID: :1
    screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x286mm (20.00x11.26")
    s-diag: 583mm (22.95")
  Monitor-1: HDMI-0 res: 1920x1080 hz: 60 dpi: 82
    size: 598x336mm (23.54x13.23") diag: 686mm (27.01") modes: N/A
  API: OpenGL v: 4.6.0 NVIDIA 530.41.03 renderer: NVIDIA GeForce GTX 1060
    3GB/PCIe/SSE2 direct-render: Yes
Audio:
  Device-1: NVIDIA GP106 High Definition Audio vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 08:00.1 chip-ID: 10de:10f1 class-ID: 0403
  Device-2: AMD Family 17h HD Audio vendor: Gigabyte driver: snd_hda_intel
    v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 0a:00.3
    chip-ID: 1022:1457 class-ID: 0403
  Device-3: Logitech CrystalCam driver: snd-usb-audio,uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-2:2 chip-ID: 046d:0894
    class-ID: 0102 serial: <filter>
  API: ALSA v: k6.1.31-2-MANJARO status: kernel-api with: aoss
    type: oss-emulator tools: alsactl,alsamixer,amixer
  Server-1: sndiod v: N/A status: off tools: aucat,midicat,sndioctl
  Server-2: JACK v: 1.9.22 status: off tools: jack_control
  Server-3: PipeWire v: 0.3.70 status: off with: 1: pipewire-media-session
    status: off 2: pipewire-alsa type: plugin tools: pw-cat,pw-cli
  Server-4: PulseAudio v: 16.1 status: active tools: pacat,pactl,pavucontrol
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Gigabyte driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s
    lanes: 1 port: f000 bus-ID: 03:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp3s0 state: up speed: 100 Mbps duplex: full mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: noprefixroute scope: link
  Device-2: Broadcom BCM4360 802.11ac Wireless Network Adapter driver: wl
    v: kernel modules: bcma pcie: gen: 1 speed: 2.5 GT/s lanes: 1 bus-ID: 07:00.0
    chip-ID: 14e4:43a0 class-ID: 0280
  IF: wlp7s0 state: down mac: <filter>
  WAN IP: <filter>
Bluetooth:
  Message: No bluetooth data found.
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 698.65 GiB used: 505.39 GiB (72.3%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 850 EVO 250GB
    size: 232.89 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    tech: SSD serial: <filter> fw-rev: 3B6Q scheme: GPT
  ID-2: /dev/sdb maj-min: 8:16 vendor: Seagate model: ST3500312CS
    size: 465.76 GiB block-size: physical: 512 B logical: 512 B speed: 3.0 Gb/s
    tech: HDD rpm: 5900 serial: <filter> fw-rev: CA12 scheme: MBR
  Optical-1: /dev/sr0 vendor: HL-DT-ST model: BD-RE BH30N rev: A201
    dev-links: cdrom
  Features: speed: 40 multisession: yes audio: yes dvd: yes
    rw: cd-r,cd-rw,dvd-r,dvd-ram state: running
Partition:
  ID-1: / raw-size: 232.59 GiB size: 227.88 GiB (97.98%)
    used: 209.55 GiB (92.0%) fs: ext4 dev: /dev/sda2 maj-min: 8:2 label: N/A
    uuid: 40809886-d17c-433b-876f-89a03d053b64
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 288 KiB (0.1%) fs: vfat dev: /dev/sda1 maj-min: 8:1 label: NO_LABEL
    uuid: E832-7B45
  ID-3: /run/media/nicholas/second disk raw-size: 434.51 GiB
    size: 426.62 GiB (98.18%) used: 295.83 GiB (69.3%) fs: ext4 dev: /dev/sdb2
    maj-min: 8:18 label: second disk uuid: 1ec047b4-ec64-4d28-8893-f16ad7899256
Swap:
  Alert: No swap data was found.
Unmounted:
  ID-1: /dev/sdb1 maj-min: 8:17 size: 31.25 GiB fs: swap label: N/A
    uuid: 14863704-322a-453c-b7a5-87bba34bb094
USB:
  Hub-1: 1-0:1 info: hi-speed hub with single TT ports: 10 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Device-1: 1-2:2 info: Logitech CrystalCam type: video,audio
    driver: snd-usb-audio,uvcvideo interfaces: 4 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 power: 500mA
    chip-ID: 046d:0894 class-ID: 0102 serial: <filter>
  Hub-2: 2-0:1 info: super-speed hub ports: 4 rev: 3.1
    speed: 10 Gb/s (1.16 GiB/s) lanes: 1 mode: 3.2 gen-2x1 chip-ID: 1d6b:0003
    class-ID: 0900
  Hub-3: 3-0:1 info: hi-speed hub with single TT ports: 4 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Device-1: 3-3:2 info: Ducky One 3̠ type: HID,keyboard,mouse
    driver: hid-generic,usbhid interfaces: 5 rev: 1.1 speed: 12 Mb/s (1.4 MiB/s)
    lanes: 1 mode: 1.1 power: 100mA chip-ID: 3233:1011 class-ID: 0300
    serial: <filter>
  Device-2: 3-4:3 info: Logitech G502 Proteus Spectrum Optical Mouse
    type: mouse,HID driver: hid-generic,usbhid interfaces: 2 rev: 2.0
    speed: 12 Mb/s (1.4 MiB/s) lanes: 1 mode: 1.1 power: 300mA
    chip-ID: 046d:c332 class-ID: 0300 serial: <filter>
  Hub-4: 4-0:1 info: super-speed hub ports: 4 rev: 3.0
    speed: 5 Gb/s (596.0 MiB/s) lanes: 1 mode: 3.2 gen-1x1 chip-ID: 1d6b:0003
    class-ID: 0900
Sensors:
  System Temperatures: cpu: 37.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 342 Uptime: 9h 11m wakeups: 0 Init: systemd v: 253
  default: graphical tool: systemctl Compilers: gcc: 13.1.1 clang: 15.0.7
  Packages: 2076 pm: pacman pkgs: 2067 libs: 518 tools: gnome-software,pamac
  pm: flatpak pkgs: 0 pm: snap pkgs: 9 Shell: Zsh v: 5.9
  running-in: gnome-terminal inxi: 3.3.27

Any help would be appreciated. Thank you.

Terminal response from fluidsynth is usually this verbose, even when using fluidsynth --quiet --help to see command options

The simplest method to run fluidsynth as a daemon is to use the systemd service:

  1. Open fluidsynth configuration file in a text editor: sudo nano /etc/conf.d/fluidsynth

  2. Delete comment tag # at beginning of line 2 and edit name of soundfont:

    SOUND_FONT=/usr/share/soundfonts/FluidR3_GM.sf2
    
  3. Delete comment tag # at beginning of line 5:

    OTHER_OPTS='-a pulseaudio -m alsa_seq -p FluidSynth\ GM -r 48000'
    
  4. Ctrl+O to save changes; Ctrl+X to exit nano and reboot system

Fluidsynth can then be started without the preamble messages:

systemctl --user start fluidsynth

FluidSynth output should be visible as an audio input to PulseAudio

pactl list sink-inputs 

and FluidSynth GM MIDI input client should be visible in ALSA

aconnect -l