From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: John Veness <john-linux@pelago.org.uk>,
Takashi Iwai <tiwai@suse.de>, Sasha Levin <sashal@kernel.org>,
perex@perex.cz, tiwai@suse.com, hahnjo@hahnjo.de,
sdoregor@sdore.me, willovertonuk@gmail.com,
brendan@grieve.com.au, alexander@tsoy.me,
alsa-devel@alsa-project.org
Subject: [PATCH AUTOSEL 5.15 24/28] ALSA: usb-audio: Add quirks for MacroSilicon MS2100/MS2106 devices
Date: Thu, 14 Jul 2022 00:24:25 -0400 [thread overview]
Message-ID: <20220714042429.281816-24-sashal@kernel.org> (raw)
In-Reply-To: <20220714042429.281816-1-sashal@kernel.org>
From: John Veness <john-linux@pelago.org.uk>
[ 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 <john-linux@pelago.org.uk>
Link: https://lore.kernel.org/r/20220624140757.28758-1-john-linux@pelago.org.uk
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/quirks-table.h | 48 ++++++++++++++++++++++++++++++++++++++++
sound/usb/quirks.c | 3 +++
2 files changed, 51 insertions(+)
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index 4f56e1784932..853da162fd18 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -3802,6 +3802,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
*
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index e8468f9b007d..a72874bc0936 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1478,6 +1478,7 @@ void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
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;
@@ -1904,6 +1905,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
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 */
--
2.35.1
next prev parent reply other threads:[~2022-07-14 4:32 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 4:24 [PATCH AUTOSEL 5.15 01/28] ASoC: ops: Fix off by one in range control validation Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 02/28] pinctrl: aspeed: Fix potential NULL dereference in aspeed_pinmux_set_mux() Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 03/28] ASoC: Realtek/Maxim SoundWire codecs: disable pm_runtime on remove Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 04/28] ASoC: rt711-sdca-sdw: fix calibrate mutex initialization Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 05/28] ASoC: Intel: sof_sdw: handle errors on card registration Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 06/28] ASoC: rt711: fix calibrate mutex initialization Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 07/28] ASoC: rt7*-sdw: harden jack_detect_handler Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 08/28] ASoC: codecs: rt700/rt711/rt711-sdca: initialize workqueues in probe Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 09/28] ASoC: SOF: Intel: hda-loader: Clarify the cl_dsp_init() flow Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 10/28] ASoC: wcd938x: Fix event generation for some controls Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 11/28] ASoC: Intel: bytcr_wm5102: Fix GPIO related probe-ordering problem Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 12/28] ASoC: rockchip: i2s: switch BCLK to GPIO Sasha Levin
2022-07-14 4:29 ` Chen-Yu Tsai
2022-07-17 23:04 ` Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 13/28] ASoC: wm5110: Fix DRE control Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 14/28] ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 15/28] ASoC: dapm: Initialise kcontrol data for mux/demux controls Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 16/28] ASoC: cs47l15: Fix event generation for low power mux control Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 17/28] ASoC: madera: Fix event generation for OUT1 demux Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 18/28] ASoC: madera: Fix event generation for rate controls Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 19/28] irqchip: or1k-pic: Undefine mask_ack for level triggered hardware Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 20/28] x86: Clear .brk area at early boot Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 21/28] soc: ixp4xx/npe: Fix unused match warning Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 22/28] ARM: dts: stm32: use the correct clock source for CEC on stm32mp151 Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 23/28] Revert "can: xilinx_can: Limit CANFD brp to 2" Sasha Levin
2022-07-14 4:24 ` Sasha Levin [this message]
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 25/28] ALSA: usb-audio: Add quirk for Fiero SC-01 Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 26/28] ALSA: usb-audio: Add quirk for Fiero SC-01 (fw v1.0.0) Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 27/28] nvme-pci: phison e16 has bogus namespace ids Sasha Levin
2022-07-14 4:24 ` [PATCH AUTOSEL 5.15 28/28] signal handling: don't use BUG_ON() for debugging Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220714042429.281816-24-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=alexander@tsoy.me \
--cc=alsa-devel@alsa-project.org \
--cc=brendan@grieve.com.au \
--cc=hahnjo@hahnjo.de \
--cc=john-linux@pelago.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=sdoregor@sdore.me \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.com \
--cc=tiwai@suse.de \
--cc=willovertonuk@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).