Subject: Audio (Re: Audio recording through the microphone)
To: Alan Post <apost@recalcitrant.org>
From: Magnus Eriksson <magetoo@fastmail.fm>
List: netbsd-users
Date: 10/09/2004 03:15:27
On Fri, 8 Oct 2004, Alan Post wrote:

> If you can get low-latency audio working on NetBSD without using mmap,
> I'd love to hear how.  Many of the audio drivers (for instance,
> uaudio(4)) do not implement mmap.  And recording via mmap is not
> supported at all, unless you patch audio.c, as in PR 6827:
>
>   http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=6827
>
> My general feeling is that not many people use NetBSD for low-latency
> audio.

  My general feeling is that the API is not designed for it either.
"Batch" audio is fine and very simple (like cat bong.au > /dev/audio) as
well as "pseudo realtime" (xmms/mikmod; ie render one block, write to
/dev/audio, render another block, block on writing to /dev/audio, repeat);
but I haven't seen a good way to accomplish realtimeish performance (after
I hit the key A, a tone will start playing in some predictable small
period of time), something I'd like to have for music.  Well, with the
exception of using mmap()..  I blame the "original" Open Sound System for
this model.

  On the other hand, in the case of uaudio, USB audio in itself seems like
a bad fit for anything but this.  (I believe USB is built on some sort of
pipe-ish model?)


  Sorry about the brain dump / whining.  I tried getting started with DSP
and music programming a year ago or so, but gave up.  I felt like I was
working against the API most of the time..  Maybe it's time to give it
another try.


Magnus