Latency using pisound with samplerbox

Hi, I’m getting about 50 ms of latency when running SamplerBox with Pisound on Raspberry Pi.

I tried changing BLOCKSIZE in configuration.txt of the samplerbox:

BLOCKSIZE = Low → still forces high buffer size (period_size: 416, buffer_size: 2080).

BLOCKSIZE = 104 → SamplerBox shows blocksize=104, but ALSA reports period_size: 626, buffer_size: 1878.

BLOCKSIZE = 204 → ALSA falls back to period_size: 624, buffer_size: 1872.

I also tried modifying audio.py to add latency=0.02 in the sounddevice.Stream. This reduced the buffer size, but caused strong clicks and pops.

It seems ALSA always overrides the requested settings with much larger period/buffer sizes.

Question:

What’s the recommended way to configure Pisound + SamplerBox for reliable low latency (e.g., period_size=64 / buffer_size=128 at 48kHz) without glitches? Should this be forced via .asoundrc or directly in SamplerBox’s audio backend or should i configure something else while using pisound?

I can’t find BLOCKSIZE being documented anywhere on Sampler Box, are you sure it is the right variable to modify?

Yeah…. This is the hansev samplerbox:

https://github.com/hansehv/SamplerBox
In the configuration.txt file there is a BLOCKSIZE parameter that Can be set to Low or High or any avaiable number. What it seems is that pisound automatically choose super high buffer size settings while samplerbox is running and im trying to understand why.
Thanks