Thomas Jepp

Streaming audio from Linux to Windows

Background

Having multiple PCs all needing to play audio is a pain - especially when you use a headset.

This is how I stream audio from my NUC - running Linux - to my Windows desktop - where the headset is plugged in.

Options

There are a few options for getting audio from Linux to Windows:

Given these choices, I ended up using PulseAudio.

PulseAudio on Linux

Setting up the Linux side of this is really easy:

  1. Open /etc/pulse/client.conf and add:
    default-server = 192.168.1.1
    Change 192.168.1.1 to the IP of your Windows machine.
  2. Run:
    killall pulseaudio

PulseAudio on Windows

PulseAudio isn't well maintained on Windows - the binaries linked from the official site are very old - for PulseAudio 1.1.

However, I found a much newer set of binaries from the X2Go project: http://code.x2go.org/releases/binary-win32/3rd-party/pulse/.

To set up PulseAudio 5.0 on Windows, do the following:

  1. Download pulseaudio-5.0-rev18.zip from http://code.x2go.org/releases/binary-win32/3rd-party/pulse/pulseaudio-5.0-rev18.zip
  2. Extract it and copy the pulse folder to C:\pulse
  3. Create a config.pa file in that folder with these contents:
    load-module module-native-protocol-tcp port=4713 auth-ip-acl=127.0.0.1;192.168.1.0/24
    load-module module-esound-protocol-tcp port=4714 auth-ip-acl=127.0.0.1;192.168.1.0/24
    load-module module-waveout
    Replace 192.168.1.0/24 with your local subnet.
  4. Test this setup by running:
    c:\pulse\pulseaudio.exe -F config.pa
    You should now be able to get Linux sound playing on your Windows PC.
  5. For a permanent setup, we need to create a Windows service rather than running PulseAudio in a command prompt. I use NSSM to run arbitrary programs as services. Download the latest version of NSSM.
  6. Extract it and copy nssm.exe from the win32 folder to c:\pulse.
  7. Run:
    c:\pulse\nssm.exe install PulseAudio
  8. Fill in the following details on the Application tab:
    • Path: c:\pulse\pulseaudio.exe
    • Startup directory: c:\pulse
    • Arguments: -F c:\pulse\config.pa
    On the Details tab, fill in:
    • Display name: PulseAudio
    Now click Install service.
  9. Finally, start the newly installed service - either through the Services item in Administrative Tools, or by running net start PulseAudio

Comments

There are no comments on this item.

All comments are reviewed and have to be approved before they are shown on the site. Your comment may be rejected if it is off-topic, abusive or spam.

Your details

These fields are optional. Your name and website will be shown with your comment if provided. Your email address will not be shared with anyone.

Your comment

Enter your comment here. Any HTML, BBCode or Markdown formatting will be ignored.