From patchwork Mon Jun 6 16:09:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 578980 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4F2FC43334 for ; Mon, 6 Jun 2022 16:10:28 +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 16CE11A48; Mon, 6 Jun 2022 18:09:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 16CE11A48 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654531827; bh=XlOFVbFNccqK8c9FdaOVgywRIcmM7ZPVePVUpmfc3+A=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=g3w4r+Z0PfyOfudP3CtXWOt4DmWOo2pPeAlgAWXxnYG1mh2Mdf/71Lz2kcrvSh2Q/ oVzeVTHy3QFaZXSCLWF0+wqHuDclG99GmHGALmtGDEGpM9BdDSWYhrnpPmY4B/ExXm oDmz+MQmt1tVjvwCy27tVrzBI/YwZ6yAe2p6aTUk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 13AC5F80529; Mon, 6 Jun 2022 18:09:21 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 619F1F80526; Mon, 6 Jun 2022 18:09:20 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 33A66F80526 for ; Mon, 6 Jun 2022 18:09:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 33A66F80526 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="VN3jkdt0"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="NZg6lMft" Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id AAC3D1F9E0; Mon, 6 Jun 2022 16:09:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1654531753; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u0x8v33dHdO6cSdiiS2dYjUghvsX7J20C1soNLX1oL4=; b=VN3jkdt054iW0rIN3DFZFSbpLzKWJ4UqVCOb86pTt2wELzrKMQD0o/6nTPma2T622gKaoi COIU8Z7IOWIh8+vFMtcsec/XzmEdgQUgtM+FNR2PGUSAs8wEJfHG2UlCTmrqwS5kmMBpLM C9o3R00r8Kcl1m3Jes62YszPAMsGhOc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1654531753; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u0x8v33dHdO6cSdiiS2dYjUghvsX7J20C1soNLX1oL4=; b=NZg6lMftdylpKoS8Xk01wWrotCMS9swzlEnPdmFVKLa6EauyOClVO5ZKdchqscNYwen/X+ KecTE0bDN7f3/ECg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8B26213AA2; Mon, 6 Jun 2022 16:09:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id GMgSIakmnmKoAwAAMHmgww (envelope-from ); Mon, 06 Jun 2022 16:09:13 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH 1/2] ALSA: usb-audio: Skip generic sync EP parse for secondary EP Date: Mon, 6 Jun 2022 18:09:09 +0200 Message-Id: <20220606160910.6926-2-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220606160910.6926-1-tiwai@suse.de> References: <20220606160910.6926-1-tiwai@suse.de> MIME-Version: 1.0 Cc: =?utf-8?q?Andr=C3=A9_Kapelrud?= 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" When ep_idx is already non-zero, it means usually a capture stream that is set up explicity by a fixed-format quirk, and applying the check for generic (non-implicit-fb) sync EPs might hit incorrectly, resulting in a bogus sync endpoint for the capture stream. This patch adds a check for the ep_idx and skip if it's a secondary endpoint. It's a part of the fixes for regressions on Saffire 6. Fixes: 7b0efea4baf0 ("ALSA: usb-audio: Add missing ep_idx in fixed EP quirks") Reported-and-tested-by: André Kapelrud Cc: Signed-off-by: Takashi Iwai --- sound/usb/pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index b470404a5376..b0369df53910 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -304,7 +304,7 @@ int snd_usb_audioformat_set_sync_ep(struct snd_usb_audio *chip, * Generic sync EP handling */ - if (altsd->bNumEndpoints < 2) + if (fmt->ep_idx > 0 || altsd->bNumEndpoints < 2) return 0; is_playback = !(get_endpoint(alts, 0)->bEndpointAddress & USB_DIR_IN); From patchwork Mon Jun 6 16:09:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 579470 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A8674C43334 for ; Mon, 6 Jun 2022 16:10:35 +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 C3E1E1A46; Mon, 6 Jun 2022 18:09:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C3E1E1A46 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654531833; bh=N5k6/hRuI9AyJFz7PMaRYfsY/gVcl3HbQQ/8s6zPXAw=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=PXHoBrpUlqdh8YsXCIxTAWafXN+Z/ZG+MI0o+lR71o7jXwQyzQLLt6yf3Gd15NqFf xyytAZ08VLKMY2ArzE139KqlTqY29+YF6eJf5va+drCo+zMAVfiV4wwMLWDMedJS02 PGHhYwp7zZpMsJTxwdBgBL1qmHjwKs9PQle4k5N4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7F066F80535; Mon, 6 Jun 2022 18:09:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E69CBF8051E; Mon, 6 Jun 2022 18:09:22 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F2CD8F8051E for ; Mon, 6 Jun 2022 18:09:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F2CD8F8051E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="vDNF3d4r"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="0oUDfonD" Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C781B21B04; Mon, 6 Jun 2022 16:09:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1654531753; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nF1SK7dK9r0pT4UeBKfa7xvQOwIagFDlsVW0Swm1k4A=; b=vDNF3d4rlWF2ybYS3CW/kcYnZo0KBStrlupQvRBIWTO8hOZW14ErvZyIlon70V7lbX2CLO YByvgTGu7jksHrbEZ2OVJo7Jnsk088FQyvhrmdj83/TiBd2H3z2yCSjGsr+t2A8XA6fIor E7hptDY/dQhccyyb74639I0I1osTHMk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1654531753; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nF1SK7dK9r0pT4UeBKfa7xvQOwIagFDlsVW0Swm1k4A=; b=0oUDfonDhgffPkWsZe1Rb+knggMIQ/v8Q7KON9pbObdEDx0vcu34QOzFyCU1KjjuoiUUyN FRMi6VX7ombE6KAw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id ABED413A5F; Mon, 6 Jun 2022 16:09:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EJVFKakmnmKoAwAAMHmgww (envelope-from ); Mon, 06 Jun 2022 16:09:13 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH 2/2] ALSA: usb-audio: Set up (implicit) sync for Saffire 6 Date: Mon, 6 Jun 2022 18:09:10 +0200 Message-Id: <20220606160910.6926-3-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220606160910.6926-1-tiwai@suse.de> References: <20220606160910.6926-1-tiwai@suse.de> MIME-Version: 1.0 Cc: =?utf-8?q?Andr=C3=A9_Kapelrud?= 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Focusrite Saffire 6 has fixed audioformat quirks with multiple endpoints assigned to a single altsetting. Unfortunately the generic parser couldn't detect the sync endpoint correctly as the implicit sync due to the missing EP attribute bits. In the former kernels, it used to work somehow casually, but it's been broken for a while after the large code change in 5.11. This patch cures the regression by the following: - Allow the static quirk table to provide the sync EP information; we just need to fill the fields and let the generic parser skipping parsing if sync_ep is already set. - Add the sync endpoint information to the entry for Saffire 6. Fixes: 7b0efea4baf0 ("ALSA: usb-audio: Add missing ep_idx in fixed EP quirks") Reported-and-tested-by: André Kapelrud Cc: Signed-off-by: Takashi Iwai --- sound/usb/pcm.c | 3 +++ sound/usb/quirks-table.h | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index b0369df53910..e692ae04436a 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -291,6 +291,9 @@ int snd_usb_audioformat_set_sync_ep(struct snd_usb_audio *chip, bool is_playback; int err; + if (fmt->sync_ep) + return 0; /* already set up */ + alts = snd_usb_get_host_interface(chip, fmt->iface, fmt->altsetting); if (!alts) return 0; diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index 78eb41b621d6..4f56e1784932 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -2658,7 +2658,12 @@ YAMAHA_DEVICE(0x7010, "UB99"), .nr_rates = 2, .rate_table = (unsigned int[]) { 44100, 48000 - } + }, + .sync_ep = 0x82, + .sync_iface = 0, + .sync_altsetting = 1, + .sync_ep_idx = 1, + .implicit_fb = 1, } }, {