[Tutorial] How to Stream Audio From your PC to any Device

Difficulty: ★☆☆☆☆

Introduction

SnapCast is client-server based software. That means one part or device works as a server, another device works as client.

  • Server: The device which will broadcast the audio. In this tutorial, that will be the Manjaro system.
  • Client: The devices who will receive the audio and play it. In this tutorial, we’ll use an Android phone…

Step 1: Installing the software

SnapCast free and Open Source and can be found here.

  1. Enable the AUR if not already done so…
  2. Open pamac aka Add or Remove Software.
  3. Search for snapcast
  4. Click Build
  5. Click Apply

Alternatively, you can also run these command to install:

git clone https://aur.archlinux.org/snapcast
cd snapcast
makepkg -si

Step 2: Configuring the server

After the installation process ends, you will find:

  • two executables in your /usr/bin/ directory. snapserver and snapclient.
  • a config file in /etc/snapserver.conf.
    To keep the complexity of this tutorial low, we will leave as it is. For more info RTFM.

Step 3: Running the server

Before running the server, you must specify which interface you are using. Snapcast can be used with a number of different audio players and servers, and so it can be integrated into your favorite audio-player solution. The only requirement is that the player’s audio can be redirected into the Snapserver’s fifo located at /tmp/snapfifo.

The goal is to build the following chain:

audio player software → snapfifo → snapserver → network → snapclient → alsa

Since PulseAudio is the audio source in this case. So it needs to be configured. In this case, the chain will be like this:

Any audio source → PulseAudio → PulseAudio pipe sink → snapfifo → snapserver → network → snapclient → Alsa

To do so, just run these two lines of code:

pacmd load-module module-pipe-sink file=/tmp/snapfifo sink_name=Snapcast format=s16le rate=48000

and

pacmd update-sink-proplist Snapcast device.description=Snapcast

Hope that most of the distros uses PulseAudio by default. If not, then check out this link for other options available.

That all. Now you can start the server. Just run in terminal:

snapserver

And leave the terminal opened.

Step 4: Running the Client

To receive the streamed audio in the client, you will need to install the software snapclient on the device you want to play the output. The installation process is the same as discussed above. As we’re using an Android device, we’ll use Snapcast app from Google Play Store.

After opening the app, you’ll see something like this:

If nothing appears, follow these steps:

  1. In the top right corner you will find the setting icon.
  2. Tap on that,
  3. Click on scan for server
  4. It will automatically detect the server.
  5. Tap OK

Alternatively, manually input the host, stream port and control port and tap OK. Now just tap on the play button in the top right corner. One last thing, both the server and clients have to be on the same network. And you are done…

Step 6: Enjoy

:+1:

2 Likes