From patchwork Thu Nov 26 20:28:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shal@free.fr X-Patchwork-Id: 7708861 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 952799F2E9 for ; Thu, 26 Nov 2015 20:29:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B3B0A20657 for ; Thu, 26 Nov 2015 20:29:18 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 450BA2061A for ; Thu, 26 Nov 2015 20:29:17 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 698B726073D; Thu, 26 Nov 2015 21:29:15 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B244B2605DC; Thu, 26 Nov 2015 21:29:07 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 543732605EE; Thu, 26 Nov 2015 21:29:06 +0100 (CET) Received: from smtp3-g21.free.fr (smtp3-g21.free.fr [212.27.42.3]) by alsa0.perex.cz (Postfix) with ESMTP id 1E37626058A for ; Thu, 26 Nov 2015 21:28:59 +0100 (CET) Received: from spooler2-g27.priv.proxad.net (unknown [172.20.243.240]) by smtp3-g21.free.fr (Postfix) with ESMTP id 7560AA620B for ; Thu, 26 Nov 2015 21:28:30 +0100 (CET) Date: Thu, 26 Nov 2015 21:28:57 +0100 (CET) From: shal@free.fr To: alsa-devel@alsa-project.org Message-ID: <1805025243.580922365.1448569737961.JavaMail.root@spooler2-g27.priv.proxad.net> In-Reply-To: <2021858721.580826702.1448568518907.JavaMail.root@spooler2-g27.priv.proxad.net> MIME-Version: 1.0 X-Originating-IP: [82.240.209.128] X-Mailer: Zimbra 7.2.0-GA2598 (ZimbraWebClient - GC45 (Linux)/7.2.0-GA2598) X-Authenticated-User: shal@free.fr Subject: [alsa-devel] Sound UsbPre : minimal patch for support X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Hello, I have a Sound UsbPre (the first not the UsbPRe2) sound card. There is no support for this card in alsa. I do a usb packet sniffing on Windows for detect problem. Some control quirk should be added at boot in order to use the card. It works to play and record in 44100 khz. It works only with 44100khz (for example, if you play a 88200 file, it will be played too slow). This patch is not well tested, work on my desktop : Linux Ubuntu with 4.2.19-lowlatency kernel. The button emulation is not done (by a control packet, you can change the card configuration, like phantom power activation). If somebody is interested, I can provide needed information. If Alsa's developer is interested, I can provide support for test patches or develop a second version of this patch in order to integrate the support for this card in the linux kernel Regards, Olivier linux-source-4.2.0/sound/usb$ diff -rub quirks.c.ORIG quirks.c --- quirks.c.ORIG 2015-11-24 22:43:16.878635155 +0100 +++ quirks.c 2015-11-26 20:56:09.492126460 +0100 @@ -601,6 +601,40 @@ return 0; } +/* Add some control messages needed by Sound Devices UsbPre. + * Values here are chosen based on sniffing USB traffic + * under Windows.*/ +static int snd_usb_usbpre_boot_quirk(struct usb_device *dev) +{ + u8 buf = 1; + u8 data1[1] = {0x81}; + u8 data2[1] = {0xc1}; + u8 data3[3] = {0x44,0xac,0x00}; + + snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), 1, + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, + 0x00f0, 496, data1, 1); + snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), 0x81 , + USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, + 0x00f0, 0, &buf, 1); + if (buf == 0) { + return -ENODEV; + } + snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), 1, + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, + 0x00f0, 496, data2, 1); + snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), 0x81 , + USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, + 0x00f0, 0, &buf, 1); + if (buf == 0) { + return -ENODEV; + } + snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), 1, + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT, + 0x0100, 133, data3, 3); + return 0; +} + static int snd_usb_fasttrackpro_boot_quirk(struct usb_device *dev) { int err; @@ -985,6 +1019,10 @@ /* SB Audigy 2 NX needs its own boot-up magic, too */ return snd_usb_audigy2nx_boot_quirk(dev); + case USB_ID(0x0926, 0x0100): + /* Sound Devices UsbPre needs its own boot-up magic, too */ + return snd_usb_usbpre_boot_quirk(dev); + case USB_ID(0x10f5, 0x0200): /* C-Media CM106 / Turtle Beach Audio Advantage Roadie */ return snd_usb_cm106_boot_quirk(dev);