36

When adding a USB device to my system (I deliberately run no modern stack for device detection), Pulseaudio can't pickup it without restart (pulseaudio -k; pulseaudio --start).

Is there an option for, say, pactl, which will make pulseaudio to "detect" and start using newly plugged in devices?

kagali-san
  • 1,734

3 Answers3

46

Actually, yes, there is a way to do so without restarting Pulseaudio:

pacmd unload-module module-udev-detect && pacmd load-module module-udev-detect

I use it everytime I plug in my external-soundcard or after waking up my laptop. Pulseaudio cleans up his room and bring back my Spotify music on my external soundcard automatically (as it is my default soundcard).

You will need pacmd to do so; it is included in the pulseaudio-utils package on Ubuntu.

Signez
  • 575
19

Running

pulseaudio -k && pactl load-module module-detect

worked for me. This will restart pulseaudio and therefore forget existing devices. Afterwards it will rescan for devices. The difference here is not to use udev, maybe there is an issue with the setup that prevents udev support.

This was necessary for me, as I'm using external devices at my laptop, but sometimes internal speakers.

For some reason you might need to add a sleep between both commands.

Daniel
  • 291
5

You're not restarting PulseAudio correctly. The correct way to restart PulseAudio in Ubuntu 20 is with this command:

systemctl --user restart pulseaudio

Restarting PulseAudio will detect new audio devices.

kas
  • 354