From nobody Sat Oct 24 01:18:01 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jBMTC1cwYz6wqVp for ; Sat, 24 Oct 2026 01:18:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jBMTB5ttmz4KjK for ; Sat, 24 Oct 2026 01:18:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792804686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/iTpCifYnV6yROHRFPZJgckSj6Jb2cZ5RWfZPu0ozfE=; b=e1kYbsAdYnNYgrrDO2JL1EVNjfnudRqm/1bmOuqJ3lVfF7eUM51Mn993rMA+2BK7SxABHB 8KefBNO401xZBBeldWTLZlWqzwxIbrVxNF4Shet3IJE/zy9vDSvNvV6DJ5b7RCXo2IerZk TiuwwE9MxVuT58OaCQgbzCFd6gcBq5XrbJsy7fPC2Wjy++VZZfkJlyxuR3rNtvc06Hw6lL A5ZhySWh4VyFy1ejS2bPiuTORbYiX0sm9bz2zi8ES8zDWMzD9nZCNrQGmFWA6+bR3JsnwI hcLbNUqCOCZs3/zFHzDRE9qubc3KdqxNuSVX8JkiEBoqnLuWYcV99N27ZyIIuQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1792804686; b=uXMG8/NXggDSm4leB6q4XHlD37yfdJ0+tJ+N8DjaIdQ91PinrTzVVgm8Mo8n3f5ursi5xy l9Z/yar+23fUJLiupDDPQC/AnU6eMe8vSsT9PcghJX+jtxm3Tnu2xCn8q5WMPefoVyovwl 2aTXQ3o6GtRZsbTbDqZ7lsqVoN6RB1DqhkyMPs5VQAfvq+JUHjUwpXdYNzw8LNKlKqNxer HAiAqR+aBRCAn7bLjsHlUe+4sExNboMMg5QhocZ6N4d3FbrvhflqDWy/fMzE8F4RsqWIbv 7xT5bPdo52SxXtYoDBTS4MsAKL3D6RrV1wj0tR/2eGWf2wfqy0gEbiNzujmMGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792804686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/iTpCifYnV6yROHRFPZJgckSj6Jb2cZ5RWfZPu0ozfE=; b=N+zxH5s4olEbYr/T+74Og+/xO4AnPW/YL8t5KNx8KMwICRydZ0kRDANojOo+Gf4JJTSRwF aNisMgeTI8CXSmMKYJ4NYCUNeed6rftNI23LkbGn20U+iWc7CM2GSW25HkFeI6priENRIK 8lhr2GXZqbncmKr8yjW3s8fvPEGcn/n4mYThjjiFpmit0WoKYc22L1jrrgMTe1pNcCp7RE lKb62bLzjW2bhUpTYLTQsY4lt9Q7YCn+LagrBkdYIlNr6gu560U1FJ+Hvg3orN1RTO0ShZ HcFPjVyw/MwYwjNKw7WWnVIZ9lK24sJGFnauxPpSl7kEZlbyNCmTb+pnjMzMBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jBMTB5QS7zvSB for ; Sat, 24 Oct 2026 01:18:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23257 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 24 Oct 2026 01:18:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 77f8982b5ecd - stable/15 - snd_uaudio: recognize hardware sidetone as a monitor List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 77f8982b5ecd8275a7ad577feae93ba9d5bc466f Auto-Submitted: auto-generated Date: Sat, 24 Oct 2026 01:18:01 +0000 Message-Id: <6adc0749.23257.54e5a0eb@gitrepo.freebsd.org> The branch stable/15 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=77f8982b5ecd8275a7ad577feae93ba9d5bc466f commit 77f8982b5ecd8275a7ad577feae93ba9d5bc466f Author: Kyle Evans AuthorDate: 2026-08-26 14:31:57 +0000 Commit: Kyle Evans CommitDate: 2026-10-24 01:17:40 +0000 snd_uaudio: recognize hardware sidetone as a monitor The Logitech H390, for instance, has the following interface layout: ~~ 7 INPUT 34 INPUT 10 INPUT Mic (0x201) Mic (0x201) USB Stream (0x101) | | | v v | 19 FEATURE 35 FEATURE | | | | v v | 25 EXTENSION +------> 36 MIXER <---+ | | v v 13 OUTPUT 22 FEATURE USB Stream (0x101) | v 16 OUTPUT Speaker (0x301) ~~ The 7->13 path on the left is a typical microphone-in configuration, while the right side is a little more complicated. The 34 -> 35 -> 36 leg is describing a hardware sidetone control, while the other is a standard audio-out configuration. During feature unit evaluation, we need to pick up the scenario of node 35 above, which is directly wiring the microphone to the speaker. Right now we'll likely tie it to the pcm/vol levels and this unit will emit a very prompt feedback screech, but it's really shaped more like a MONITOR control. This avoids mishandling feature unit 22 because that's evaluated in one of the other cases: one of the inputs is the USB stream, so it's wired up as a PCM. One note on this headset: the presence of mixer 36 currently breaks the `vol` control, leaving only `pcm` to control the volume. Given that it has both Mic and USB input, I suspect we get a 1:1 cluster configuration for the Mic input but something more complicated for the USB input that we end up ignoring. Thus, "vol" might technically control the monitor volume but isn't wired up to the USB input cluster. I have not had a chance to confirm this, yet. PR: 291424 Reviewed by: christos (cherry picked from commit f01b594b7fa5cac4328f7137fb9cb0eef7ffd040) --- sys/dev/sound/usb/uaudio.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 41d7e1a939a3..d574c7fbc93f 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -4694,7 +4694,16 @@ uaudio_mixer_determine_class(const struct uaudio_terminal_node *iot) switch (match) { case 0: /* not connected to USB */ - if (terminal_type_output != 0) { + /* + * Some devices have a hardware sidetone that will show up here + * as connecting the microphone to the speaker. If we look at + * the output first, then we are more likely to get a PCM type + * and accidentally tie it to playback when we really should + * treat it as a monitor control. + */ + if (terminal_type_input != 0 && terminal_type_output != 0) { + return (SOUND_MIXER_MONITOR); + } else if (terminal_type_output != 0) { return (uaudio_mixer_get_feature_by_tt( terminal_type_output, SOUND_MIXER_MONITOR)); } else { @@ -4753,7 +4762,16 @@ uaudio20_mixer_determine_class(const struct uaudio_terminal_node *iot) switch (match) { case 0: /* not connected to USB */ - if (terminal_type_output != 0) { + /* + * Some devices have a hardware sidetone that will show up here + * as connecting the microphone to the speaker. If we look at + * the output first, then we are more likely to get a PCM type + * and accidentally tie it to playback when we really should + * treat it as a monitor control. + */ + if (terminal_type_input != 0 && terminal_type_output != 0) { + return (SOUND_MIXER_MONITOR); + } else if (terminal_type_output != 0) { return (uaudio_mixer_get_feature_by_tt( terminal_type_output, SOUND_MIXER_MONITOR)); } else {