Seldom on USB replug: default microphone change does not work

I use this software/hardware:

  • the GNU/Linux distribution Fedora Workstation 36 (upgraded from 32 to 34 to 36)
    $ rpm -qa | grep -i wire | sort
    pipewire0.2-libs-0.2.7-7.fc36.x86_64
    pipewire-0.3.52-2.fc36.x86_64
    pipewire-alsa-0.3.52-2.fc36.x86_64
    pipewire-gstreamer-0.3.52-2.fc36.x86_64
    pipewire-jack-audio-connection-kit-0.3.52-2.fc36.x86_64
    pipewire-libs-0.3.52-2.fc36.x86_64
    pipewire-pulseaudio-0.3.52-2.fc36.x86_64
    pipewire-utils-0.3.52-2.fc36.x86_64
    wireless-regdb-2021.08.28-2.fc36.noarch
    wireplumber-0.4.10-1.fc36.x86_64
    wireplumber-libs-0.4.10-1.fc36.x86_64
  • a computer with 3.5 mm audio jack ports (out- and input); nothing connected to these ports
  • “Dell AC511M” USB soundbar with 3.5 mm audio jack ports (out- and input); nothing connected to these ports; soundbar is always connected by USB cable to computer
  • USB webcam; has built-in microphone; always connected to computer
  • USB headset (audio out- and input); dis-/connected from/to computer on the fly as required

Situation:

  • “Dell AC511M” is listed in GNOME’s audio settings as audio output and input device.
  • Headset might or might not be connected when the computer starts.

The problem:

  • Most of the times the webcam or headset is remembered as default microphone, i.e. default microphone switches between webcam and headset, and USB headset re-plugging is no problem. But sometimes (seldom!) this setting is lost. Then “Dell AC511M” is set as default microphone, which does not capture anything, because no microphone is connected to it.
  • I encountered it on a different computer with a fresh installation of Fedora Workstation 34, but did not create a bug report or ask for help, because I did not had time for it and re-setting default device was an quick-and-easy fix. Today it happened again. I have no reliable way to reproduce the problem, just replugging again and again.

Questions:

  1. How do I forbid the soundbar to be set as default microphone? I will never use it as microphone. I use it only as loudspeaker.
    Maybe it is possible to recognize that nothing is plugged into the soundbar’s jack port in order to exclude it from the list of microphones. I can test with the device, but need pointers.

  2. Can I force the order of the microphone to be:

  • headset if connected
  • webcam if connected
  • any working microphone
    ? If so, how?

This seems to be in the realm of the media server PipeWire. I can test and provide logs, but need pointers what to do (which command to run: pw-mon, pw-dump, …? options?, how often, in which situation?).
According to a quick search this upstream issue seems to be about disabling a sound device (I have not tested or read it): Unable to disable device nodes (#2363) · Issues · PipeWire / pipewire · GitLab

Thank you for your help. I am not in a hurry.

created issue upstream: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2541