VLC 3.0.16-3 cannot add the Fluidsynth audiocodec

FluidSynth is missing as an option in VLC menu Tools > Preferences > Show settings/All (Advanced Preferences) > Input / Codecs > Audio codecs

The packages fluidsynth and soundfont-fluid and vlc-plugin-fluidsynth-bin are installed, /etc/conf.d/fluidsynth contains the path to the soundfont, the fluidsynth service is running, and fluidsynth can play a MIDI-file from the command line.

This plays perfectly:

$ fluidsynth  /home/freddy/Documents/DOX/Music/reveille.mid
ALSA lib pcm_dsnoop.c:600:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1035:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
/dev/shm/jack_db/__db.001: Permission denied
Cannot open DB environment: Permission denied
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
/dev/shm/jack_db/__db.001: Permission denied
Cannot open DB environment: Permission denied
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 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:1035:(snd_pcm_dmix_open) unable to open slave
/dev/shm/jack_db/__db.001: Permission denied
Cannot open DB environment: Permission denied
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.2.2
Copyright (C) 2000-2021 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
Type 'help' for help topics.

> fluidsynth: warning: Failed to set thread to high priority
quit
cheers!
$ pacman -Qs fluid
local/fluidsynth 2.2.2-1 (pro-audio)
    A real-time software synthesizer based on the SoundFont 2 specifications
local/soundfont-fluid 3.1-3
    FluidR3 soundfont
local/vlc-plugin-fluidsynth-bin 3.0.16.1+b2-1
    FluidSynth plugin for VLC
$ ls -l /usr/share/soundfonts/
total 148052
lrwxrwxrwx 1 root root        14 Sep  3 20:54 default.sf2 -> FluidR3_GM.sf2
-rw-r--r-- 1 root root 148398306 Jul  7  2020 FluidR3_GM.sf2
-rw-r--r-- 1 root root   3201926 Jul  7  2020 FluidR3_GS.sf2
$ sudo find /usr/lib -iname '*fluid*' -exec ls -l {} ';'
-rwxr-xr-x 1 root root 473104 Jul 23 09:57 /usr/lib/libfluidsynth.so.3.0.2
-rw-r--r-- 1 root root 301 Jul 23 09:57 /usr/lib/systemd/user/fluidsynth.service
lrwxrwxrwx 1 root root 18 Jul 23 09:57 /usr/lib/libfluidsynth.so -> libfluidsynth.so.3
-rwxr-xr-x 1 root root 18272 Aug 26 07:12 /usr/lib/vlc/plugins/codec/libfluidsynth_plugin.so
-rwxr-xr-x 1 root root 26528 Aug  2 21:39 /usr/lib/gstreamer-1.0/libgstfluidsynthmidi.so
lrwxrwxrwx 1 root root 22 Jul 23 09:57 /usr/lib/libfluidsynth.so.3 -> libfluidsynth.so.3.0.2
-rw-r--r-- 1 root root 533 Jul 23 09:57 /usr/lib/pkgconfig/fluidsynth.pc
$ cat /etc/conf.d/fluidsynth
# Mandatory parameters (uncomment and edit)
SOUND_FONT=/usr/share/soundfonts/FluidR3_GM.sf2

# Additional optional parameters (may be useful, see 'man fluidsynth' for further info)
OTHER_OPTS='--audio-driver=pulseaudio'
$ systemctl --no-pager --full status  fluidsynth
● fluidsynth.service - FluidSynth Daemon
     Loaded: loaded (/etc/systemd/system/fluidsynth.service; enabled; vendor preset: disabled)
     Active: active (running) since Sat 2021-09-11 14:25:29 CEST; 25min ago
       Docs: man:fluidsynth(1)
   Main PID: 4387 (fluidsynth)
      Tasks: 15 (limit: 19105)
     Memory: 159.7M
        CPU: 3.436s
     CGroup: /system.slice/fluidsynth.service
             └─4387 /usr/bin/fluidsynth -is --audio-driver=alsa --midi-driver=alsa_seq /usr/share/soundfonts/FluidR3_GM.sf2

