2021-05-11 21:13:05 +02:00
|
|
|
# stream.sh
|
|
|
|
|
|
|
|
A quick-and-dirty solution for streaming audio over TCP/IP between
|
2021-06-22 20:32:41 +02:00
|
|
|
Linux computers with ALSA (and pulseaudio).
|
2021-05-11 21:13:05 +02:00
|
|
|
|
|
|
|
# usage
|
|
|
|
|
|
|
|
The architecture consists of a server (Computer With Speakers) and
|
|
|
|
a client (Computer With Crappier Speakers But We Have Media On It).
|
|
|
|
The script is self-contained, so you can distribute the same version
|
|
|
|
to client and server computers.
|
|
|
|
|
|
|
|
On the server, run
|
|
|
|
|
|
|
|
```
|
|
|
|
./stream.sh server 1337
|
|
|
|
```
|
|
|
|
|
|
|
|
... and then, on the client, run
|
|
|
|
|
|
|
|
```
|
|
|
|
./stream.sh set
|
|
|
|
./stream.sh client 10.21.37.1 1337
|
|
|
|
```
|
|
|
|
|
|
|
|
This is enough to get you started, you should start hearing audio
|
|
|
|
from your local applications on the remote computer. By default,
|
|
|
|
stream.sh uses WAVE in a RIFF container - this provides a high
|
|
|
|
quality, low-latency solution. In case your network isn't fast
|
|
|
|
enough to support raw audio data, you can specify a codec and
|
|
|
|
bitrate:
|
|
|
|
|
|
|
|
```
|
|
|
|
./stream.sh client 10.21.37.1 1337 libopus 64
|
|
|
|
```
|
|
|
|
|
2021-06-22 20:32:41 +02:00
|
|
|
If you're insane enough to use pulseaudio on a daily basis,
|
|
|
|
you can use `paprefs` to enable RTP Multicast (don't forget
|
|
|
|
to check the "fixed port" checkbox) - it should work out of
|
|
|
|
the box.
|
|
|
|
|
2021-05-11 21:13:05 +02:00
|
|
|
# debugging
|
|
|
|
|
|
|
|
stream.sh has a built-in benchmarking functionality that tries to
|
|
|
|
guess the correct timings for your hardware. If this is inaccurate
|
|
|
|
and you hear pops, or the audio drops off completely every ~60s,
|
|
|
|
you may want to run
|
|
|
|
|
|
|
|
```
|
|
|
|
./stream.sh benchmark ffmpeg
|
|
|
|
```
|
|
|
|
|
|
|
|
and modify the delay variable in the `USER-CONFIGURABLE VARIABLES`
|
|
|
|
section of stream.sh
|
|
|
|
|
|
|
|
|
|
|
|
# building
|
|
|
|
|
|
|
|
```
|
|
|
|
./pack.sh > stream.sh
|
|
|
|
```
|