[uaudio] Sound-recording too fast

Mikhail T. mi+thun at aldan.algebra.com
Sun Sep 11 19:01:04 UTC 2011

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 @@

    +                                       if (ep_dir == UE_DIR_IN)
    +                                               chan->sample_rate =
    +                                       else
                                             chan->sample_rate = rate;
                                             chan->p_asid = asid;

I wonder, if a quirk can be added for this 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?

> 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'

I guess, I need to have USB_DEBUG on...

    % usbconfig
    ugen0.1: <UHCI root HUB VIA> at usbus0, cfg=0 md=HOST spd=FULL
    (12Mbps) pwr=SAVE
    ugen1.1: <UHCI root HUB VIA> at usbus1, cfg=0 md=HOST spd=FULL
    (12Mbps) pwr=SAVE
    ugen2.1: <EHCI root HUB VIA> at usbus2, cfg=0 md=HOST spd=HIGH
    (480Mbps) pwr=SAVE
    ugen3.1: <UHCI root HUB VIA> at usbus3, cfg=0 md=HOST spd=FULL
    (12Mbps) pwr=SAVE
    ugen4.1: <UHCI root HUB VIA> at usbus4, cfg=0 md=HOST spd=FULL
    (12Mbps) pwr=SAVE
    ugen5.1: <EHCI root HUB VIA> at usbus5, cfg=0 md=HOST spd=HIGH
    (480Mbps) pwr=SAVE
    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



More information about the freebsd-multimedia mailing list