From nobody Thu Apr 18 12:41:00 2024 X-Original-To: gnome@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 4VKy7M6Dygz5Gn52 for ; Thu, 18 Apr 2024 12:41:03 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VKy7M5BHNz45KZ for ; Thu, 18 Apr 2024 12:41:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713444063; a=rsa-sha256; cv=none; b=SdFwS6Ftgi/KuSG6FYsD5dqJA0GEpbSsntu1XUChPS9i9uQ9ZlTNup9Upju1sjN9MGr2rO utfqeMdRWYNjujqj+ghbyyT8Ybp8k/Zsp93XEk3JX2KyQ3yqvvn7FLFgsn1M8T0By3HFTU 17c2X5YHi83GI5k6o8+AFbTx6/YBQJUstLSnwM1STRzXFRT5Rax4Edp2iUb9BobJJ8Fnks 4HHvu1ZCe+TNUmvvoo0266cSlXPDgHFxlWJPITE4HMJOc2Mhz+qbelHUs3fGwBOn1vKoUa PPPtHBPlYV11gZtCgh9HPV4rEvDqqnASpgyGQTdnfAFv21GRXI98NuFFeG/ZBg== 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=1713444063; 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: in-reply-to:in-reply-to:references:references; bh=5IFi8pXOfRNQcsFbXl/FkKdtKrjWNYeCzR6LuJOB3f4=; b=s8Wx7pwen5o403OB0R0/dbVJPfHpP0hH8s95bHjFvH4PSVW7zYWHO1izdMtuM2zXxNky2s F3uJ5OsumO7sxYc19lbWHxyD+6Kt+im7o705TBwOKa7cgyLK63vxVgZzfOf+yizAYSy+5F fb+jz4i9L+bHnsIOO6cuiZ6Wq/MFUXOEA7yAQVO9TZ3yTW/3F0WTNn+kdxctBDupGRxrqR bqlFHJJVvpW5d7EU+z02eJgHf7gz4hPFLQeL+I1u644idmYYY4dmpsIaIh6FOt4RAveodO gEH2DzmscBquaK6pLTB+aWmEGzv5p4ViDJfXOaS83zenzaKCw81Z9KXFvPHDpA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VKy7M4n84z18QQ for ; Thu, 18 Apr 2024 12:41:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 43ICf3x3081962 for ; Thu, 18 Apr 2024 12:41:03 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 43ICf3Zh081955 for gnome@FreeBSD.org; Thu, 18 Apr 2024 12:41:03 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: gnome@FreeBSD.org Subject: [Bug 194727] uaudio device gets disconnected, and hangs usb until everything using /dev/mixer* is closed Date: Thu, 18 Apr 2024 12:41:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: christos@freebsd.org X-Bugzilla-Flags: mfc-stable14? mfc-stable13? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: GNOME for FreeBSD -- porting and maintaining List-Archive: https://lists.freebsd.org/archives/freebsd-gnome List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-gnome@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D194727 --- Comment #99 from commit-hook@FreeBSD.org --- A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3Dd692c314d29a310efe875e9be05b0cceb= e6b241d commit d692c314d29a310efe875e9be05b0ccebe6b241d Author: Christos Margiolis AuthorDate: 2024-04-11 18:06:50 +0000 Commit: Christos Margiolis CommitDate: 2024-04-18 12:39:31 +0000 sound: Implement asynchronous device detach Hot-unplugging a sound device, such as a USB sound card, whilst being consumed by an application, results in an infinite loop until either the application closes the device's file descriptor, or the channel automatically times out after hw.snd.timeout seconds. In the case of a detach however, the timeout approach is still not ideal, since we want all resources to be released immediatelly, without waiting for N seconds until we can use the bus again. The timeout mechanism works by calling chn_sleep() in chn_read() and chn_write() (see pcm/channel.c) in order to send the thread to sleep, using cv_timedwait_sig(). Since chn_sleep() sets the CHN_F_SLEEPING flag while waiting for cv_timedwait_sig() to return, we can test this flag in pcm_unregister() (called during detach) and wakeup the sleeping thread(s) to immediately kill the channel(s) being consumed. Sponsored by: The FreeBSD Foundation MFC after: 2 months PR: 194727 Reviewed by: dev_submerge.ch, bapt, markj Differential Revision: https://reviews.freebsd.org/D43545 (cherry picked from commit 44e128fe9d92c1a544b801cb56e907a66ef34691) share/man/man4/snd_uaudio.4 | 11 +---------- sys/dev/sound/pcm/dsp.c | 2 +- sys/dev/sound/pcm/mixer.c | 11 ----------- sys/dev/sound/pcm/sound.c | 24 ++++++++++-------------- sys/dev/sound/usb/uaudio.c | 13 +++---------- 5 files changed, 15 insertions(+), 46 deletions(-) --=20 You are receiving this mail because: You are on the CC list for the bug.=