How can I force the rediscovery of PulseAudio virtual sound devices?
Solution 1:
- On the "Sink" PC (On whose speaker you wanna play the sound) open the PulseAudio command shell by going into Terminal and issuing the following command.
$ pacmd
You will see a Python-like shell with the following welcome message.Welcome to PulseAudio! Use "help" for usage information. >>>
- List the devices that can play the sound on the PC by the command in the PulseAudio shell.
>>> list-sinks
Now you'll see a detailed list of all the sound sinks. - Just note down the complete name of the sink of your choice. It would appear as an attribute of the sound card. For example in my case it is:
1 sink(s) available. index: 0 name: <alsa_output.pci-0000_00_1b.0.analog-stereo>
...
The string of my interest is just "alsa_output.pci-0000_00_1b.0.analog-stereo"
- Now Go onto the Source PC (i.e. origin of the audio multimedia streams), open up the terminal and issue the following command
$ pactl load-module module-tunnel-sink "server=192.168.1.105 sink=alsa_output.pci-0000_00_1b.0.analog-stereo sink_name=home_theater"
Here 192.168.1.105 is the IP address of the sink PC, "alsa_output.pci-0000_00_1b.0.analog-stereo" is the string you just copied from sink's terminal and "home_theater" is just a fancy name to call this virtual sound output device on your computer.
- Finally select this virtual sound device by :
$ pacmd set-default-sink home_theater
Wallah !!
Solution 2:
A simple sudo service avahi-daemon restart
does the trick, even though avahi-browse
sees the devices before that avahi restart. Thanks to Takkat for pointing me in the right direction.