Sep 11 14:25:29 statPC fluidsynth[4387]: ALSA lib pcm_dmix.c:1035:(snd_pcm_dmix_open) unable to open slave
Sep 11 14:25:29 statPC fluidsynth[4387]: Cannot connect to server socket err = No such file or directory
Sep 11 14:25:29 statPC fluidsynth[4387]: Cannot connect to server request channel
Sep 11 14:25:29 statPC fluidsynth[4387]: jack server is not running or cannot be started
Sep 11 14:25:29 statPC fluidsynth[4387]: JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Sep 11 14:25:29 statPC fluidsynth[4387]: JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Sep 11 14:25:29 statPC systemd[1]: Started FluidSynth Daemon.
Sep 11 14:25:29 statPC fluidsynth[4387]: ALSA lib pcm_dmix.c:1035:(snd_pcm_dmix_open) unable to open slave
Sep 11 14:25:29 statPC fluidsynth[4387]: fluidsynth: error: Failed to open the "default" audio device
Sep 11 14:25:29 statPC fluidsynth[4387]: Failed to create the audio driver. Giving up.
$ inxi --admin --verbosity=7 --filter --no-host --width
System:
  Kernel: 5.14.0-0-MANJARO x86_64 bits: 64 compiler: gcc v: 11.1.0
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.14-x86_64
  root=UUID=102be665-2ada-4053-8e62-c1994e864d0e ro nosplash apparmor=1
  security=apparmor noresume nohibernate udev.log_priority=3
  Desktop: KDE Plasma 5.22.5 tk: Qt 5.15.2 wm: kwin_x11 vt: 1 dm: SDDM
  Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop Mobo: ASUSTeK model: PRIME B450-PLUS v: Rev X.0x
  serial: <filter> UEFI-[Legacy]: American Megatrends v: 2008 date: 12/06/2019
Battery:
  Device-1: hidpp_battery_0 model: Logitech M215 serial: <filter>
  charge: 55% (should be ignored) rechargeable: yes status: Discharging
