We can use pluse audio to play sound from remote machine over network.
For example, we have a remote server. And we want to play the sound on local machine while playing media file on the server. Here is the solution.
start pulseaudio on machine with audio card
Win10 T470 laptop with sound speaker.
Get pulseaudio binary for windows from official wiki, they provide the pulseaudio mingw version 1.1.
here is another place for building pulseaudio with mingw, binary pulseaudio mingw version 13.0 is provided.
use it with your own consideration.
add configuration in etc\default.pa
to enable sound over tcp (acting as server)
load-module module-native-protocol-tcp port=4713 auth-ip-acl=0.0.0.0/0
the acl could be more accurate like 172.17.0.0/12 in CIDR format
here are some other items may be impacted, use them only when above change is NOT enough for working
in etc\default.pa
load-module module-waveout sink_name=output source_name=input record=0
set-default-sink output
in etc\daemon.conf
exit-idle-time = -1
and now we can start pulseaudio by typing bin\pulseaudio -vvvv
in cmd or powershell shell
configure client mode on working machine
usually this is the machine where sound card is NOT available. (say virtual machine or Rasperberry PI)
1 | $ sudo apt install pulseaudio mpg123 -y |
now we can use mpg123 abc.mp3
to play mp3 file on working machine and listen the voice on our target win10 machine.
debug information
if we run pulseaudio with parameters -vvvv, we can see sample output on server side like this:
1 | I: [(null)] pulsecore/client.c: Created 4 "Native client (TCP/IP client from 10.10.10.1:57842)" |
reference
- Download the latest pulse audio release from http://www.freedesktop.org/wiki/Software/PulseAudio/Ports/Windows/Support/ (latest is v1.1 at the time of writing).
- unpack to somewhere you want. example: c:\pulse\
- open c:\pulse\etc\default.pa
- make sure you have something similar to:
load-module module-native-protocol-tcp listen=0.0.0.0 auth-anonymous=1
set-default-sink output - On your linux machine(s), open /etc/pulse/client.conf (you could possibly do the same with ~/.pulse/client.conf), make sure default-server is uncommented and set to the ip address of your windows machine (one you want to receive audio on)
- restart pulseaudio on the linux machine(s). For ubuntu: pulseaudio -k, and for other distros, sudo service pulseaudio restart.
- On your windows machine, launch pulseaudio.exe. This should open a simple terminal with a few warnings (nothing to worry about).
- On your Linux machine(s), launch something that plays sound.