Topic: Linux clocksources/timers
I'm a bit confused at the moment, because I observed an audio effect, which i don't fully understand.
Normally I'm using Pianoteq with audio output JACK, which itself redirects to ALSA's driver snd-usb-audio and an USB connected Focusrite 2i2 gen2.
I'm using JACK because it supports 2 periods (instead of 3 periods at direct ALSA) of 64 samples buffers in it's synchronous mode (option jackd -S). Slightly better latency.
So far so good.
Recently I saw that JACK has an option -c to select an available clocksource. Default is the System timer and the other is the HPET timer (High Precision Event Timer). HPET is a hardware timer available on most Intel boards.
When I select HPET (-ch) the audio quality is better than with the standard system timer on my Laptop. More defined, clearer, less tendency of dullness.
I didn't expect that, because I thought the hardware clocks like RTC or the newer HPET are obsolete with contemporary "tickless" kernels.
My vague guess is, that HPET has a better resolution and higher precision than my standard system timer, so that all audio transfers between PTQ, JACK, ALSA, USB-Audio have less latency and jitter. - But I'm not sure if those assumptions have a theoretical background or I just became a victim of the placebo-effect.
Maybe the Debian Realtime-Kernel is not so tickless (dynamically clocking) than I thought. For example ALSA tries to use static timers at 250 Hz (<=> 4000 µs):
# cat /proc/asound/timers
G0: system timer : 4000.000us (10000000 ticks)
[...]
While the HPET is adjusted at 1024 Hz at the moment:
# cat /proc/sys/dev/hpet/max-user-freq
1024
Eventually recompiling my kernel with CONFIG_HZ_1000=y (instead of default CONFIG_HZ_250=y) would have the same effect as using the HPET clock. Dont' know. But it would be uncomfortable to recompile the kernel each time a new is released. At the moment I just use the updated Realtime-kernels of my Linux-distribution.
Maybe someone (PTQ-crew itself?) is able to shed some light how tickless kernels and (pseudo?)static clocksources like 250 Hz or 1000 Hz go together.
Thank you
System info: Debian 9 ("Stretch"), kernel 4.9.0-11-rt-amd64, Pianoteq 6.6.0 Standard