uaudio: pulseaudio locks up system

Stefan Ehmann shoesoft at gmx.net
Sun Feb 14 13:17:27 UTC 2021


On Sunday, February 14, 2021 11:51:38 AM CET Hans Petter Selasky wrote:
> On 2/14/21 9:55 AM, Stefan Ehmann wrote:
> > FreeBSD locks up when my USB audio interface is connected and accessed via
> > pulseudio.
> >
> > The interface is connected via USB hub.
> > Symptoms: First USB mouse (on same hub) stops working. System becomes
> > increasingly unresponsive until it totally locks up.
> >
> > I can reproduce the problem by simply running pactl list
> >
> > If I reboot immediately, shutdown also hangs. Kernel debugger shows this
> > suspicious trace (transcribed by hand):
> >
> > __mtx_lock_sleep()
> > uaudio_chan_play_callback()
> > usbd_callback_wrapper()
> > usb_command_wrapper()
> > usb_callback_proc()
> > usb_process()
>
> Hi,
>
> It might be a lock order reversal or something like that, although
> witness should warn about that!
>
> Can you have a look in /var/log/messages* and see if you can find the
> complete message there?

Rebuilt kernel with debug options. I see this LOR when running pactl list:

lock order reversal:
 1st 0xfffff80005cc3840 pcm7:play:dsp7.p0 (pcm play channel, sleep mutex) @ /
usr/src/sys/dev/usb/usb_transfer.c:2342
 2nd 0xfffff80005cc3860 pcm7:record:dsp7.r0 (pcm record channel, sleep mutex)
@ /usr/src/sys/dev/sound/usb/uaudio.c:2317
lock order pcm record channel -> pcm play channel established at:
#0 0xffffffff80714e91 at witness_checkorder+0x461
#1 0xffffffff80684878 at __mtx_lock_flags+0x98
#2 0xffffffff804dc721 at dsp_mmap_single+0x151
#3 0xffffffff8096b995 at vm_mmap_cdev+0x65
#4 0xffffffff805500e3 at devfs_mmap_f+0x143
#5 0xffffffff80969fb4 at kern_mmap_req+0x594
#6 0xffffffff80969996 at sys_mmap+0x46
#7 0xffffffff80a0ecce at amd64_syscall+0x12e
#8 0xffffffff809e4a7e at fast_syscall_common+0xf8
lock order pcm play channel -> pcm record channel attempted at:
#0 0xffffffff807157b2 at witness_checkorder+0xd82
#1 0xffffffff80684878 at __mtx_lock_flags+0x98
#2 0xffffffff844ad2eb at uaudio_chan_play_callback+0xeb
#3 0xffffffff8053586c at usbd_callback_wrapper+0x7ec
#4 0xffffffff80536bbe at usb_command_wrapper+0x7e
#5 0xffffffff805359ee at usb_callback_proc+0x8e
#6 0xffffffff80530883 at usb_process+0xf3
#7 0xffffffff806628a0 at fork_exit+0x80
#8 0xffffffff809e51de at fork_trampoline+0xe
~

> Secondly, pulseaudio has several patches for FreeBSD which were just
> recently upstreamed. Can you check if these patches are present:
>
> https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277

I'm using up-to-date ports version which seems to include the changes (at
least after cursory glance.)




More information about the freebsd-multimedia mailing list