On Tue, Jul 31, 2012 at 10:46:57PM +0300, Alexey Suslikov wrote: > Hello misc. > > http://klang.eudyptula.org/ >
very interesting ideas. > Just curious, why they didn't even try to evaluate OpenBSD sndio. > > An overall approach to the problem is interesting thing too > > Q: Why a audio system in the kernel? > A: Because it's the only reasonable thing to do. IMHO it's not important; both kernel-mode and user-mode approaches can work, neither seems "better". Both have their advantages. kernel-mode is thought to be better with respect to underruns, but that's not 100% true. Trying to explain. Underruns occur whenever an element in the audio processing chain doesn't complete its work before the deadline imposed by the hardware. This chain includes the audio player, which necessarily runs in user mode. Thus we have to get right audio programs (user-mode) first to avoid underruns. If you're able to write audio programs that don't underrun, then you're also able to write an audio daemon that doesn't underrun. No need to put the audio system in the kernel in this case. If you're unable to write audio programs that don't underrun, audio will stutter, and putting the audio system in the kernel won't fix stuttering, so no need to put the audio system in the kernel either. AFAICS, the main advantage of a kernel-mode implementation is to avoid the overhead of extra context switches. In the current sndio implementation the overhead of context switches is negligible compared to audio processing. The choice of moving parts of the OpenBSD audio sub-system out of the kernel is mostly for practical reasons; having less code with kernel privileges seems sane as well; A kind of "if a program doesn't need kernel privileges then put it in user mode" principle. > What people think? Maybe we should write an article for wikipedia > to make sndio more visible to rest of the world? > Sure -- Alexandre