Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Apr 2024 12:41:00 +0000
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
Message-ID:  <bug-194727-6497-KZ6lLyFOfa@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-194727-6497@https.bugs.freebsd.org/bugzilla/>
References:  <bug-194727-6497@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <christos@FreeBSD.org>
AuthorDate: 2024-04-11 18:06:50 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
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.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-194727-6497-KZ6lLyFOfa>