From nobody Fri Sep 25 23:10:47 2026 Received: from sender4-op-o15.zoho.com (sender4-op-o15.zoho.com [136.143.188.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 483173AFCE3; Mon, 7 Sep 2026 19:35:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788809711; cv=pass; b=noH4a8lxlVOmt1B3vOks3c7P9IojSkeAO3ED0GuXOzmy5PVRtcy01jCQ0yqAQEwHQebXqPSUIJ+NBdx1yWYfXDg9DOvCFzXFWaF5kowoGhQte0VGbFSDoagJXol/SXy2FScB81H+v+lzv600gbc5DCXgHn2nGsegRLP7bg81S1c= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788809711; c=relaxed/simple; bh=4HaGzMcGPx9s0u9x0nvtzwRlskOgxNWLJE816w3eD7w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=R+DKFtZ8Au9QI8+99uohUFfSH4ZES24WenG3D5ZP3Ff54Rdh8WUxFm3ZjR1wlJZ+kCgOiGvFeVjQFWfAcnctI0CemKgOHajgpv/wYJLH2EfOll7uuMkmKvklQnwoITuEJEY/R//+gLVCFmCK/3OacHG/Ygb1uFj4lzvMrbyuwE4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe; spf=pass smtp.mailfrom=rong.moe; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b=Exms/u0a; arc=pass smtp.client-ip=136.143.188.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rong.moe Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b="Exms/u0a" ARC-Seal: i=1; a=rsa-sha256; t=1788809697; cv=none; d=zohomail.com; s=zohoarc; b=kKXyVwOY44jTYgVbck7qToTL+K7trcwm4Mc7YATNMh8udJ/IwmhgzLtboTejpF3OQ8NFJI9L0uTLgF1dik3zgaVjV3kdqkGryowhIQ2+jz/hVrrY81ATOUpt5ejZrGO+2rCtsJMemGdEcaX89k2rs00IJdC44NkvxdRDAZmP3xc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788809697; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=DfH2LRJLFeTgvzPF/W3OIThz3rw0voZiqYQwEN7Kc1Q=; b=XA6jW1KJcmgXdpWtLvo1LUQ+Agf7E2Czran5a8jZExp+YumPjuYDhXPcAnkhSNLv08ZAqmZ18SkJoHe8BN72E4iEx/Z48KEEckCk3TmW5Mmp9o72zPeRQlg6FCSEIPqxyuiWvQq4bvTJ+3ab6uJRZKYOBTWmZ0g8oXICFajC5l8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=rong.moe; spf=pass smtp.mailfrom=i@rong.moe; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1788809697; s=zmail2048; d=rong.moe; i=i@rong.moe; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=DfH2LRJLFeTgvzPF/W3OIThz3rw0voZiqYQwEN7Kc1Q=; b=Exms/u0a2uLCrJMiiCC1vFHB0/MfRUHdA8Nq0VyfIfnrjhqXlySpmekjWL6o11vx Al2oig1kGaEY6oEINUolANjqNhq01g50ujcjVsZiqBJBvE2nmEhGY2jzeFgYw7JDaLd ScgxDql7un7mWvn0fUURyoZtrdZ4EY9Ce7T2MZ75ftzH7Nxw6SEE7fVoQjIIG1OhkQe aERJ9xOwUivBPZJr0oYUUHF+7dZ9kkyg8NzEHsG+VQX3U3IVnlOJJOCse5IlBCUI86W LR6RlyYUHfzRIEDQcQXl6TvD7PTKSHfhe2JbnRUAR4aXmtv2vdGoT7B6Vl0DIwlIQKh Ap/usDOIIg== Received: by mx.zohomail.com with SMTPS id 1788809693585630.894171923085; Mon, 7 Sep 2026 12:34:53 -0700 (PDT) From: Rong Zhang Date: Tue, 08 Sep 2026 03:34:39 +0800 Subject: [PATCH 1/2] ALSA: usb-audio: Convert snd_usb_apply_interface_quirk() into a switch statement Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260908-uac-hp-elite-x3-lap-dock-v1-1-e226cfe4038e@rong.moe> References: <20260908-uac-hp-elite-x3-lap-dock-v1-0-e226cfe4038e@rong.moe> In-Reply-To: <20260908-uac-hp-elite-x3-lap-dock-v1-0-e226cfe4038e@rong.moe> To: Jaroslav Kysela , Takashi Iwai Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Rong Zhang X-Mailer: b4 0.17-dev-1f2f7 X-ZohoMailClient: External A switch statement is more readable than the current if blocks. Also sort the cases in an ascending order. As an interesting effect, this shrinks the size of quirks.o by 64 bytes (GCC 16 -O2 x86_64): text data bss total filename (before) 15266 12279 0 27545 quirks.o text data bss total filename (before) 15202 12279 0 27481 quirks.o Signed-off-by: Rong Zhang --- sound/usb/quirks.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 91938172912a..6e4808330a80 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1589,18 +1589,20 @@ int snd_usb_apply_interface_quirk(struct snd_usb_au= dio *chip, int iface, int altno) { - /* audiophile usb: skip altsets incompatible with device_setup */ - if (chip->usb_id =3D=3D USB_ID(0x0763, 0x2003)) - return audiophile_skip_setting_quirk(chip, iface, altno); + switch (chip->usb_id) { /* quattro usb: skip altsets incompatible with device_setup */ - if (chip->usb_id =3D=3D USB_ID(0x0763, 0x2001)) + case USB_ID(0x0763, 0x2001): return quattro_skip_setting_quirk(chip, iface, altno); + /* audiophile usb: skip altsets incompatible with device_setup */ + case USB_ID(0x0763, 0x2003): + return audiophile_skip_setting_quirk(chip, iface, altno); /* fasttrackpro usb: skip altsets incompatible with device_setup */ - if (chip->usb_id =3D=3D USB_ID(0x0763, 0x2012)) + case USB_ID(0x0763, 0x2012): return fasttrackpro_skip_setting_quirk(chip, iface, altno); /* presonus studio 1810c: skip altsets incompatible with device_setup */ - if (chip->usb_id =3D=3D USB_ID(0x194f, 0x010c)) + case USB_ID(0x194f, 0x010c): return s1810c_skip_setting_quirk(chip, iface, altno); + } =20 return 0; } --=20 2.55.0 From nobody Fri Sep 25 23:10:47 2026 Received: from sender5-op-o15.zoho.com (sender5-op-o15.zoho.com [165.173.182.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE5C8412280; Mon, 7 Sep 2026 19:35:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=165.173.182.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788809719; cv=pass; b=ZeqobcmOm8t5MrVrUGuTXw7QYjyJfbfIjv5GIEHVrPqZITkawDcX/a1wt5Y20+/qGEw4LRuEG4vhvjXCHGSabXWN3+n8M0MB2QF9rkrALncgKMV91gLeeYYfwgErxwdeEOOwwigm10Nz1rZSRgHaxiIatJiGcjmdA9D3FIzVEtI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788809719; c=relaxed/simple; bh=4Y8sx3ONZ3zL53OtxcsBEjCKaLvK0necxZ6DWhdZt7A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SnpNMeQc7qyRrp0HoFumnpHqED+JLxKms8EoxlKb030qbNHFL6797LIE9hdwe3TlaujX7F/MKSp6N92/9OhwGo1rc85JeHWYhOd2pfdZcj2rEMp2UY7L59U1E2uh4CfMAe/xQakofwyRohwNJuiwnV3LQajp0LJiFi/7PEXP04U= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe; spf=pass smtp.mailfrom=rong.moe; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b=W/B7zC+l; arc=pass smtp.client-ip=165.173.182.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rong.moe Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b="W/B7zC+l" ARC-Seal: i=1; a=rsa-sha256; t=1788809698; cv=none; d=zohomail.com; s=zohoarc; b=c7FxL89vbCVHjrsYKcMiJ7t4cmhq+ZneHwhzqxWT3t/1D/B03bBs6Fk6BPAODfrTqmaOxXFkrP+CQ3x6TtQii9drdWeMl/IMD5ftvE4qc4Gd8bexL5rizTY2DWdgqOy97AolXGewc4mpY03x0L4cBQwdXSuNb2i20dsWMbCcQeQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788809698; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=u/qHrBdVk/gn+RbDm+CHmVxzRHl6sCOs8xPOskDG3ok=; b=lRQiDdFgBXhtBOMHh8WLK+8eUIc2StPBFE2IdxWvi/IHnz7Smp7MQpEMUxFsIbweSVCI5PgPQvRwljaFG+RSY2Wu3U7H2U3M363cOZ9No6yTvt0ZQhX1xgq9MS7aBsWOyMti8WhZmi9MUHvmaLtacKcr8UivHQSCju4+oNkAIpA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=rong.moe; spf=pass smtp.mailfrom=i@rong.moe; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1788809698; s=zmail2048; d=rong.moe; i=i@rong.moe; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=u/qHrBdVk/gn+RbDm+CHmVxzRHl6sCOs8xPOskDG3ok=; b=W/B7zC+l/WO2WGW00v2CWsFRYY6/enbm6X/3s0dtaZHvPD02fUr4pNhlCC3dyx8J ZT3bExEAeqoBSBhNRQ9Iy174qqQNp8e3IYqBaK+kMsLh5BhZXhYFGtJx6jSGzo7YUbX VP8PfpZOEJ51e4ZmNKCPdUuJ8eHXXCZAZ5ep8vSsNoEr4DI/MdaXX/j/FlwGY/sQlf7 N3zBBNs5RoJvX7XJ+Z2t76kzkF/Y+Uk44HddsfxUQssMPH5q99kYFgoZIeR4/cAT5Tm GG4XiWUK3UZ9ydiuaRLG79/XlNS7wVat/GLir9NcK+molKrj0pGVXLxIRFmw3KZVay+ Go4rTOMhNA== Received: by mx.zohomail.com with SMTPS id 1788809695443853.7795859537737; Mon, 7 Sep 2026 12:34:55 -0700 (PDT) From: Rong Zhang Date: Tue, 08 Sep 2026 03:34:40 +0800 Subject: [PATCH 2/2] ALSA: usb-audio: Add quirks for HP Elite x3 Lap Dock Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260908-uac-hp-elite-x3-lap-dock-v1-2-e226cfe4038e@rong.moe> References: <20260908-uac-hp-elite-x3-lap-dock-v1-0-e226cfe4038e@rong.moe> In-Reply-To: <20260908-uac-hp-elite-x3-lap-dock-v1-0-e226cfe4038e@rong.moe> To: Jaroslav Kysela , Takashi Iwai Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Rong Zhang X-Mailer: b4 0.17-dev-1f2f7 X-ZohoMailClient: External The HP Elite x3 Lap Dock is a laptop-like external display device with a FHD screen, a keyboard, and a MT touchpad. It can be connected via USB-C or Miracast. As an e-waste collector, I recently brought one for 69 CNY (10.2 USD). The price already indicates how broken the device's design and compatibility are ;-P When connecting via USB-C, the video source is, of course, DisplayPort Alternate Mode. However, the audio source has nothing to do with the DisplayPort signal and is actually from a builtin UAC device. The builtin UAC device provides three Alternate Settings: - 1:1 - Capture, S16_LE, 8000/32000/44100/48000Hz - 2:1 - Playback, S16_LE, 48000Hz - 2:2 - Playback, S24_3LE, 48000Hz Unfortunately, the last one is broken because: - it doesn't accept SET_CUR(SAMPLE_RATE). QUIRK_FLAG_FIXED_RATE works around it, however... - it constantly produces severe harmonic distortion once the capture stream is also opened. The interface 2 must be closed and reopened to make it recover. IOW, simply closing the capture stream makes no difference. Considering that S24_3LE offers no additional benefit on small speakers compared to S16_LE, and 2:1 is always usable as an alternative, skip 2:2 to get rid of the trouble. Setting chip->setup to any non-default value disables the fixup and reenables 2:2 (in this case QUIRK_FLAG_FIXED_RATE is required). Quirky device sample: usb 7-1.4: new full-speed USB device number 50 using xhci_hcd usb 7-1.4: New USB device found, idVendor=3D03f0, idProduct=3D0c56, bcdDe= vice=3D 0.00 usb 7-1.4: New USB device strings: Mfr=3D1, Product=3D2, SerialNumber=3D0 usb 7-1.4: Product: HP Elite x3 Lap Dock usb 7-1.4: Manufacturer: HP usb 7-1.4: Found last interface =3D 0 usb 7-1.4: 1:1: add audio endpoint 0x81 usb 7-1.4: Creating new data endpoint #81 usb 7-1.4: 1:1 Set sample rate 48000, clock 0 usb 7-1.4: 2:1: add audio endpoint 0x1 usb 7-1.4: Creating new data endpoint #1 usb 7-1.4: 2:1 Set sample rate 48000, clock 0 usb 7-1.4: 2:2: add audio endpoint 0x1 usb 7-1.4: 2:2 Set sample rate 48000, clock 0 usb 7-1.4: 2:2: cannot set freq 48000 to ep 0x1 usb 7-1.4: [9] FU [Sidetone Playback Switch] ch =3D 1, val =3D 0/1/1 usb 7-1.4: cannot set ctl value: req =3D 0x4, wValue =3D 0x200, wIndex = =3D 0x900, type =3D 4, data =3D 0x40/0x0 usb 7-1.4: [9] FU [Sidetone Playback Volume] ch =3D 1, val =3D -17664/0/1= 28 usb 7-1.4: [2] FU [Headset Playback Switch] ch =3D 1, val =3D 0/1/1 usb 7-1.4: [2] FU [Headset Playback Volume] ch =3D 2, val =3D -18944/0/1 usb 7-1.4: [6] FU [Headset Capture Switch] ch =3D 1, val =3D 0/1/1 usb 7-1.4: [6] FU [Headset Capture Volume] ch =3D 2, val =3D -18944/0/1 input: HP HP Elite x3 Lap Dock Consumer Control as /devices/pci0000:00/00= 00:00:08.3/0000:c9:00.4/usb7/7-1/7-1.4/7-1.4:1.3/0003:03F0:0C56.0033/input/= input129 input: HP HP Elite x3 Lap Dock as /devices/pci0000:00/0000:00:08.3/0000:c= 9:00.4/usb7/7-1/7-1.4/7-1.4:1.3/0003:03F0:0C56.0033/input/input130 hid-generic 0003:03F0:0C56.0033: input,hiddev100,hidraw8: USB HID v1.11 D= evice [HP HP Elite x3 Lap Dock] on usb-0000:c9:00.4-1.4/input3 Signed-off-by: Rong Zhang --- sound/usb/quirks.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 6e4808330a80..6462b8390106 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1585,11 +1585,47 @@ static int s1810c_skip_setting_quirk(struct snd_usb= _audio *chip, return 0; } =20 +static int hp_elite_x3_lap_dock_skip_setting_quirk(struct snd_usb_audio *c= hip, + int iface, int altno) +{ + /* + * 1:1 - Capture, S16_LE, 8000/32000/44100/48000Hz + * 2:1 - Playback, S16_LE, 48000Hz + * 2:2 - Playback, S24_3LE, 48000Hz + * + * 2:2 is broken because: + * - it doesn't accept SET_CUR(SAMPLE_RATE). QUIRK_FLAG_FIXED_RATE works + * around it, however... + * - it constantly produces severe harmonic distortion once the capture + * stream is also opened. The interface 2 must be closed and reopened + * to make it recover. IOW, simply closing the capture stream makes no + * difference. + * + * Considering that S24_3LE offers no additional benefit on small + * speakers compared to S16_LE, and 2:1 is always usable as an + * alternative, skip 2:2 to get rid of the trouble. + * + * Setting chip->setup to any non-default value disables the fixup and + * reenables 2:2 (in this case QUIRK_FLAG_FIXED_RATE is required). + */ + if (!chip->setup && iface =3D=3D 2 && altno =3D=3D 2) { + usb_audio_info(chip, + "%d:%d: skipping broken altsetting on HP Elite x3 Lap Dock\n", + iface, altno); + return 1; + } + + return 0; +} + int snd_usb_apply_interface_quirk(struct snd_usb_audio *chip, int iface, int altno) { switch (chip->usb_id) { + /* HP Elite x3 Lap Dock: skip broken altsets */ + case USB_ID(0x03f0, 0x0c56): + return hp_elite_x3_lap_dock_skip_setting_quirk(chip, iface, altno); /* quattro usb: skip altsets incompatible with device_setup */ case USB_ID(0x0763, 0x2001): return quattro_skip_setting_quirk(chip, iface, altno); @@ -2215,6 +2251,8 @@ static const struct usb_audio_quirk_flags_table quirk= _flags_table[] =3D { QUIRK_FLAG_FORCE_IFACE_RESET | QUIRK_FLAG_IFACE_DELAY), DEVICE_FLG(0x0124, 0x0c21, /* Generic USB Headphone */ QUIRK_FLAG_FORCE_IFACE_RESET | QUIRK_FLAG_IFACE_DELAY), + DEVICE_FLG(0x03f0, 0x0c56, /* HP Elite x3 Lap Dock */ + QUIRK_FLAG_FIXED_RATE), DEVICE_FLG(0x03f0, 0x654a, /* HP 320 FHD Webcam */ QUIRK_FLAG_GET_SAMPLE_RATE | QUIRK_FLAG_MIC_RES_16), DEVICE_FLG(0x041e, 0x3000, /* Creative SB Extigy */ --=20 2.55.0