From owner-freebsd-multimedia@FreeBSD.ORG Mon May 9 06:42:29 2011 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6741106566B for ; Mon, 9 May 2011 06:42:29 +0000 (UTC) (envelope-from marcelbonnet@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 89B5D8FC1D for ; Mon, 9 May 2011 06:42:29 +0000 (UTC) Received: by pwj8 with SMTP id 8so2937712pwj.13 for ; Sun, 08 May 2011 23:42:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=isbqqa1PUK+OAvs7X3ZqP4nAYwNzDVDdOJiF1FZaqCI=; b=uV3OE0TKN67V4AItRqzH2cpiLqW2utfOXOAi4uPCV+WN9uyI9LD9VLWQCt4fc0bRlG +op9ioh9Ie/pjekFs5T5nVW3/gU9hbHJKrVPaORHc+D58ePlSV9SRl1LzXMiJBr08VCV OHRt3uRf/XUoZJSlLeC9ZkOc+FFk46jVTcIzs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=eUAlyXeraXwjrAL4ZN9kUi1J0AOWV9wN79pkxKqFsvwOd/KFyeX/JQSBBbduW8CcW7 W9lWOb9HYPb+nQNuGj3/bcz/eXnmRlL6Agd0Fvlfv1e4At6ONRZrGlziyS6DSLDsTxZn e8QBypPYS3QFxUIQ+XDmvs5eM6FxW8IB5u1O4= MIME-Version: 1.0 Received: by 10.68.15.101 with SMTP id w5mr9171543pbc.134.1304923349166; Sun, 08 May 2011 23:42:29 -0700 (PDT) Received: by 10.68.58.231 with HTTP; Sun, 8 May 2011 23:42:29 -0700 (PDT) In-Reply-To: <201104270911.39988.hselasky@c2i.net> References: <201104260840.20985.hselasky@c2i.net> <201104270911.39988.hselasky@c2i.net> Date: Mon, 9 May 2011 03:42:29 -0300 Message-ID: From: Marcel Bonnet To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-multimedia@freebsd.org Subject: Re: uaudio, M-Audio FastTrack Pro device - sound distorted X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 06:42:29 -0000 On 27 April 2011 04:11, Hans Petter Selasky wrote: > On Wednesday 27 April 2011 03:30:58 Marcel Bonnet wrote: > > On 26 April 2011 03:40, Hans Petter Selasky 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: 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 iProduct = 0x0002 iSerialNumber = 0x0000 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