On Mon, 23 Feb 2009 12:52:18 +0000 Jacob Meuser
<[email protected]> wrote:

> On Mon, Feb 23, 2009 at 03:10:07AM -0800, J.C. Roberts wrote:
> > My build of -current is a few days old. I'm having problems
> > recording with aucat on a particular device.
> > 
> > The system has an integrated "Intel 82891DB AC97" audio chipset and
> > has three physical jacks: one output (headphone/hp) and two inputs
> > (mic/line-in). All the OpenBSD audio toys work perfectly with the
> > integrated device.
> > 
> > The system also has a "Logitech QuickCam Pro 9000" USB web cam and
> > in addition to the camera, it also contains a fairly limited audio
> > device, basically a cheap, mono microphone with a fixed frequency
> > (16,000Hz). The dmesg and output of `audioctl -f /dev/audio1` are
> > at the end.
> > 
> >     uvideo(4)       /dev/video0
> >     uaudio(4)       /dev/audio1
> > 
> > With OpenBSD 4.4-Stable, I can record with the cheap microphone
> > using either ffmpeg or aucat but aucat on 4.4-stable requires user
> > ('-u') settings for the device to record properly.
> > 
> > recording
> > $ ffmpeg -f oss -ar 16000 -i /dev/audio1 out-ffmpeg-4.4.wav
> > $ aucat -u -c 0:0 -r 16000 -f /dev/audio1 -o out-aucat-4.4.wav 
> > $ aucat -u -e u8 -c 0:0 -r 16000 -f /dev/audio1 -o test44.raw
> > playing 
> > $ mplayer out-ffmpeg-4.4.wav
> > $ mplayer out-aucat-4.4.wav
> > $ aucat -u -e u8 -c 0:0 -r 16000 -i test44.raw
> > 
> > Doing the same tests above on OpenBSD 4.5-current shows both ffmpeg
> > and aucat no longer work for recording audio through the webcam
> > mic. I'm sure there is a rate/frequency problem (i.e. playing too
> > fast), but also there seems to be a lot of distortion.
> 
> does anything record correctly from it?  the mic on my uvideo is
> pretty much useless.  actually, I have several uaudio devices which
> do not work correctly.  something to work on for 4.6.
> 

It fails to record properly with 4.5-Current. 
But it does record properly with 4.4-Stable.

> > Q: Could the ffmpeg record/playback issue be due to the use of
> > 'oss' as the format?
> 
> that is quite possible.  ffmpeg doesn't actually check the parameters
> it receives from the OSS ioctls.
> 
> >   And if so, is there a "better" choice for recording
> > formats with ffmpeg given the improvements in OpenBSD audio?
> 
> not yet
> 

:-)

> > Yes, I know the easy answer is to just use the perfectly working
> > microphone in the integrated sound card on the main board (audio0),
> > but getting this funky, cheap microphone on the webcam working
> > properly with the new aucat seems useful... mainly because it
> > worked fine with 4.4-stable, and the quirks of the device makes for
> > a good test of aucat.
> > 
> > Without the "-u" switch on aucat(1), it will try to auto configure
> > itself, but on the cheap webcam microphone, aucat is ignoring the
> > number of channels (1) and ignoring the fixed rate (16,000Hz). 
> 
> what makes you say that?
> 

As for my assumption of auto-configuration, I picked it up from:
$ man 4 aucat
-u      Normally aucat tries to automatically determine the optimal
        parameters for the audio device; if this option is specified,
        it will instead use the parameters specified by the -Ccer
        options.

I had the above all typed up, and then realized that's not what you
were asking. (sigh) :-)

As for my assumption of ignoring the fixed rate and channels, it stems
from my observations listening to the resulting files. On 4.4-Stable, I
can tell aucat how I want it done, and it does a good job. But on
4.5-Current, life is not quite as happy, and aucat seems to summarily
ignore what I tell it to do.

>From your posts (and others) to the lists, it seems a ton of work has
gone into the automatic resampling features of aucat. My guess is there
is a glitch in the resampling, such that the resampling is happening
even when it's specifically told not to mess with the provided settings.

The fact that this is also occurring on 4.5-current with ffmpeg using
the 'oss' format, seems to further indicate a resampling glitch.

> > 
> > I'm not sure what else I can test or try. If there is any further
> > information that might be useful, just let me know.
> 
> do this:
> 
> $ audioctl -f /dev/sound1 record.
> {rate=16000,channels=1,encoding=slinear_le,recision=16} 
> $ cat > file < /dev/sound1 
> <speak into the mic>
> ^C
> $ aucat -h raw -c 0:0 -r 16000 -e s16le -i file
> 
> does it sound right?
> 

Nope. Garbled and way too fast.

When running the audioctl command you posted, I get an error:
        audioctl: record.rate: permission denied

Checking with `audioctl -f /dev/sound1` states record.rate is already
set to 16000, so not being able to set it to this value doesn't seem
like a big deal.

-- 
J.C. Roberts

Reply via email to