Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4473943imw; Tue, 19 Jul 2022 07:17:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uzCv9cUXaZQEE51yiqulJ299DUNbnN13mH84b2n9H0u/FpPOnCrx/cWo+kmvxwr/ZFhYEN X-Received: by 2002:a17:907:7615:b0:72b:35a6:5992 with SMTP id jx21-20020a170907761500b0072b35a65992mr30434280ejc.97.1658240230430; Tue, 19 Jul 2022 07:17:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658240230; cv=none; d=google.com; s=arc-20160816; b=foNxmlADF+ysm/Jvl9kK1GowGbhQFUP2dch+nW33x/7WW1BjtWo+SSsB2WpG2UWWaK qLFUqyfaxJOPzCBauM6O87lTYcOqgpqdawkJjXB+r1yU9BiFSwJu3muyT222qDOu4FWk V2920cfstnjdghQeRGMkIV7yZ1i+M46NsZsS+opDfwQ/W67Z/zIVBP5sbbd8pU3Kddgd I8e9bGnxsZ204dEEU1YOcET2JoaHl27F8iUGEchMkEamofR9HYOI/5tscM2sxlEYglQt q4XEJfhjRa08itYMkJd1Uo3a31Dq4fnGFRUDHO5P5cUQMAXDY/xF6oZFQDO8lwjyPF8F zm7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BYDFNqcFKStP7tpnriZszK64J/CdalveBrEZ+JtEwQg=; b=TWyJkaE3/KnlS9W3YEYO+uyrIqFY7XusjXkdnpFTQL5piCzibsO96+744Youlp/UW/ EkTo0/GHeAi0l+YNJwyKWMbjUxygrA/mch6ylH7Oz4d9yT9+aif2/mdeLpX2xDV2I+vF 0WMM0HoVgZ5E0ccxmSRDcTMAi5ecT64lFpPUTYBhr+SmuhG2aI6udk3Xur13jBXV4yxk s/Tj1+fVhlraeDdLraWMr7hrOWuQcS+0pxeRFgqnB2Z0MlgPp3ZXd8D09sCMDTl5XtqO pQ0cehz3RoMgWeyd2mXNFhULaN+L1ijOagJ95sgMakZyAKGQuLgzgxOvITuE2CdpamH+ I3JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wk2kxn9w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eb14-20020a0564020d0e00b0043a84d5e5eesi19100177edb.393.2022.07.19.07.16.46; Tue, 19 Jul 2022 07:17:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wk2kxn9w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239384AbiGSMpg (ORCPT + 99 others); Tue, 19 Jul 2022 08:45:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241652AbiGSMoT (ORCPT ); Tue, 19 Jul 2022 08:44:19 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E8F185D77; Tue, 19 Jul 2022 05:17:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A1F4AB81B2E; Tue, 19 Jul 2022 12:17:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02FA6C341C6; Tue, 19 Jul 2022 12:17:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658233039; bh=o97yyzqXtkAi9dD3IykIm+0aHWiYI1dIxHa/BFEbvjI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wk2kxn9wvoP4wRhnSOVTGyHcsHOV9f6yQBSAphRR8ux0y6zq0yjFGPYb8nIjWMgdQ NoPJT2oNdMRGZEcy8MRNfUQFzU6zp8ZObtBa1h9LFaPgezHw5UiyKCpnd/tv6LcT5u lfPn5Ab6HYHhS7GvFMCu9P5qqcmmsJJ2MlQdbcVI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Veness , Takashi Iwai , Sasha Levin Subject: [PATCH 5.15 153/167] ALSA: usb-audio: Add quirks for MacroSilicon MS2100/MS2106 devices Date: Tue, 19 Jul 2022 13:54:45 +0200 Message-Id: <20220719114711.277508845@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114656.750574879@linuxfoundation.org> References: <20220719114656.750574879@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: John Veness [ Upstream commit 6e2c9105e0b743c92a157389d40f00b81bdd09fe ] Treat the claimed 96kHz 1ch in the descriptors as 48kHz 2ch, so that the audio stream doesn't sound mono. Also fix initial stream alignment, so that left and right channels are in the correct order. Signed-off-by: John Veness Link: https://lore.kernel.org/r/20220624140757.28758-1-john-linux@pelago.org.uk Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/usb/quirks-table.h | 48 +++++++++++++++++++++++++++++++++++++++++++++++ sound/usb/quirks.c | 3 ++ 2 files changed, 51 insertions(+) --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -3803,6 +3803,54 @@ YAMAHA_DEVICE(0x7010, "UB99"), }, /* + * MacroSilicon MS2100/MS2106 based AV capture cards + * + * These claim 96kHz 1ch in the descriptors, but are actually 48kHz 2ch. + * They also need QUIRK_FLAG_ALIGN_TRANSFER, which makes one wonder if + * they pretend to be 96kHz mono as a workaround for stereo being broken + * by that... + * + * They also have an issue with initial stream alignment that causes the + * channels to be swapped and out of phase, which is dealt with in quirks.c. + */ +{ + USB_AUDIO_DEVICE(0x534d, 0x0021), + .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { + .vendor_name = "MacroSilicon", + .product_name = "MS210x", + .ifnum = QUIRK_ANY_INTERFACE, + .type = QUIRK_COMPOSITE, + .data = &(const struct snd_usb_audio_quirk[]) { + { + .ifnum = 2, + .type = QUIRK_AUDIO_STANDARD_MIXER, + }, + { + .ifnum = 3, + .type = QUIRK_AUDIO_FIXED_ENDPOINT, + .data = &(const struct audioformat) { + .formats = SNDRV_PCM_FMTBIT_S16_LE, + .channels = 2, + .iface = 3, + .altsetting = 1, + .altset_idx = 1, + .attributes = 0, + .endpoint = 0x82, + .ep_attr = USB_ENDPOINT_XFER_ISOC | + USB_ENDPOINT_SYNC_ASYNC, + .rates = SNDRV_PCM_RATE_CONTINUOUS, + .rate_min = 48000, + .rate_max = 48000, + } + }, + { + .ifnum = -1 + } + } + } +}, + +/* * MacroSilicon MS2109 based HDMI capture cards * * These claim 96kHz 1ch in the descriptors, but are actually 48kHz 2ch. --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1478,6 +1478,7 @@ void snd_usb_set_format_quirk(struct snd case USB_ID(0x041e, 0x3f19): /* E-Mu 0204 USB */ set_format_emu_quirk(subs, fmt); break; + case USB_ID(0x534d, 0x0021): /* MacroSilicon MS2100/MS2106 */ case USB_ID(0x534d, 0x2109): /* MacroSilicon MS2109 */ subs->stream_offset_adj = 2; break; @@ -1908,6 +1909,8 @@ static const struct usb_audio_quirk_flag QUIRK_FLAG_IGNORE_CTL_ERROR), DEVICE_FLG(0x413c, 0xa506, /* Dell AE515 sound bar */ QUIRK_FLAG_GET_SAMPLE_RATE), + DEVICE_FLG(0x534d, 0x0021, /* MacroSilicon MS2100/MS2106 */ + QUIRK_FLAG_ALIGN_TRANSFER), DEVICE_FLG(0x534d, 0x2109, /* MacroSilicon MS2109 */ QUIRK_FLAG_ALIGN_TRANSFER), DEVICE_FLG(0x1224, 0x2a25, /* Jieli Technology USB PHY 2.0 */