From patchwork Fri Aug 2 11:52:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard van Breemen X-Patchwork-Id: 11073221 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4D7CA1399 for ; Fri, 2 Aug 2019 11:54:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35EE62880A for ; Fri, 2 Aug 2019 11:54:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 286C02880D; Fri, 2 Aug 2019 11:54:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RDNS_NONE autolearn=no version=3.3.1 Received: from alsa0.perex.cz (unknown [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7FC362880A for ; Fri, 2 Aug 2019 11:54:31 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C853D172F; Fri, 2 Aug 2019 13:53:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C853D172F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1564746869; bh=9nLQ+PJ/u27qaUwVcMt7qH/sMnPQa+M6uiPbZVRBcgo=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vJA62455u9ZpTY89rfPv0qrUAcXwYujc95nIb4iOZxycUzozzpEofruqWw3ZbUbRv GacgWpgDKl+9irXeDayLHK8NQICKJhQngXqrpCcNokUg6vUFf8pGLKxbRYcjW3e9V9 tW6WRNtDID/6D5TbZxNQ7NU03aOSynn21JJnnWtE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B4C5AF804CC; Fri, 2 Aug 2019 13:52:47 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id B8930F804CC; Fri, 2 Aug 2019 13:52:46 +0200 (CEST) Received: from mail.kwaak.net (gw-fsck-sorbs.kwaak.net [82.197.218.155]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 59A29F804CA for ; Fri, 2 Aug 2019 13:52:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 59A29F804CA Received: from [192.168.0.171] (port=59312 helo=lenny.kwaak.net) by mail.kwaak.net with esmtp (Exim 4.50) id 1htW6v-0006ye-JQ; Fri, 02 Aug 2019 13:52:38 +0200 From: Ard van Breemen To: alsa-devel@alsa-project.org Date: Fri, 2 Aug 2019 13:52:14 +0200 Message-Id: <20190802115215.311-2-ard@kwaak.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190802115215.311-1-ard@kwaak.net> References: <20190802115215.311-1-ard@kwaak.net> X-Host-Lookup-Failed: Reverse DNS lookup failed for 192.168.0.171 (failed) X-Kwaak-Spam-Score: -2.4 X-kwaak-MailScanner: Found to be clean X-kwaak-MailScanner-SpamCheck: not spam, SpamAssassin (score=-2.116, required 5, autolearn=not spam, AWL 0.19, BAYES_00 -2.60, DNS_FROM_AHBL_RHSBL 0.29) X-MailScanner-From: ard@kwaak.net Cc: Ard van Breemen Subject: [alsa-devel] [PATCH 1/2] ALSA snd-usb-audio: Skip bSynchAddress endpoint check if it is invalid. X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP The Linux kernel assumes that get_endpoint(alts,0) and get_endpoint(alts,1) are eachothers feedback endpoints. To reassure that validity it will test bsynchaddress to comply with that assumption. But if the bsyncaddress is 0 (invalid), it will flag that as a wrong assumption and return an error. Fix: Skip the test if bSynchAddress is 0. Note: those with a valid bSynchAddress should have a code quirck added. Signed-off-by: Ard van Breemen --- sound/usb/pcm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index 75b96929f76c..51a8faf25ed8 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -456,6 +456,7 @@ static int set_sync_endpoint(struct snd_usb_substream *subs, } ep = get_endpoint(alts, 1)->bEndpointAddress; if (get_endpoint(alts, 0)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE && + get_endpoint(alts, 0)->bSynchAddress != 0 && ((is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress | USB_DIR_IN)) || (!is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress & ~USB_DIR_IN)))) { dev_err(&dev->dev, From patchwork Fri Aug 2 11:52:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard van Breemen X-Patchwork-Id: 11073223 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 068B71399 for ; Fri, 2 Aug 2019 11:55:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5C9A2880A for ; Fri, 2 Aug 2019 11:55:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9DC32880D; Fri, 2 Aug 2019 11:55:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RDNS_NONE autolearn=no version=3.3.1 Received: from alsa0.perex.cz (unknown [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 491382880A for ; Fri, 2 Aug 2019 11:55:20 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AC10B173C; Fri, 2 Aug 2019 13:54:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AC10B173C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1564746918; bh=aMoq2zUXFOT/LUbqGAAtEMz4CHCv0bDAccjHYBvKLpI=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=eCidwG191uNKGywHiMifhWc0IG26/Wlw2FodkxBf7IumYBGegxFPRQQh9yON2i2UI wLrtZdBlWYKEbV9xgauuphV6RKF0DT0srcbdW98Th9KjTiKc5wXReD6+dBeK/EOQ2K zAPHBKEQypMUZQAix2XXbVpeAzXhqssF50cMnqQ4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BCD41F804FE; Fri, 2 Aug 2019 13:52:49 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0E6B7F80507; Fri, 2 Aug 2019 13:52:48 +0200 (CEST) Received: from mail.kwaak.net (gw-fsck-sorbs.kwaak.net [82.197.218.155]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BF7FBF8049B for ; Fri, 2 Aug 2019 13:52:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BF7FBF8049B Received: from [192.168.0.171] (port=59312 helo=lenny.kwaak.net) by mail.kwaak.net with esmtp (Exim 4.50) id 1htW6z-0006ye-J3; Fri, 02 Aug 2019 13:52:42 +0200 From: Ard van Breemen To: alsa-devel@alsa-project.org Date: Fri, 2 Aug 2019 13:52:15 +0200 Message-Id: <20190802115215.311-3-ard@kwaak.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190802115215.311-1-ard@kwaak.net> References: <20190802115215.311-1-ard@kwaak.net> X-Host-Lookup-Failed: Reverse DNS lookup failed for 192.168.0.171 (failed) X-Kwaak-Spam-Score: -2.4 X-kwaak-MailScanner: Found to be clean X-kwaak-MailScanner-SpamCheck: not spam, SpamAssassin (score=-2.119, required 5, AWL 0.16, BAYES_00 -2.60, DNS_FROM_AHBL_RHSBL 0.29, UPPERCASE_25_50 0.03) X-MailScanner-From: ard@kwaak.net Cc: Ard van Breemen Subject: [alsa-devel] [PATCH 2/2] ALSA snd-usb-audio: Add Pioneer DDJ-SX3 PCM quirck. X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP The Pioneer DDJ-SX3 is a plain 12 32bit channel out and 10 channel in PCM/midi controller. The PCM part is "vendor specific". It needs the "ignore invalid bsynchaddress" patch as it uses 0 for that. Signed-off-by: Ard van Breemen --- sound/usb/quirks-table.h | 57 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index 9e049f60e80e..858c6fb17b78 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -3534,5 +3534,62 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"), } } }, +{ + /* + * PIONEER DJ DDJ-SX3 + * PCM is 12 channels out, 10 channels in @ 44.1 fixed + * interface 0, vendor class alt setting 1 for endpoints 5 and 0x86 + * The feedback for the output is the input. + */ + USB_DEVICE_VENDOR_SPEC(0x2b73, 0x0023), + .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { + .ifnum = QUIRK_ANY_INTERFACE, + .type = QUIRK_COMPOSITE, + .data = (const struct snd_usb_audio_quirk[]) { + { + .ifnum = 0, + .type = QUIRK_AUDIO_FIXED_ENDPOINT, + .data = &(const struct audioformat) { + .formats = SNDRV_PCM_FMTBIT_S32_LE, + .channels = 12, + .iface = 0, + .altsetting = 1, + .altset_idx = 1, + .endpoint = 0x05, + .ep_attr = USB_ENDPOINT_XFER_ISOC| + USB_ENDPOINT_SYNC_ASYNC, + .rates = SNDRV_PCM_RATE_44100, + .rate_min = 44100, + .rate_max = 44100, + .nr_rates = 1, + .rate_table = (unsigned int[]) { 44100 } + } + }, + { + .ifnum = 0, + .type = QUIRK_AUDIO_FIXED_ENDPOINT, + .data = &(const struct audioformat) { + .formats = SNDRV_PCM_FMTBIT_S32_LE, + .channels = 10, + .iface = 0, + .altsetting = 1, + .altset_idx = 1, + .endpoint = 0x86, + .ep_attr = USB_ENDPOINT_XFER_ISOC| + USB_ENDPOINT_SYNC_ASYNC| + USB_ENDPOINT_USAGE_IMPLICIT_FB, + .rates = SNDRV_PCM_RATE_44100, + .rate_min = 44100, + .rate_max = 44100, + .nr_rates = 1, + .rate_table = (unsigned int[]) { 44100 } + } + }, + { + .ifnum = -1 + } + } + } +}, #undef USB_DEVICE_VENDOR_SPEC