On Mon, 23 Feb 2009 18:10:53 +0100 Alexandre Ratchov <a...@caoua.org> wrote:
> > Unfortunately, the above doesn't work in 4.5-current, and the debug > > output has been changed somewhat. One of the things I did notice is > > the resampling from 16000Hz to 44100Hz does not seem to be > > occurring in 4.5-current. > > > > that's the desired behaviour; the resulting file will be at 16kHz, > which is the device native sample rate. > > > $ aucat -C 0:0 -e s16le -r 16000 -f /dev/audio1 -o test45.raw > ... > > dev_init: hw recording s16le,0:0,16000Hz > ^^^^^^^^^^^^^^^^^ > the device is using s16le,0:0,16000Hz, and there are no conversion > layers so the file should contain the signal as-is. > > > > > $ aucat -c 0:0 -e s16le -i > > test45.raw > > the ``-r 16000'' option is missing, so aucat will thing > that ``test45.raw'' is using the default rate of 44100Hz, > and it will play it too fast. > > > > > You may also want to note that by defining the rate (-r) as 16000Hz > > in the playback still results in it playing too fast and with > > distortion, albeit slower than playing it as above at 44100Hz. > > that's bad. Perhaps a bug in the uaudio(4) driver. Could you send > me off-list the recorded file (preferably with some voice or music) > and the exact command to generate it so i can analyze it? Since Jake and others might be interested, I put the files on my server, and kept this on-list. On 4.4-Stable $ export AUCAT_DEBUG=4 $ aucat -C 0:0 -e s16le -r 16000 -f /dev/audio1 -o test2-44.raw $ aucat -c 0:0 -e s16le -r 16000 -i test2-44.raw On 4.5-Current $ export AUCAT_DEBUG=4 $ aucat -C 0:0 -e s16le -r 16000 -f /dev/audio1 -o test2-45.raw $ aucat -c 0:0 -e s16le -r 16000 -i test2-45.raw Full Debug Command Logs and Resulting File: http://www.designtools.org/OpenBSD/test2-44.txt http://www.designtools.org/OpenBSD/test2-44.raw http://www.designtools.org/OpenBSD/test2-44.txt http://www.designtools.org/OpenBSD/test2-44.raw Also, output of dmesg, audioctl{0,1}, mixerctl{0,1} if needed: http://www.designtools.org/OpenBSD/test1-info44.txt http://www.designtools.org/OpenBSD/test1-info45.txt Results 4.4-Stable: On 4.4-Stable, you can see aucat resampling from 16000Hz to 44100Hz in the debug log when recording. As you'd expect, attempting to play the 44100Hz file at a forced playback rate of 16000Hz means it plays *very* slow. If you leave off the rate switch ('-r 16000') on playback, it defaults to playing at 44100Hz and plays correctly. Q: I'm guessing aucat was *not* supposed to resample the raw file? Results 4.5-Current: On 4.5-Current, the playback is way too fast, and also there is some distortion. Considering the similar test results I did for Jake (posted in thread) where aucat was avoided completely, I think he's onto something thinking it's a driver issue. -- J.C. Roberts