From patchwork Tue Apr 21 02:23:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takamichi Horikawa X-Patchwork-Id: 6245701 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 8C71A9F1C4 for ; Tue, 21 Apr 2015 06:04:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B119C20460 for ; Tue, 21 Apr 2015 06:04:37 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7548120459 for ; Tue, 21 Apr 2015 06:04:36 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id ABF5226602C; Tue, 21 Apr 2015 08:04:35 +0200 (CEST) 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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 A452C2606A8; Tue, 21 Apr 2015 08:03:09 +0200 (CEST) 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 E579F2606BA; Tue, 21 Apr 2015 04:24:46 +0200 (CEST) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by alsa0.perex.cz (Postfix) with ESMTP id 874B5260696 for ; Tue, 21 Apr 2015 04:24:39 +0200 (CEST) Received: by pdbnk13 with SMTP id nk13so226576853pdb.0 for ; Mon, 20 Apr 2015 19:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=QvBYGUOn+ZWHNMWhfgef0ai2H4k/wtd6SpubDEaIKX4=; b=vELweGs9WA86Ms39AsczQCLJmgCPEpFYzcnejah8ykKvxoWTadTQGrRi57s5pLjscj X13Wm+cZRlCBOcvnCtwwE8RI11yyCL/6wXvx5B7HWgtatXgbINFnuEyDvoi7sRDuod6z ikCNSKKMKKuIqqfEKd4g0Q0Z5+UlzxuXEilCyXH0NgVcK2lD1DvWaEKr0fw2InL6Md3Z JEf80Ux5rzDQAGOQnj2RMUkjU5hQtPZrdn/N1ucZNFxqSDT/jh88Tkgk4L3OrB/axM37 ActWeRiLBr/yR6dNmiXLqiCvr7O8Pov9N6044B5fuLZnZxaHv9CUzvs2Z1eadTWp5BpN mPaQ== X-Received: by 10.68.170.133 with SMTP id am5mr33040350pbc.42.1429583078131; Mon, 20 Apr 2015 19:24:38 -0700 (PDT) Received: from think-x240-arch.localdomain (FLH1Aik072.tky.mesh.ad.jp. [125.193.46.72]) by mx.google.com with ESMTPSA id qt4sm272343pbc.86.2015.04.20.19.24.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Apr 2015 19:24:37 -0700 (PDT) From: Takamichi Horikawa To: Jaroslav Kysela , Takashi Iwai Date: Tue, 21 Apr 2015 11:23:57 +0900 Message-Id: <1429583037-1147-1-git-send-email-takamichiho@gmail.com> X-Mailer: git-send-email 2.3.5 X-Mailman-Approved-At: Tue, 21 Apr 2015 08:03:06 +0200 Cc: alsa-devel@alsa-project.org, Takamichi Horikawa Subject: [alsa-devel] [PATCH 1/1] usb-audio: Fix audio output on Roland SC-D70 sound module 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 Roland SC-D70 reports its device class as vendor specific class and the quirk QUIRK_AUDIO_FIXED_ENDPOINT was used for audio output. In the quirks table the sampling rate was hard-coded to 44100 Hz and therefore not worked when the sound module was in 48000 Hz mode. In this change the quirk is changed to QUIRK_AUDIO_STANDARD_INTERFACE but as the sound module reports incorrect bSubframeSize in its descriptors, additional change is made in format.c to detect it and to override it (which uses the existing code for Edirol SD-90). Tested both when the sound module was in 44100 Hz mode and 48000 Hz mode and both audio input and output. MIDI related part of the driver is not touched. Signed-off-by: Takamichi Horikawa --- sound/usb/format.c | 5 ++++- sound/usb/quirks-table.h | 30 ++---------------------------- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/sound/usb/format.c b/sound/usb/format.c index 8bcc87c..789d19e 100644 --- a/sound/usb/format.c +++ b/sound/usb/format.c @@ -79,7 +79,10 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, format = 1 << UAC_FORMAT_TYPE_I_PCM; } if (format & (1 << UAC_FORMAT_TYPE_I_PCM)) { - if (chip->usb_id == USB_ID(0x0582, 0x0016) /* Edirol SD-90 */ && + if (((chip->usb_id == USB_ID(0x0582, 0x0016)) || + /* Edirol SD-90 */ + (chip->usb_id == USB_ID(0x0582, 0x000c))) && + /* Roland SC-D70 */ sample_width == 24 && sample_bytes == 2) sample_bytes = 3; else if (sample_width > sample_bytes * 8) { diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index 07f984d..2f6d3e9 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -816,37 +816,11 @@ YAMAHA_DEVICE(0x7010, "UB99"), .data = (const struct snd_usb_audio_quirk[]) { { .ifnum = 0, - .type = QUIRK_AUDIO_FIXED_ENDPOINT, - .data = & (const struct audioformat) { - .formats = SNDRV_PCM_FMTBIT_S24_3LE, - .channels = 2, - .iface = 0, - .altsetting = 1, - .altset_idx = 1, - .attributes = 0, - .endpoint = 0x01, - .ep_attr = 0x01, - .rates = SNDRV_PCM_RATE_CONTINUOUS, - .rate_min = 44100, - .rate_max = 44100, - } + .type = QUIRK_AUDIO_STANDARD_INTERFACE }, { .ifnum = 1, - .type = QUIRK_AUDIO_FIXED_ENDPOINT, - .data = & (const struct audioformat) { - .formats = SNDRV_PCM_FMTBIT_S24_3LE, - .channels = 2, - .iface = 1, - .altsetting = 1, - .altset_idx = 1, - .attributes = 0, - .endpoint = 0x81, - .ep_attr = 0x01, - .rates = SNDRV_PCM_RATE_CONTINUOUS, - .rate_min = 44100, - .rate_max = 44100, - } + .type = QUIRK_AUDIO_STANDARD_INTERFACE }, { .ifnum = 2,