I submitted my #kqueue support for sound(4) on #FreeBSD. I hope we will polish it soon enough. reviews.freebsd.org/D53029
cc @JdeBP
I submitted my #kqueue support for sound(4) on #FreeBSD. I hope we will polish it soon enough. reviews.freebsd.org/D53029
cc @JdeBP
feld
in reply to meka • • •David Chisnall (*Now with 50% more sarcasm!*)
in reply to feld • • •@feld
Back when OSS was designed, keeping an output buffer filled to avoid stuttering or reading from a microscope input source before the ring buffer looped and you lost samples was hard. You basically wanted to read or write whenever you had cycles because otherwise you couldn’t keep up.
Since then, computers have become a lot faster and now sound is a very low data rate device. Rather than hammering the sound device as often as you can, you want to be told the microphone buffer has passed some watermark level (so you can process a reasonable number of samples at once) or the sound output buffer is below a watermark level (so you can give it a few ms more samples to write for interactive things, or a few seconds for things like music playback).
Things like music are great for this because you can decode a few tens of second and then sleep in a kevent loop just passing a new chunk to the device whenever it has a decent amount of space.
feld
in reply to David Chisnall (*Now with 50% more sarcasm!*) • • •