Realtime or Low Latency Custom Kernel for Audio related work?

Hi guys,
I'm pretty new to FreeBSD, but I was just wondering if it's possible to set up some kind of realtime or low latency custom kernel for Freebsd? or if such custom kernel exist?

I originally came from archlinux and typically use its linux-rt kernel, which typically grants a latency of about 6-10 ms as opposed to the regular linux kernel which sits at about 15-20 ms.

Any advice would be greatly appreciate; thanks in advance.
 
The default kernel I believe is realtime. Some latency is introduced by sound servers. I do not recall seeing any mention that FreeBSD includes a sound server by default.

Depending on your needs, you may also want to look at NetBSD 8.0 which introduced an in-kernel mixer
NetBSD audio_system(9)

An install of OpenBSD has sndio enabled by default but it can be disabled.
 
NO general purpose kernel is hard real-time, including Linux with rt patches which still is soft real-time, you would need to modify almost the entire kernel to make it fully work in preemptive mode. The closer you will get of general purpose hard RTOS probably is RTLinux, but it is not an actual general purpose OS as you can read in their literature.

That said, recording of some talks with people who has deep knowledge of the FreeBSD kernel code it has enough preemption to be considered a soft RTOS (but don't take my memory as the most reliable thing).

I originally came from archlinux and typically use its linux-rt kernel, which typically grants a latency of about 6-10 ms as opposed to the regular linux kernel which sits at about 15-20 ms.

Assuming you are concerned with audio, IIRC sound(4) has some built in latency tweaks.

This probably should be what you are looking for:

hw.snd.latency

Configure the buffering latency. Only affects applications that
do not explicitly request blocksize / fragments. This tunable
provides finer granularity than the hw.snd.latency_profile
tunable. Possible values range between 0 (lowest latency) and 10
(highest latency).

hw.snd.latency_profile

Define sets of buffering latency conversion tables for the
hw.snd.latency tunable. A value of 0 will use a low and
aggressive latency profile which can result in possible underruns
if the application cannot keep up with a rapid irq rate,
especially during high workload. The default value is 1, which
is considered a moderate/safe latency profile.
 
Back
Top