mirror of
https://github.com/badaix/snapcast.git
synced 2025-04-30 10:47:12 +02:00
Update configuration.md
This commit is contained in:
parent
894d457c80
commit
a1e6e47b70
1 changed files with 43 additions and 20 deletions
|
@ -4,13 +4,16 @@
|
||||||
|
|
||||||
source URI of the PCM input stream, can be configured multiple times
|
source URI of the PCM input stream, can be configured multiple times
|
||||||
The following notation is used in this paragraph:
|
The following notation is used in this paragraph:
|
||||||
|
|
||||||
- `<angle brackets>`: the whole expression must be replaced with your specific setting
|
- `<angle brackets>`: the whole expression must be replaced with your specific setting
|
||||||
- `[square brackets]`: the whole expression is optional and can be left out
|
- `[square brackets]`: the whole expression is optional and can be left out
|
||||||
- `[key=value]`: if you leave this option out, "value" will be the default for "key"
|
- `[key=value]`: if you leave this option out, "value" will be the default for "key"
|
||||||
|
|
||||||
Format:
|
Format:
|
||||||
|
|
||||||
TYPE://host/path?name=<name>[&codec=<codec>][&sampleformat=<sampleformat>][&chunk_ms=<chunk ms>]
|
```sh
|
||||||
|
TYPE://host/path?name=<name>[&codec=<codec>][&sampleformat=<sampleformat>][&chunk_ms=<chunk ms>]
|
||||||
|
```
|
||||||
|
|
||||||
parameters have the form `key=value`, they are concatenated with an `&` character
|
parameters have the form `key=value`, they are concatenated with an `&` character
|
||||||
parameter `name` is mandatory for all sources, while `codec`, `sampleformat` and `chunk_ms` are optional
|
parameter `name` is mandatory for all sources, while `codec`, `sampleformat` and `chunk_ms` are optional
|
||||||
|
@ -21,65 +24,85 @@ Available types are:
|
||||||
|
|
||||||
### pipe
|
### pipe
|
||||||
|
|
||||||
pipe:///<path/to/pipe>?name=<name>[&mode=create][&dryout_ms=2000], mode can be "create" or "read"
|
```sh
|
||||||
|
pipe:///<path/to/pipe>?name=<name>[&mode=create][&dryout_ms=2000], mode can be "create" or "read"
|
||||||
|
```
|
||||||
|
|
||||||
### librespot
|
### librespot
|
||||||
|
|
||||||
librespot:///<path/to/librespot>?name=<name>[&dryout_ms=2000][&username=<my username>&password=<my password>][&devicename=Snapcast][&bitrate=320][&wd_timeout=7800][&volume=100][&onevent=""][&nomalize=false][&autoplay=false]
|
```sh
|
||||||
|
librespot:///<path/to/librespot>?name=<name>[&dryout_ms=2000][&username=<my username>&password=<my password>][&devicename=Snapcast][&bitrate=320][&wd_timeout=7800][&volume=100][&onevent=""][&normalize=false][&autoplay=false]
|
||||||
|
```
|
||||||
|
|
||||||
note that you need to have the librespot binary on your machine
|
note that you need to have the librespot binary on your machine
|
||||||
sampleformat will be set to "44100:16:2"
|
sampleformat will be set to `44100:16:2`
|
||||||
|
|
||||||
### file
|
### file
|
||||||
|
|
||||||
file:///<path/to/PCM/file>?name=<name>
|
```sh
|
||||||
|
file:///<path/to/PCM/file>?name=<name>
|
||||||
|
```
|
||||||
|
|
||||||
### process
|
### process
|
||||||
|
|
||||||
process:///<path/to/process>?name=<name>[&dryout_ms=2000][&wd_timeout=0][&log_stderr=false][¶ms=<process arguments>]
|
```sh
|
||||||
|
process:///<path/to/process>?name=<name>[&dryout_ms=2000][&wd_timeout=0][&log_stderr=false][¶ms=<process arguments>]
|
||||||
|
```
|
||||||
|
|
||||||
### airplay
|
### airplay
|
||||||
|
|
||||||
airplay:///<path/to/airplay>?name=<name>[&dryout_ms=2000][&port=5000]
|
```sh
|
||||||
|
airplay:///<path/to/airplay>?name=<name>[&dryout_ms=2000][&port=5000]
|
||||||
|
```
|
||||||
|
|
||||||
note that you need to have the airplay binary on your machine
|
note that you need to have the airplay binary on your machine
|
||||||
sampleformat will be set to "44100:16:2"
|
sampleformat will be set to `44100:16:2`
|
||||||
|
|
||||||
### tcp server
|
### tcp server
|
||||||
|
|
||||||
tcp://<listen IP, e.g. 127.0.0.1>:<port>?name=<name>[&mode=server]
|
```sh
|
||||||
|
tcp://<listen IP, e.g. 127.0.0.1>:<port>?name=<name>[&mode=server]
|
||||||
|
```
|
||||||
|
|
||||||
default for `port` (if omitted) is 4953, default for `mode` is `server`
|
default for `port` (if omitted) is 4953, default for `mode` is `server`
|
||||||
|
|
||||||
mopidy.conf (running GStreamer in [client mode](https://www.freedesktop.org/software/gstreamer-sdk/data/docs/latest/gst-plugins-base-plugins-0.10/gst-plugins-base-plugins-tcpclientsink.html))
|
mopidy.conf (running GStreamer in [client mode](https://www.freedesktop.org/software/gstreamer-sdk/data/docs/latest/gst-plugins-base-plugins-0.10/gst-plugins-base-plugins-tcpclientsink.html))
|
||||||
|
|
||||||
[audio]
|
```sh
|
||||||
output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! tcpclientsink
|
[audio]
|
||||||
|
output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! tcpclientsink
|
||||||
|
```
|
||||||
|
|
||||||
### tcp client
|
### tcp client
|
||||||
|
|
||||||
tcp://<server IP, e.g. 127.0.0.1>:<port>?name=<name>&mode=client
|
```sh
|
||||||
|
tcp://<server IP, e.g. 127.0.0.1>:<port>?name=<name>&mode=client
|
||||||
|
```
|
||||||
|
|
||||||
mopidy.conf (running GStreamer in [server mode](https://www.freedesktop.org/software/gstreamer-sdk/data/docs/latest/gst-plugins-base-plugins-0.10/gst-plugins-base-plugins-tcpserversink.html))
|
mopidy.conf (running GStreamer in [server mode](https://www.freedesktop.org/software/gstreamer-sdk/data/docs/latest/gst-plugins-base-plugins-0.10/gst-plugins-base-plugins-tcpserversink.html))
|
||||||
|
|
||||||
[audio]
|
```sh
|
||||||
output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! tcpserversink
|
[audio]
|
||||||
|
output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! tcpserversink
|
||||||
|
```
|
||||||
|
|
||||||
### alsa
|
### alsa
|
||||||
|
|
||||||
alsa://?name=<name>&device=<alsa device>
|
```sh
|
||||||
|
alsa://?name=<name>&device=<alsa device>
|
||||||
|
```
|
||||||
|
|
||||||
Snapcast v0.21 can capture audio from alsa, and to capture the output of a player, an alsa loopback device can be used:
|
Snapcast v0.21 can capture audio from alsa, and to capture the output of a player, an alsa loopback device can be used:
|
||||||
|
|
||||||
1. setup the alsa loopback device by loading the kernel module:
|
1. setup the alsa loopback device by loading the kernel module:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
sudo modprobe snd-aloop
|
sudo modprobe snd-aloop
|
||||||
```
|
```
|
||||||
|
|
||||||
2. the loopback device should show up in `aplay -l`
|
2. the loopback device should show up in `aplay -l`
|
||||||
|
|
||||||
```
|
```sh
|
||||||
aplay -l
|
aplay -l
|
||||||
**** List of PLAYBACK Hardware Devices ****
|
**** List of PLAYBACK Hardware Devices ****
|
||||||
card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
|
card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
|
||||||
|
@ -120,13 +143,13 @@ Snapcast v0.21 can capture audio from alsa, and to capture the output of a playe
|
||||||
|
|
||||||
For mopidy (gstreamer) it should be something like this (not tested):
|
For mopidy (gstreamer) it should be something like this (not tested):
|
||||||
|
|
||||||
```
|
```sh
|
||||||
output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! alsasink device=hw:0,0,0
|
output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! alsasink device=hw:0,0,0
|
||||||
```
|
```
|
||||||
|
|
||||||
For mpd: in mpd.conf
|
For mpd: in mpd.conf
|
||||||
|
|
||||||
```
|
```sh
|
||||||
audio_output_format "48000:16:2"
|
audio_output_format "48000:16:2"
|
||||||
audio_output {
|
audio_output {
|
||||||
type "alsa"
|
type "alsa"
|
||||||
|
@ -142,7 +165,7 @@ Snapcast v0.21 can capture audio from alsa, and to capture the output of a playe
|
||||||
|
|
||||||
4. Configure Snapserver to capture the loopback device:
|
4. Configure Snapserver to capture the loopback device:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
[stream]
|
[stream]
|
||||||
stream = alsa://?name=SomeName&sampleformat=48000:16:2&device=hw:0,1,0
|
stream = alsa://?name=SomeName&sampleformat=48000:16:2&device=hw:0,1,0
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Reference in a new issue