Crackling sound (fluidsynth)

This only happened when I started setting up fluidsynth.

Now even

abeep -f 750 -r 5 -d 100 -n -f 1000 -r 3 -d 200 -n -f 2000 -r 3 -d 200

causes crackling, but a couple weeks ago (when I didn’t have fluidsynth setup) it works.
I’m using pipewire btw.

System:
  Kernel: 5.19.3-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=91691606-aa74-48ac-9cb5-34b6d123b103 rw rootflags=subvol=@
    sysrq_always_enabled=1 loglevel=3 nowatchdog nvme_load=YES
  Desktop: KDE Plasma v: 5.25.4 tk: Qt v: 5.15.5 wm: kwin_x11 vt: 1
    dm: SDDM Distro: EndeavourOS base: Arch Linux
Machine:
  Type: Laptop System: HP product: HP Laptop 15-bs0xx v: Type1ProductConfigId
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: HP model: 832C v: 25.56 serial: <superuser required> UEFI: Insyde
    v: F.68 date: 07/22/2021
Battery:
  ID-1: BAT1 charge: 23.4 Wh (100.0%) condition: 23.4/31.1 Wh (75.4%)
    volts: 12.5 min: 11.1 model: COMPAL PABAS0241231 type: Li-ion
    serial: <filter> status: full
  Device-1: hidpp_battery_0 model: Logitech K350 serial: <filter> charge: 70%
    (should be ignored) rechargeable: yes status: discharging
  Device-2: hidpp_battery_1 model: Logitech Marathon Mouse/Performance Plus
    M705 serial: <filter> charge: 10% (should be ignored) rechargeable: yes
    status: discharging
CPU:
  Info: model: Intel Pentium N3710 bits: 64 type: MCP arch: Airmont
    built: 2015-17 process: Intel 14nm family: 6 model-id: 0x4C (76)
    stepping: 4 microcode: 0x411
  Topology: cpus: 1x cores: 4 smt: <unsupported> cache: L1: 224 KiB
    desc: d-4x24 KiB; i-4x32 KiB L2: 2 MiB desc: 2x1024 KiB
  Speed (MHz): avg: 1606 high: 1933 min/max: 480/2560 scaling:
    driver: intel_cpufreq governor: schedutil cores: 1: 1933 2: 1907 3: 1316
    4: 1271 bogomips: 12800
  Flags: ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds mitigation: Clear CPU buffers; SMT disabled
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data status: Not affected
  Type: retbleed status: Not affected
  Type: spec_store_bypass status: Not affected
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW,
    STIBP: disabled, RSB filling, PBRSB-eIBRS: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx
    Integrated Graphics vendor: Hewlett-Packard driver: i915 v: kernel
    arch: Gen-8 process: Intel 14nm built: 2014-15 ports: active: eDP-1
    empty: DP-1, DP-2, HDMI-A-1, HDMI-A-2 bus-ID: 00:02.0 chip-ID: 8086:22b1
    class-ID: 0300
  Device-2: Chicony HP Webcam type: USB driver: uvcvideo bus-ID: 1-5.2:5
    chip-ID: 04f2:b5db class-ID: 0e02 serial: <filter>
  Display: x11 server: X.Org v: 21.1.4 compositor: kwin_x11 driver: X:
    loaded: modesetting alternate: fbdev,intel,vesa gpu: i915 display-ID: :0
    screens: 1
  Screen-1: 0 s-res: 1366x768 s-dpi: 96 s-size: 361x203mm (14.21x7.99")
    s-diag: 414mm (16.31")
  Monitor-1: eDP-1 model: AU Optronics 0x10ec built: 2016 res: 1366x768
    hz: 60 dpi: 101 gamma: 1.2 size: 344x193mm (13.54x7.6") diag: 394mm (15.5")
    ratio: 16:9 modes: 1366x768
  OpenGL: renderer: Mesa Intel HD Graphics 405 (BSW) v: 4.6 Mesa 22.1.6
    direct render: Yes
Audio:
  Device-1: Intel Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series
    High Definition Audio vendor: Hewlett-Packard driver: snd_hda_intel
    v: kernel bus-ID: 00:1b.0 chip-ID: 8086:2284 class-ID: 0403
  Sound Server-1: ALSA v: k5.19.3-zen1-1-zen running: yes
  Sound Server-2: PulseAudio v: 16.1 running: no
  Sound Server-3: PipeWire v: 0.3.56 running: yes
Network:
  Device-1: Realtek RTL8188EE Wireless Network Adapter
    vendor: Hewlett-Packard driver: rtl8188ee v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 port: 2000 bus-ID: 02:00.0 chip-ID: 10ec:8179
    class-ID: 0280
  IF: wlan0 state: up mac: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Hewlett-Packard driver: r8169 v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 port: 1000 bus-ID: 03:00.0 chip-ID: 10ec:8168
    class-ID: 0200
  IF: eno1 state: down mac: <filter>
Drives:
  Local Storage: total: 465.76 GiB used: 335.93 GiB (72.1%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: Seagate model: ST500LT012-1DG142
    size: 465.76 GiB block-size: physical: 4096 B logical: 512 B
    speed: 6.0 Gb/s type: HDD rpm: 5400 serial: <filter> rev: YAM1
    scheme: GPT
Partition:
  ID-1: / raw-size: 60 GiB size: 60 GiB (100.00%) used: 38.57 GiB (64.3%)
    fs: btrfs dev: /dev/sda5 maj-min: 8:5
  ID-2: /boot/efi raw-size: 260 MiB size: 256 MiB (98.46%) used: 153 MiB
    (59.8%) fs: vfat dev: /dev/sda1 maj-min: 8:1
  ID-3: /home raw-size: 60 GiB size: 60 GiB (100.00%) used: 38.57 GiB
    (64.3%) fs: btrfs dev: /dev/sda5 maj-min: 8:5
  ID-4: /var/log raw-size: 60 GiB size: 60 GiB (100.00%) used: 38.57 GiB
    (64.3%) fs: btrfs dev: /dev/sda5 maj-min: 8:5
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: 51.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 194 Uptime: 48m wakeups: 14 Memory: 3.74 GiB used: 1.88 GiB
  (50.3%) Init: systemd v: 251 default: graphical tool: systemctl
  Compilers: gcc: 12.2.0 Packages: pacman: 1296 lib: 324 Shell: Zsh v: 5.9
  default: Bash v: 5.1.16 running-in: yakuake inxi: 3.3.20
coolcrew45@CoolCrew45-HP-Laptop-UNDERKILL-15bs0xx ~> 

Please, include fluidsynth in the headline of this thread, to be more clear, as I might have crackling sound through my window, as well…

Thanks. Did you check out the ArchWiki?

Conflicting with PulseAudio

If your fluidsynth application is set to use alsa as driver, the sound card will be accessed directly and pulseaudio and applications using pulseaudio will not be able to work properly. You can modify the configuration file /etc/conf.d/fluidsynth and change the driver to PulseAudio, then restart fluidsynth and PulseAudio:

/etc/conf.d/fluidsynth

OTHER_OPTS=‘-a pulseaudio -m alsa_seq -r 48000’

…or simply reboot.

AHA! turns out for some reason fluidsynth starts on startup and you have to manuall KILL it if you want to have good sounding rest-of-everything.

On windwoes I could use VirtualMIDISynth and have it on all the time and it Just Worked ™