[uaudio] Sound-recording too fast
Hans Petter Selasky
hselasky at c2i.net
Sun Sep 11 19:54:29 UTC 2011
On Sunday 11 September 2011 20:32:36 Mikhail T. wrote:
> On 11.09.2011 04:08, Hans Petter Selasky wrote:
> > Doesn't aiff files use a fixed sample rate? Try:
> >
> > env AUDIODEV=/dev/dsp1 rec -r 16k /tmp/test.aiff
> >
> > Or:
> >
> > env AUDIODEV=/dev/dsp1 rec -r 8k /tmp/test.aiff
>
> Well, I first noticed the problem using Skype, so I doubt, it is rec- or
> aiff-specific. For me the quick and dirty hack below saved the day --
> the recording is nice and clear now and I have no other USB audio
> devices for this computer anyway:
>
> --- sys/dev/sound/usb/uaudio.c 2011-07-24 19:12:34.000000000 -0400
> +++ sys/dev/sound/usb/uaudio.c 2011-09-10 23:41:09.000000000 -0400
> @@ -1026,4 +1026,7 @@
> bit_resolution,
> p_fmt->description);
>
> + if (ep_dir == UE_DIR_IN)
> + chan->sample_rate =
> rate/3;
> + else
> chan->sample_rate = rate;
> chan->p_asid = asid;
Hi,
>
> I wonder, if a quirk can be added for this device...
That's not impossible, though I need some more background on your device.
> > I'm really surprised if your Logitech announces that it supports 48K and
> > simply outputs 16K. It would be the latest great example of USB
> > specification violation!
>
> Maybe, the rate can altered on the fly by the driver, with 48K being the
> highest available, but 16K being the default?
There are some sysctls which makes this possible. Can you dump the
configuration descriptor of your device using usbdump?
>
> > A dump of the descriptors using usbconfig and "sysctl
> > hw.usb.uaudio.debug=15" would also be appreciated.
>
> % sysctl sysctl hw.usb.uaudio.debug
> sysctl: unknown oid 'hw.usb.uaudio.debug'
>
> ugen2.2: <product 0x081b vendor 0x046d> at usbus2, cfg=0 md=HOST
> spd=HIGH (480Mbps) pwr=ON
> ugen0.2: <Microsoft Wireless Optical Mouse 1.00 Microsoft> at
> usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON
Is your device marked spd=HIGH ?
--HPS
More information about the freebsd-multimedia
mailing list