Clicks and pops while using sfizz with zynthian mainboard

Hello everyone,

I’m using the zynthian main board with sfizz_jack (v1.2.3, compiled from source on the develop branch, commit f5c6e29f from March 2025) on a Raspberry Pi 4 (4GB RAM) with Raspberry Pi OS for a hardware sampler project.

The system works great most of the time, but I get sporadic clicks and pops - maybe one every 30-60 seconds. They’re not consistent and don’t correlate with any specific action. I’ve already done extensive optimization and I’m running out of ideas.

JACK Configuration:

  • jackd -R -P 90 -d alsa -d hw:5,0 -r 48000 -p 128 -n 3

  • Buffer: 128 samples (2.6ms latency)

  • sfizz runs with chrt -f 80 (FIFO realtime priority 80)

  • I also tried 256 samples buffer — clicks still happen occasionally

CPU/Process Isolation:

  • CPU governor fixed to performance (1.8GHz constant, no frequency scaling)

  • Core 0: dedicated to JACK + sfizz only (taskset -c 0)

  • Core 1: dedicated to effects (jalv delay + reverb via LV2, jconvolver for IR)

  • Core 2-3: Python application (GPIO, display, web server)

  • Python process pinned to cores 2,3 via os.sched_setaffinity(0, {2, 3})

  • IRQ affinity: USB IRQs (34), SD/MMC (41), and I2C (44) moved off cores 0-1

System Optimizations:

  • Swap completely disabled (removed /var/swap, masked zramswap and rpi-setup-loop services)

  • WiFi power management disabled (iwconfig wlan0 power off)

  • Bluetooth disabled and masked

  • LightDM (desktop GUI) disabled — headless operation

  • Disabled services: ModemManager, CUPS, Tor, NFS, Avahi, accounts-daemon, polkit

  • force_turbo=1 in config.txt

  • SPI display (ST7789 TFT) updates throttled with 3ms sleep between strips to yield CPU time for JACK

File I/O Isolation:

  • All file saves (JSON configs, SFZ edits) are deferred to a background thread via a queue — no blocking I/O on the button/audio threads

  • I2C polling for PCF8575 GPIO expander reduced from 100Hz to 50Hz

What I’ve monitored:

  • dmesg for xruns/underruns: zero detected over 10+ minute sessions

  • CPU usage per core: core 0 (sfizz) rarely exceeds 15%, core 1 (effects) under 5%

  • RAM: ~1.5GB used out of 4GB, no swap activity

  • The clicks don’t show up as JACK xruns in dmesg

Audio Chain:

sfizz:output → MDA Delay (jalv, core 1) → Dragonfly Plate Reverb (jalv, core 1) → system:playback
                                        → jconvolver (IR, core 1) → system:playback

All plugins run with realtime priority (chrt -f 75-80). The effects chain reconnection (jack_connect/disconnect) is batched into single shell commands to minimize subprocess spawning.

Sample Format:

  • WAV 16-bit 48kHz stereo

  • Polyphony limited to 32

What I’ve noticed:

  • Clicks reduced after pinning processes to specific cores

  • Clicks still appear occasionally — completely random, no pattern with note velocity, pedal, or specific notes

  • The TFT display uses SPI at 24MHz which shares bus time, but clicks happen even when display is idle

  • When jconvolver (IR convolution) is active, clicks seem slightly more frequent

Kernel:

  • Linux 6.12.62+rpt-rpi-v8 PREEMPT (not PREEMPT_RT)

  • I haven’t tried the RT kernel yet — would this make a significant difference for this use case?

Did you guys know any tips since you use sfizz in zynthian and we are basically using the same mainboard and the same pi?

I’ve also posted on the sfizz GitHub discussions but haven’t gotten a response. Any help would be greatly appreciated!

Thanks in advance. João