From nobody Tue Sep 15 12:13:02 2026 X-Original-To: dev-commits-src-main@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 4hkgrv1wdXz6s6pZ for ; Tue, 15 Sep 2026 12:13:03 +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 4hkgrt4HvJz3Cm0 for ; Tue, 15 Sep 2026 12:13:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789474382; 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=gQfGb4tgWzX8fluTVFXKV9t3hyLu7yKARoGhI7adMC8=; b=KQ5S49PrJqjPVhp/lJmlvgHpIGAhMQ0re95dixx5tLti4ysP/AZauF9tiUtpJMDXYE/OM2 CLYmRGgVOjz89PlHURawmfPZAHbQI4TbHBLEQdoNAUsB/7Ti/g2eJuH9PL/n+gcbeaI4AP W1wKusoklE6empmU+7uA4wGnZONJs3vXonhTcUygUF32M5U9wh8SO0RkmGNJynnm3ngb6q Oy5ywyCqTuzUa+o94jbwyCX9+zyYHPEOhT4xEK73jIAhkMyyTfNUZKR1YPaX1UE4ToyBp3 9taDqrfASoRwUXbQpR7EpxBNRoqEsgR8mFDjpeaV6UlJYQZ+Am56rpqPYWoCEg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789474383; b=NBvwJ5j3ba3NzxgJjGnBSwmXjujpvFTKDM+b0iJq2gbadWMDwEv3la3g8taMjWD7AsehdQ RUsGv6HPiU+QKGWRgr1tuRgSPolvSqYQ2gpqOWKb2TKvw4w5f1tLNdIMMO4fnwplWFPc+a fINWTVIRqGLTnlI+oTOhc7M9kP2t3DAAVqG19eLj0Lq0q8INxjCpqkdqLqOEWWW3ddlUn/ y3RwHy8dvbYadBnpi2bE3HbYNTmmniaidKR2zLYKUjL5omrerBA2oOE88VImknllljUbtm HzMsrl9NY+9SIP5Q4ijGozRHCGgoSzryujsOCXCSzywX3KruNXhQ3mwiTDjlvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789474383; 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=gQfGb4tgWzX8fluTVFXKV9t3hyLu7yKARoGhI7adMC8=; b=Zg/L3vfOphvpqaeE4IqKu7vN1cPAkIOVEuw44pH8dI3h46wLoKffnN/vsCexnN/Tfbuzh0 1KghYsP6SY/Rj1zqjDujjF54bmTybB5pD6hT34pmwD4bOzY5wusvsh1xkVyd4bMK2cUMJ0 dGExy+tZT1rQaNidFoLKMtgqlZCOolzGFcOgWuVe2nsUU+PtpZdhGgo3vIGnEEQGY4V3hi ZcL1s8J57Lv8qSnhUOUjI4HB7/+89HuOFwQ9co6iWM/Hmu6xOzlpTexaWvjqW9Z+QMN6YZ 5HgcC+NNiCSUQlrjOJ4H4HjDZ5QoVXqpS0DbcTbxr8Zum8Nj6zQJEyedsG+isQ== 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 4hkgrt1vFhz10k6 for ; Tue, 15 Sep 2026 12:13:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1e7ee by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 15 Sep 2026 12:13:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 694923501f56 - main - snd_uaudio: Read the UAC2 sample rate back after setting it List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 694923501f56a5d4519f548ee06db603f9486bc7 Auto-Submitted: auto-generated Date: Tue, 15 Sep 2026 12:13:02 +0000 Message-Id: <6aa9364e.1e7ee.415bb7bd@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=694923501f56a5d4519f548ee06db603f9486bc7 commit 694923501f56a5d4519f548ee06db603f9486bc7 Author: Christos Margiolis AuthorDate: 2026-09-15 12:12:43 +0000 Commit: Christos Margiolis CommitDate: 2026-09-15 12:12:43 +0000 snd_uaudio: Read the UAC2 sample rate back after setting it Some devices only apply a new sample rate once it has been read back, and produce no sound at all otherwise. PR: 294803 Reported by: tatsuki_makino@hotmail.com Tested by: tatsuki_makino@hotmail.com MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D59616 --- sys/dev/sound/usb/uaudio.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index de2b9c467835..491827c87f84 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -5446,6 +5446,7 @@ uaudio20_set_speed(struct usb_device *udev, uint8_t iface_no, uint8_t clockid, uint32_t speed) { struct usb_device_request req; + usb_error_t err; uDWord data; DPRINTFN(6, "ifaceno=%d clockid=%d speed=%u\n", @@ -5458,7 +5459,27 @@ uaudio20_set_speed(struct usb_device *udev, uint8_t iface_no, USETW(req.wLength, sizeof(data)); USETDW(data, speed); - return (usbd_do_request(udev, NULL, &req, data)); + err = usbd_do_request(udev, NULL, &req, data); + if (err != USB_ERR_NORMAL_COMPLETION) + return (err); + + /* + * Read the rate back, because some devices only apply it once it has + * been read, and produce no sound otherwise. + */ + req.bmRequestType = UT_READ_CLASS_INTERFACE; + USETDW(data, 0); + + err = usbd_do_request(udev, NULL, &req, data); + if (err != USB_ERR_NORMAL_COMPLETION) { + DPRINTF("could not read sample rate back: %s\n", + usbd_errstr(err)); + } else if (UGETDW(data) != speed) { + DPRINTF("sample rate is %u Hz, expected %u Hz\n", + UGETDW(data), speed); + } + + return (USB_ERR_NORMAL_COMPLETION); } static int