From patchwork Tue Nov 11 00:20:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Zammit X-Patchwork-Id: 5270041 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 EE9A29F2F1 for ; Tue, 11 Nov 2014 00:21:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2135E20155 for ; Tue, 11 Nov 2014 00:21:51 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id C0EC820108 for ; Tue, 11 Nov 2014 00:21:49 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id CFFFF261B21; Tue, 11 Nov 2014 01:21:48 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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 07391261A32; Tue, 11 Nov 2014 01:20:51 +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 E6421261A53; Tue, 11 Nov 2014 01:20:49 +0100 (CET) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by alsa0.perex.cz (Postfix) with ESMTP id 2F7D92616F6 for ; Tue, 11 Nov 2014 01:20:43 +0100 (CET) Received: by mail-pa0-f43.google.com with SMTP id eu11so9358925pac.16 for ; Mon, 10 Nov 2014 16:20:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EmPMHkjr8qxa+MEhpqrYhGNkEIU9cEsmsjBaLXf74DQ=; b=YVBNmEwqbnhwLK7Pni5q1O03ZfRl6G3YrH+UAzMQAgInQy1qbgnVRSYTCDZ/rE67ug 5y8StX/Az8I85giT7ler/S3VOSAHTzE3Jril9ut+9/GHAygBJ4zxx8CC+NEoOwTaDZ5m SddgvlG3lIyQlyhMThkZaSWnj2gk/qasPirRR+8k738NgxaigqGia4MinxXlaTPa0FxU 3xsvKOhMpGDYWVYYpwU14rV4540oqwR5jEjZXGz7hfKf/8mjBusR1B5R6umgjpUAHY/S Ekr7dMKZXLU7kmTc3AOP/vVyryLTQetDI3R0FDSh2Z7Nu/E313zDlGk9hMEKUZCEHb8i 00Qw== X-Received: by 10.70.102.1 with SMTP id fk1mr36130686pdb.97.1415665241730; Mon, 10 Nov 2014 16:20:41 -0800 (PST) Received: from localhost.localdomain (14-201-185-176.static.tpgi.com.au. [14.201.185.176]) by mx.google.com with ESMTPSA id tv4sm17685910pab.28.2014.11.10.16.20.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Nov 2014 16:20:41 -0800 (PST) From: Damien Zammit X-Google-Original-From: Damien Zammit To: alsa-devel@alsa-project.org Date: Tue, 11 Nov 2014 11:20:17 +1100 Message-Id: <1415665217-7748-3-git-send-email-damien@zamaudio.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415665217-7748-1-git-send-email-damien@zamaudio.com> References: <1415665217-7748-1-git-send-email-damien@zamaudio.com> Cc: tiwai@suse.de, Damien Zammit , clemens@ladisch.de Subject: [alsa-devel] [PATCH 2/2 v6] ALSA: usb-audio: Add duplex mode for Digidesign Mbox 1 and enable mixer 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 patch provides duplex support for the Digidesign Mbox 1 sound card and has been a work in progress for about a year. Users have confirmed on my website that previous versions of this patch have worked on the hardware and I have been testing extensively. It also enables the mixer control for providing clock source selector based on the previous patch. The sample rate has been hardcoded to 48kHz because it works better with the S/PDIF sync mode when the sample rate is locked. This is the highest rate that the device supports and no loss of functionality is observed by restricting the sample rate apart from the inability to select a lower rate. Signed-off-by: Damien Zammit --- sound/usb/quirks-table.h | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index c657752..19eee96 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -2941,10 +2941,10 @@ YAMAHA_DEVICE(0x7010, "UB99"), .product_name = "MBox", .ifnum = QUIRK_ANY_INTERFACE, .type = QUIRK_COMPOSITE, - .data = (const struct snd_usb_audio_quirk[]){ + .data = &(const struct snd_usb_audio_quirk[]){ { .ifnum = 0, - .type = QUIRK_IGNORE_INTERFACE, + .type = QUIRK_AUDIO_STANDARD_MIXER, }, { .ifnum = 1, @@ -2955,16 +2955,40 @@ YAMAHA_DEVICE(0x7010, "UB99"), .iface = 1, .altsetting = 1, .altset_idx = 1, - .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE, + .attributes = 0x4, .endpoint = 0x02, - .ep_attr = 0x01, - .rates = SNDRV_PCM_RATE_44100 | - SNDRV_PCM_RATE_48000, - .rate_min = 44100, + .ep_attr = USB_ENDPOINT_XFER_ISOC | + USB_ENDPOINT_SYNC_SYNC, + .maxpacksize = 0x130, + .rates = SNDRV_PCM_RATE_48000, + .rate_min = 48000, .rate_max = 48000, - .nr_rates = 2, + .nr_rates = 1, .rate_table = (unsigned int[]) { - 44100, 48000 + 48000 + } + } + }, + { + .ifnum = 1, + .type = QUIRK_AUDIO_FIXED_ENDPOINT, + .data = &(const struct audioformat) { + .formats = SNDRV_PCM_FMTBIT_S24_3BE, + .channels = 2, + .iface = 1, + .altsetting = 1, + .altset_idx = 1, + .attributes = 0x4, + .endpoint = 0x81, + .ep_attr = USB_ENDPOINT_XFER_ISOC | + USB_ENDPOINT_SYNC_ASYNC, + .maxpacksize = 0x130, + .rates = SNDRV_PCM_RATE_48000, + .rate_min = 48000, + .rate_max = 48000, + .nr_rates = 1, + .rate_table = (unsigned int[]) { + 48000 } } }, @@ -2972,7 +2996,6 @@ YAMAHA_DEVICE(0x7010, "UB99"), .ifnum = -1 } } - } },