uaudio, M-Audio FastTrack Pro device - sound distorted
Marcel Bonnet
marcelbonnet at gmail.com
Mon May 9 06:42:29 UTC 2011
On 27 April 2011 04:11, Hans Petter Selasky <hselasky at c2i.net> wrote:
> On Wednesday 27 April 2011 03:30:58 Marcel Bonnet wrote:
> > On 26 April 2011 03:40, Hans Petter Selasky <hselasky at c2i.net> wrote:
> > > On Monday 25 April 2011 23:04:38 Marcel Bonnet wrote:
>
> > > > or something?
> > >
> > > Then you also need to import the usb/quirk folder and related files and
> > > possibly also usb/usbdevs
> >
> > Should I try import the files and try to make uaudio with that patch
> after
> > the trick with setting "sysctl hw.usb.uaudio.default_rate=44100" ?
> >
>
> You could try to make a new quirk UQ_AU_44100KHZ_ONLY and send a patch for
> that.
>
> --HPS
>
Hello. Sorry for the 12 days delay. And I hope I'm trying to improve the
driver, instead of bother you with this problem (wich was solved with the
sysctl trick, if you remember)
Please look at these patchs. Am I on the right track?
# usbconfig -d ugen0.3 dump_device_desc
ugen0.3: <FastTrack Pro M-Audio> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps)
pwr=ON
bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0110
bDeviceClass = 0x0000
bDeviceSubClass = 0x0000
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0008
idVendor = 0x0763
idProduct = 0x2012
bcdDevice = 0x0100
iManufacturer = 0x0001 <M-Audio>
iProduct = 0x0002 <FastTrack Pro>
iSerialNumber = 0x0000 <no string>
bNumConfigurations = 0x0002
I used that info for:
Index: sys/dev/usb/quirk/usb_quirk.c
===================================================================
--- sys/dev/usb/quirk/usb_quirk.c (revision 221419)
+++ sys/dev/usb/quirk/usb_quirk.c (working copy)
@@ -472,6 +472,9 @@
USB_QUIRK(ROLAND, SD20, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS),
USB_QUIRK(ROLAND, SD80, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS),
USB_QUIRK(ROLAND, UA700, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS),
+
+ /* Devices wich should work on 44100 Hz only */
+ USB_QUIRK(MIDIMAN, FASTTRACKPRO, 0x0000, 0xffff, UQ_AU_44100HZ_ONLY),
};
#undef USB_QUIRK_VP
#undef USB_QUIRK
@@ -483,6 +486,7 @@
[UQ_AU_INP_ASYNC] = "UQ_AU_INP_ASYNC",
[UQ_AU_NO_FRAC] = "UQ_AU_NO_FRAC",
[UQ_AU_NO_XU] = "UQ_AU_NO_XU",
+ [UQ_AU_44100HZ_ONLY] = "UQ_AU_44100HZ_ONLY",
[UQ_BAD_ADC] = "UQ_BAD_ADC",
[UQ_BAD_AUDIO] = "UQ_BAD_AUDIO",
[UQ_BROKEN_BIDIR] = "UQ_BROKEN_BIDIR",
Index: sys/dev/usb/quirk/usb_quirk.h
===================================================================
--- sys/dev/usb/quirk/usb_quirk.h (revision 221419)
+++ sys/dev/usb/quirk/usb_quirk.h (working copy)
@@ -42,6 +42,7 @@
UQ_AU_INP_ASYNC, /* input is async despite claim of adaptive */
UQ_AU_NO_FRAC, /* don't adjust for fractional samples */
UQ_AU_NO_XU, /* audio device has broken extension unit */
+ UQ_AU_44100HZ_ONLY, /* when the device works well with "sysctl
hw.usb.uaudio.default_rate=44100" */
UQ_BAD_ADC, /* bad audio spec version number */
UQ_BAD_AUDIO, /* device claims audio class, but isn't */
UQ_BROKEN_BIDIR, /* printer has broken bidir mode */
Index: sys/dev/usb/usbdevs
===================================================================
--- sys/dev/usb/usbdevs (revision 221419)
+++ sys/dev/usb/usbdevs (working copy)
@@ -2120,6 +2120,10 @@
/* Matrix Orbital products */
product MATRIXORBITAL MOUA 0x0153 Martrix Orbital MOU-Axxxx LCD
displays
+/* M-Audio products : same ID as MIDIMAN. the Manufacturer is M-Audio for
both. */
+//product MAUDIO FASTTRACKPRO 0x2012 FastTrack Pro
+product MIDIMAN FASTTRACKPRO 0x2012 M-Audio FastTrack Pro
+
/* MCT Corp. */
product MCT HUB0100 0x0100 Hub
product MCT DU_H3SP_USB232 0x0200 D-Link DU-H3SP USB BAY Hub
And with uaudio.c I was trying a test to find out if the quirk works, like:
static int
uaudio_attach(device_t dev)
...
//TEST
if (usb_test_quirk(uaa, UQ_AU_44100HZ_ONLY))
device_printf(dev, "44100 HZ ONLY");
else
device_printf(dev, "NOT 44100 HZ ONLY");
...
The result was "NOT 44100 HZ ONLY" when I attached the usb device.
Am I doing right? Or maybe I entered the wrong ids on usbdevs or the wrong
range (0x0000, 0xffff) for usb_quirck.c ?
I imagine that, if this test works, this one should be used at the part of
the code when the driver decide to change or not to change the sample rate.
Then finally send you all tested patches.
Cheers.
--
Marcel Bonnet
More information about the freebsd-multimedia
mailing list