# Kernel hertz rate and system clock



## sossego (Nov 20, 2013)

http://freebsd.mercurysquad.com/

```
kern.clockrate: { hz = 2000, tick = 500, profhz = 8126, stathz = 127 }
```

A value of 2500 or greater causes a skew of +1 and greater. 
http://lists.freebsd.org/pipermail/freebsd-current/2011-February/023004.html
http://lists.freebsd.org/pipermail/freebsd-ipfw/2010-June/004261.html
https://groups.google.com/forum/#!topic/mailing.freebsd.ipfw/oVbFsI3JqfM
http://unix.derkeiler.com/Mailing-Lists/FreeBSD/net/2008-07/msg00094.html
http://unix.derkeiler.com/Mailing-Lists/FreeBSD/questions/2011-11/msg00616.html
http://unix.derkeiler.com/Mailing-Lists/FreeBSD/stable/2010-09/msg00632.html


----------



## xibo (Nov 24, 2013)

Is there any gain in increasing kern.hz over 1000 to begin with?


----------



## sossego (Nov 24, 2013)

Latency decrease in audio effects and production. Of course, this may prove different when I can purchase a sound card with dedicated chips and memory.


----------



## oops (Dec 6, 2013)

Audio device polling is disabled by default. You'd have better response time just by tuning hw.snd.latency and hw.snd.latency_profile using sysctl(8) or teaching the application to use SNDCTL_DSP_POLICY or SNDCTL_DSP_SETFRAGMENT on a modern (mostly tickless) FreeBSD kernel.


----------



## sossego (Dec 6, 2013)

To what value when it is set to 5?


----------



## oops (Dec 6, 2013)

The lowest possible and then increase by one until you stop hearing noise from buffer underrun. Alternatively, fix applications to cope better with small fragment size.

For example, with multimedia/mpv to reduce silence after resume from pause I use
	
	



```
# 4x interrupt rate (systat -v 1)
hw.snd.latency=4
hw.snd.latency_profile=0
```


----------

