From patchwork Sat Nov 29 19:35:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Panu Matilainen X-Patchwork-Id: 5407011 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E22BB9F301 for ; Sat, 29 Nov 2014 19:35:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 065DB201FA for ; Sat, 29 Nov 2014 19:35:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 70E4C2016C for ; Sat, 29 Nov 2014 19:35:37 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C3D7E26042C; Sat, 29 Nov 2014 20:35:34 +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=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id DBCBA260414; Sat, 29 Nov 2014 20:35:29 +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 21210260415; Sat, 29 Nov 2014 20:35:28 +0100 (CET) Received: from homiemail-a82.g.dreamhost.com (sub5.mail.dreamhost.com [208.113.200.129]) by alsa0.perex.cz (Postfix) with ESMTP id 6A136260410 for ; Sat, 29 Nov 2014 20:35:21 +0100 (CET) Received: from homiemail-a82.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a82.g.dreamhost.com (Postfix) with ESMTP id 7618D282061; Sat, 29 Nov 2014 11:35:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=laiskiainen.org; h=from:to :cc:subject:date:message-id; s=laiskiainen.org; bh=bZb8uv0Nz2x7c FP6vjz9SbcpPMQ=; b=nY2U9O0cH8MamSy2q+1bE8DRokV1QkZqUrz8B0DjZH/2J EyBNLEWbowVi5TnYT+5rYRiT/YBYfmVIjJgR3s6BJX+80JT3HpP4SJ1Xegg+CjIb ozRxSsf2ztaLFjdGoR1DsypIxRZoXrFUpp+7rjge+j3TTyvj0pFJ+zpoCJ7gEo= Received: from mursu.koti.laiskiainen.org (adsl-86.60.130.33.DynIP.ssp.fi [86.60.130.33]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: pmatilai@laiskiainen.org) by homiemail-a82.g.dreamhost.com (Postfix) with ESMTPSA id A612928205F; Sat, 29 Nov 2014 11:35:18 -0800 (PST) From: Panu Matilainen To: alsa-devel@alsa-project.org Date: Sat, 29 Nov 2014 21:35:04 +0200 Message-Id: <1417289704-23774-1-git-send-email-pmatilai@laiskiainen.org> X-Mailer: git-send-email 1.9.3 Cc: Panu Matilainen Subject: [alsa-devel] [PATCH] ALSA: usb: Add support for Zoom R16/24 capture and midi interfaces 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This makes the midi interface and capture work out of the box with R16 (and presumably R24 too but untested). Playback stream would also seem to function fine except for one caveat: no sound is produced, so it is disabled for now. Signed-off-by: Panu Matilainen --- sound/usb/quirks-table.h | 34 ++++++++++++++++++++++++++++++++++ sound/usb/quirks.c | 8 ++++++++ 2 files changed, 42 insertions(+) diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index c657752..73621c9 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -3202,6 +3202,40 @@ YAMAHA_DEVICE(0x7010, "UB99"), }, { + /* ZOOM R16/24 in audio interface mode */ + USB_DEVICE(0x1686, 0x00dd), + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { + .ifnum = QUIRK_ANY_INTERFACE, + .type = QUIRK_COMPOSITE, + .data = (const struct snd_usb_audio_quirk[]) { + { + /* Control */ + .ifnum = 0, + .type = QUIRK_IGNORE_INTERFACE, + }, + { + /* Playback, sound is missing atm */ + .ifnum = 1, + .type = QUIRK_IGNORE_INTERFACE, + }, + { + /* Capture */ + .ifnum = 2, + .type = QUIRK_AUDIO_STANDARD_INTERFACE, + }, + { + /* Midi */ + .ifnum = 3, + .type = QUIRK_MIDI_STANDARD_INTERFACE + }, + { + .ifnum = -1 + }, + } + } +}, + +{ /* * Some USB MIDI devices don't have an audio control interface, * so we have to grab MIDI streaming interfaces here. diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index a5941f8..2e49193 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1160,6 +1160,14 @@ void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe, break; } } + + /* Zoom R16/24 needs a tiny delay here, otherwise requests like + * get/set frequency return as failed despite actually succeeding. + */ + if ((le16_to_cpu(dev->descriptor.idVendor) == 0x1686) && + (le16_to_cpu(dev->descriptor.idProduct) == 0x00dd) && + (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) + mdelay(1); } /*