Subject: mixer advice?
To: NetBSD Users <netbsd-users@netbsd.org>
From: Jukka Marin <jmarin@pyy.jmp.fi>
List: netbsd-users
Date: 04/06/2002 14:54:40
Hello,
I'm working on a simple audio recorder program. Which is the easiest way
of controlling the recording level and selecting the input used for
recording? It seems I can do this and more using ioctl() with /dev/mixer,
but it also seems that the interface is somewhat complicated.
Do I really have to build all those data structures in RAM like mixerctl.c
does? All that I want to do is
mixerctl -w record.source=aux; mixerctl -w inputs.aux=240,240
(Yeah, I know I could run mixerctl from withing my prg, but I don't like
doing things that way..)
Any easier ways?
Now that I'm wasting the bandwidth.. what is the easiest way of buffering
the recorded data so that no data gets lost when disk writes are delayed
or the CPU gets busy? I was trying to increase the buffer used by
/dev/audio, but that doesn't seem to be possible. I would like to pipe
the data to lame to encode it in real-time (this works), but I'm afraid
that my process will be blocked if lame is temporarily slowed down. Do
I have to fork another process and allocate shared memory for a largish
data buffer?
Thanks,
-jm