Automating sound activation for droidcam

A problem regarding sound:
Using this command will correctly make the sound work:

$ pacmd load-module module-alsa-source device=$HW

But whenever I disconnect and reconnect the app after a few days I will need to use the command to make the sound work correctly. In other words, every time I need to use this command.
Is there any permanent solution for it?

You can edit ~/.config/pulse/ and add the line:

load-module module-alsa-source device=$HW

Also, look at the global version, which is /etc/pulse/ on my system, to see what else could go in this file.
More on PulseAudio/Examples - ArchWiki


It didn’t solve the problem unfortunately and still, I need to use the command every time.