From nobody Wed Aug 26 14:32:14 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 4hVRtr4bjLz6qB8w for ; Wed, 26 Aug 2026 14:32:20 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hVRtr29swz3QFt for ; Wed, 26 Aug 2026 14:32:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787754740; 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=BvwAPPuhdS7/jvTS1lvLy+3tS9uROHDgTi/q2xM4qnk=; b=jw5wtbZ/jlanYvCeWMy8bLwDb0kcb8J6fVJMx6PfGA50HqI5FrZ9MQWdbuGed2Cg5JZef8 mtmKP4jPy82dZCHALlSIrd42m+Z+DUq77OaJhR5SrsP080FBtMHda7lDsYo0JErm9KecbX NKwttOWimL6T8NAEc31oCfU0mNdOoC4CIWmpBxkAa9SG2xgPJSGv61/9j0d8UuaMZev5bL pTopj7Z64gzCaCVGOri8KnPUfrRGKdw2QJ8uFO6uBXEnzriWsFTvSUIKBVGoh5FekI93hZ LiB3dCiNyA9Deth/JTmmvo/rw7arThvDdMQKtO4jD8R6s9xrrFkqKxUUQB3CzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787754740; a=rsa-sha256; cv=none; b=BaOPWZGG1MGn65PgGtwxzv+TR91s52afo9JvDWEERs6ttfAiTJrAD8LG9PJkheeVyj3DNC Czxtokj2+jypOMrWrunwZL/coxWrCzfeinnINkTiKKQlKOfx7GDzOxvdk+L3LCsp1ofJ+k lQot2GcbXo7cpF2QTiM84IWfF39xRQr8XuRI0Su4PYM8l5OP9eg/bz3roOBbpyicg2cwpE ydPRXHqFmTsRfWtwhyAObJVYubobWMW7n5XmghtKa/ov+q9DIAaTei6ucA5+RgKbH3AF1H b0S7BVOLQceo8DnZGEXykRMjhrIl16nXsYI1QuWCfHGBQi1w53F//ELJ6ooavw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787754740; 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=BvwAPPuhdS7/jvTS1lvLy+3tS9uROHDgTi/q2xM4qnk=; b=GA7Vcwpi5E1J1wnmZ9Z1LHI7OUYoj93lx9RmjGk7Mo4+4bTvj6bMK0YM25r5i/hqZsXK5/ 1jXgKFxEXy3yzjIrYfqALAhmvmG2HC2ogAxhA37XqBkny2cBvjURnNo3Fv4+YG7E1KPsNv A3L3dAT9UNed9RuRJMdx1GuUf+obPRMyVTu0C90zhe4fugr3PtiKTwrQ6Y75nW1gQjxryy 7s2Kw0JA7uAPpoMJobTuMgyK2FYUsMdi/nQa9aw/i1Pxymj25ysaCiKhgC0TVKK5vO/6VE 0mUejCVlrsekA3hCeoMJgYx0POFXTSu8IMQgwcMv28OdKUBx+mfGL9rcxNFfpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hVRtr1GphzjM1 for ; Wed, 26 Aug 2026 14:32:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24cbd by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Aug 2026 14:32:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: f01b594b7fa5 - main - snd_uaudio: recognize hardware sidetone as a monitor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: 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/main X-Git-Reftype: branch X-Git-Commit: f01b594b7fa5cac4328f7137fb9cb0eef7ffd040 Auto-Submitted: auto-generated Date: Wed, 26 Aug 2026 14:32:14 +0000 Message-Id: <6a8ef8ee.24cbd.2ff71c83@gitrepo.freebsd.org> The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f01b594b7fa5cac4328f7137fb9cb0eef7ffd040 commit f01b594b7fa5cac4328f7137fb9cb0eef7ffd040 Author: Kyle Evans AuthorDate: 2026-08-26 14:31:57 +0000 Commit: Kyle Evans CommitDate: 2026-08-26 14:31:57 +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 Differential Revision: https://reviews.freebsd.org/D58779 --- 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 f12fc1ede541..2e0f670ddc28 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -4688,7 +4688,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 { @@ -4747,7 +4756,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 {