Memory:
  RAM: total: 15.56 GiB used: 1.89 GiB (12.2%)
  RAM Report: permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: 6-Core model: AMD Ryzen 5 3600 bits: 64 type: MT MCP arch: Zen 2
  family: 17 (23) model-id: 71 (113) stepping: 0 microcode: 8701013 cache:
  L2: 3 MiB bogomips: 86270
  Speed: 2742 MHz min/max: 2200/3600 MHz boost: enabled Core speeds (MHz):
  1: 2742 2: 3797 3: 2196 4: 2191 5: 2051 6: 2193 7: 2196 8: 2195 9: 3591
  10: 3593 11: 2052 12: 2193
  Flags: 3dnowprefetch abm adx aes aperfmperf apic arat avic avx avx2 bmi1
  bmi2 bpext cat_l3 cdp_l3 clflush clflushopt clwb clzero cmov cmp_legacy
  constant_tsc cpb cpuid cqm cqm_llc cqm_mbm_local cqm_mbm_total cqm_occup_llc
  cr8_legacy cx16 cx8 de decodeassists extapic extd_apicid f16c flushbyasid
  fma fpu fsgsbase fxsr fxsr_opt ht hw_pstate ibpb ibs irperf lahf_lm lbrv lm
  mba 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 rdpid rdpru rdrand rdseed rdt_a rdtscp rep_good sep sev sev_es
  sha_ni skinit smap smca sme smep ssbd sse sse2 sse4_1 sse4_2 sse4a ssse3
  stibp succor svm svm_lock syscall tce topoext tsc tsc_scale umip v_spec_ctrl
  v_vmsave_vmload vgif vmcb_clean vme vmmcall wbnoinvd wdt xgetbv1 xsave
  xsavec xsaveerptr xsaveopt xsaves
  Vulnerabilities: Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: spec_store_bypass
  mitigation: Speculative Store Bypass disabled via prctl and seccomp
  Type: spectre_v1
  mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Full AMD retpoline, IBPB: conditional, STIBP:
  conditional, RSB filling
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: AMD Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]
  vendor: Gigabyte driver: amdgpu v: kernel bus-ID: 08:00.0 chip-ID: 1002:67df
  class-ID: 0300
  Display: x11 server: X.Org 1.20.13 compositor: kwin_x11 driver:
  loaded: amdgpu,ati unloaded: modesetting alternate: fbdev,vesa
  display-ID: :0 screens: 1
  Screen-1: 0 s-res: 4480x2160 s-dpi: 96 s-size: 1181x569mm (46.5x22.4")
  s-diag: 1311mm (51.6")
  Monitor-1: DisplayPort-2 res: 3840x2160 hz: 60 dpi: 68
  size: 1440x810mm (56.7x31.9") diag: 1652mm (65")
  Monitor-2: HDMI-A-0 res: 640x480 hz: 60 dpi: 11
  size: 1440x810mm (56.7x31.9") diag: 1652mm (65")
  OpenGL: renderer: Radeon RX 590 Series (POLARIS10 DRM 3.42.0
  5.14.0-0-MANJARO LLVM 12.0.1)
  v: 4.6 Mesa 21.2.1 direct render: Yes
Audio:
  Device-1: AMD Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590]
  vendor: Gigabyte driver: snd_hda_intel v: kernel bus-ID: 08:00.1
  chip-ID: 1002:aaf0 class-ID: 0403
  Device-2: AMD Starship/Matisse HD Audio vendor: ASUSTeK
  driver: snd_hda_intel v: kernel bus-ID: 0a:00.4 chip-ID: 1022:1487
  class-ID: 0403
  Sound Server-1: ALSA v: k5.14.0-0-MANJARO running: yes
  Sound Server-2: JACK v: 1.9.19 running: no
  Sound Server-3: PulseAudio v: 15.0 running: yes
  Sound Server-4: PipeWire v: 0.3.34 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
  vendor: ASUSTeK PRIME B450M-A driver: r8169 v: kernel port: f000
  bus-ID: 03:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
  broadcast: <filter>
  IP v6: <filter> type: noprefixroute scope: link
  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: 2.29 TiB used: 1.57 TiB (68.8%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: Western Digital model: WD10EADS-00L5B1
  size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 3.0 Gb/s
  type: N/A serial: <filter> rev: 1A01 scheme: MBR
  ID-2: /dev/sdb maj-min: 8:16 vendor: Western Digital model: WD10EADS-00L5B1
  size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 3.0 Gb/s
  type: N/A serial: <filter> rev: 1A01 scheme: GPT
  ID-3: /dev/sdc maj-min: 8:32 vendor: A-Data model: SU800NS38
  size: 476.94 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
  type: SSD serial: <filter> rev: 8B scheme: MBR
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 468.13 GiB size: 459.79 GiB (98.22%)
  used: 259.52 GiB (56.4%) fs: ext4 dev: /dev/sdc1 maj-min: 8:33 label: m2root
  uuid: 102be665-2ada-4053-8e62-c1994e864d0e
  ID-2: /home/adisk raw-size: 931.51 GiB size: 915.89 GiB (98.32%)
  used: 637.21 GiB (69.6%) fs: ext4 dev: /dev/sda1 maj-min: 8:1 label: adisk
  uuid: a0f67169-c4c3-48e9-bafe-a73dc0983560
  ID-3: /home/bdisk raw-size: 931.51 GiB size: 915.89 GiB (98.32%)
  used: 712.91 GiB (77.8%) fs: ext4 dev: /dev/sdb1 maj-min: 8:17 label: bdisk
  uuid: ed96f3d3-edea-43bc-8418-2223e4ec312d
  ID-4: /home/<filter>/cryptomount.fredox.vol raw-size: 600 MiB
  size: 574.6 MiB (95.76%) used: 432.8 MiB (75.3%) fs: ext4 dev: /dev/dm-1
  maj-min: 254:1 mapped: loop0 label: N/A uuid: N/A
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 8.8 GiB used: 0 KiB (0.0%) priority: -2
  dev: /dev/dm-0 maj-min: 254:0 mapped: swap label: swap
  uuid: 65d7516f-103b-46ef-a78c-867b3d72ee7e
Unmounted:
  ID-1: /dev/sdc2 maj-min: 8:34 size: 8.8 GiB fs: ext2 label: cryptswap
  uuid: 09a58730-026a-485c-a0a5-f83c2fa6e9de
USB:
  Hub-1: 1-0:1 info: Full speed (or root) Hub ports: 10 rev: 2.0
  speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Hub-2: 1-2:2 info: Genesys Logic Hub ports: 4 rev: 2.1 speed: 480 Mb/s
  power: 100mA chip-ID: 05e3:0610 class-ID: 0900
  Device-1: 1-4:3 info: Jing-Mold Enterprise 2.4G Dongle
  type: Keyboard,Mouse,HID driver: hid-generic,usbhid interfaces: 3 rev: 2.0
  speed: 12 Mb/s power: 100mA chip-ID: 05af:0906 class-ID: 0301
  Device-2: 1-7:4 info: Logitech Unifying Receiver type: Mouse,HID
  driver: logitech-djreceiver,usbhid interfaces: 2 rev: 2.0 speed: 12 Mb/s
  power: 98mA chip-ID: 046d:c52f class-ID: 0300
  Device-3: 1-9:5 info: NZXT Smart Device V2 type: HID
  driver: hid-generic,usbhid interfaces: 1 rev: 2.0 speed: 12 Mb/s
  power: 100mA chip-ID: 1e71:2006 class-ID: 0300 serial: <filter>
  Hub-3: 2-0:1 info: Full speed (or root) Hub ports: 4 rev: 3.1 speed: 10 Gb/s
  chip-ID: 1d6b:0003 class-ID: 0900
  Hub-4: 2-2:2 info: Genesys Logic USB3.0 Hub ports: 4 rev: 3.0 speed: 5 Gb/s
  chip-ID: 05e3:0617 class-ID: 0900
  Hub-5: 3-0:1 info: Full speed (or root) Hub ports: 4 rev: 2.0
  speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Hub-6: 4-0:1 info: Full speed (or root) Hub ports: 4 rev: 3.1 speed: 10 Gb/s
  chip-ID: 1d6b:0003 class-ID: 0900
Sensors:
  System Temperatures: cpu: 51.9 C mobo: N/A gpu: amdgpu temp: 52.0 C
  Fan Speeds (RPM): N/A gpu: amdgpu fan: 785
Info:
  Processes: 314 Uptime: 1h 30m wakeups: 37 Init: systemd v: 248
  tool: systemctl Compilers: gcc: 11.1.0 clang: 12.0.1 Packages: 1298
  pacman: 1295 lib: 278 flatpak: 3 Shell: Bash v: 5.1.8 running-in: konsole
  inxi: 3.3.06

Have you tried this – MIDI - VLC - ArchWiki ?

nikgnomic, please be more specific about what I should try.
I have created the links to the sundfonts, but VLC does not care.

$ ls -l /usr/share/sounds/sf2  /usr/share/soundfonts
/usr/share/soundfonts:
total 148052
lrwxrwxrwx 1 root root        14 Sep  3 20:54 default.sf2 -> FluidR3_GM.sf2
-rw-r--r-- 1 root root 148398306 Jul  7  2020 FluidR3_GM.sf2
-rw-r--r-- 1 root root   3201926 Jul  7  2020 FluidR3_GS.sf2

/usr/share/sounds/sf2:
total 0
lrwxrwxrwx 1 root root 31 Sep 11 19:21 default.sf2 -> ../../soundfonts/FluidR3_GM.sf2

The wiki says to install “vlc-plugin-fluidsynth-bin package (without the latter, the audio codec will not appear in the preferences).”

I cannot find this plugin in the list of plugins that VLC can show on the Plugins tab in menu Tools > Plugins and extensions, and FluidSynth is missing as an option in VLC menu Tools > Preferences > Show settings/All (Advanced Preferences) > Input / Codecs > Audio codecs.

The packages fluidsynth and soundfont-fluid and vlc-plugin-fluidsynth-bin are installed, /etc/conf.d/fluidsynth contains the path to the soundfont, the fluidsynth service is running, and fluidsynth can play a MIDI-file from the command line.

I suspect tha VLC does not find the plugin vlc-plugin-fluidsynth-bin for some reason. The file /usr/lib/vlc/plugins/codec/libfluidsynth_plugin.so has the same file attributes as all the other files in the same directory.

I have refreshed the plugins cache, but Fluidsynth is still not listed as an audio codec

$ sudo /usr/lib/vlc/vlc-cache-gen /usr/lib/vlc/plugins

I suspect tha VLC does not find the plugin vlc-plugin-fluidsynth-bin

Archwiki confirms this is what is likely to cause the codec to be missing

Please post response to show all related files and symlinks

ls /usr/lib/ | grep fluidsynth
$ ls -l /usr/lib/ | grep fluidsynth
lrwxrwxrwx   1 root root        18 Jul 23 09:57 libfluidsynth.so -> libfluidsynth.so.3
lrwxrwxrwx   1 root root        22 Jul 23 09:57 libfluidsynth.so.3 -> libfluidsynth.so.3.0.2
-rwxr-xr-x   1 root root    473104 Jul 23 09:57 libfluidsynth.so.3.0.2

Comments on plugin AUR page advise VLC is seeking libfluidsynth.so.2 and suggest adding a symlink

sudo ln -s libfluidsynth.so.3.0.2 /usr/lib/libfluidsynth.so.2

Fluidsynth is now detected and available in Audio Codecs settings for VLC

1 Like

:clap:Thank you very much nikgnomic.
Your suggested link works perfectly, and now VLC can play MIDI-files :+1:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.