Giter VIP home page Giter VIP logo

librespot-snapserver's Introduction

librespot-snapserver

Run a Snapcast server with Spotify support as a Docker container.

This is a multi-arch image currently working on the amd64 and armhf platforms. This means you can use the same image regardless of platform.

Note: You need a Spotify premium account.

Usage

Run it like this (on your PC or ARM-based device):

docker run -d --name snapserver --net host -e DEVICE_NAME=Snapcast mazzolino/librespot-snapserver

That will make the device available to all Spotify clients in your network. Add your Spotify credentials in order to limit control to clients logged in with your account:

docker run -d --name snapserver --net host -e DEVICE_NAME=Snapcast -e USERNAME=my-spotify-username -e PASSWORD=my-spotify-password mazzolino/librespot-snapserver

Now you can connect your snapclient to your host's ip. The receiver should show up in Spotify under the DEVICE_NAME given above (e.g. Snapcast). Have fun playing music!

Custom configuration

If you want to configure the snapcast server differently, you can mount your own snapserver.conf into the container:

docker run -d --name snapserver --net host -v /path/to/your/snapserver.conf:/etc/snapserver.conf:ro mazzolino/librespot-snapserver

NOTE: The configuration file needs to be mounted read-only for this to work.

Make sure to include a Spotify source in your configuration, like this:

[stream]
source = librespot:///librespot?name=Spotify&devicename=DEVICE_NAME&bitrate=320&volume=100&username=USERNAME&password=PASSWORD

(Replace DEVICE_NAME, USERNAME and PASSWORD accordingly.)

Building the images

In order to build images for the non-amd64 architectures, you need to build on amd64 machine and enable qemu binfmt support. The easiest way for this is to run:

docker run --privileged --rm tonistiigi/binfmt --install all

The following command will build the images for all supported architectures. Replace my/image with your own image name:

docker buildx build --platform=linux/amd64,linux/arm/v7,linux/arm64 -t my/image --load .

To build only an image for the current architecture, run:

docker buildx build -t my/image --load .

librespot-snapserver's People

Contributors

djmaze avatar endotronic avatar lyghtnox avatar mwild1 avatar titilambert avatar yubiuser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

librespot-snapserver's Issues

JSON Parsing error.

Heya,
Seems like I'm having some issues to parse the config file all of a sudden, happens no matter where I run my container.

2019-09-12 19-21-52 [Notice] Settings file: "/root/.config/snapserver/server.json"
2019-09-12 19-21-52 [Err] Error reading config: [json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input; expected '[', '{', or a literal
2019-09-12 19-21-52 [Err] Failed to create client: Daemon not running

Anything you've noticed or are aware of?
Cheers.

Snapcast server starts, no Spotify connect device appears though

Using ubuntu server on a raspberry Pi 3B+.

Using mazzolino/librespot-snapserver:arm as per the other issue. As expected and thescribed in #7 , the default image won't run.

No spotify connect device is added to the list, though. Other spotify connect devices (using raspotify) are showing up correctly, for what it matters.

If ran without detaching the terminal, here's what I get. I see no line related to librespot.
ubuntu@ubuntu:~$ sudo docker run --name snapserver --net host --rm -e DEVICE_NAME=Snapcast mazzolino/librespot-snapserver:arm

2021-01-06 11-08-29.830 [Info] (main) Adding source: pipe:///tmp/snapfifo?name=default
2021-01-06 11-08-29.831 [Notice] (init) Settings file: "/root/.config/snapserver/server.json"
2021-01-06 11-08-29.833 [Error] (Avahi) Failed to create client: Daemon not running
2021-01-06 11-08-29.834 [Info] (PcmStream) PcmStream: default, sampleFormat: 48000:16:2
2021-01-06 11-08-29.834 [Info] (PcmStream) Stream: default, metadata={
2021-01-06 11-08-29.834 [Info] (PcmStream) "STREAM": "default"
2021-01-06 11-08-29.834 [Info] (PcmStream) }
2021-01-06 11-08-29.834 [Info] (Server) onMetaChanged (default)
2021-01-06 11-08-29.835 [Info] (PipeStream) PipeStream mode: create
2021-01-06 11-08-29.835 [Info] (Server) Stream: {"fragment":"","host":"","path":"/tmp/snapfifo","query":{"chunk_ms":"20","codec":"flac","name":"default","sampleformat":"48000:16:2"},"raw":"pipe:////tmp/snapfifo?chunk_ms=20&codec=flac&name=default&sampleformat=48000:16:2","scheme":"pipe"}
2021-01-06 11-08-29.837 [Error] (PosixStream) Exception: end of file
2021-01-06 11-08-29.838 [Info] (ControlServer) Creating TCP acceptor for address: 0.0.0.0, port: 1705
2021-01-06 11-08-29.838 [Info] (ControlServer) Creating HTTP acceptor for address: 0.0.0.0, port: 1780
2021-01-06 11-08-29.838 [Info] (StreamServer) Creating stream acceptor for address: 0.0.0.0, port: 1704
2021-01-06 11-08-29.839 [Info] (main) number of threads: 4, hw threads: 4
2021-01-06 11-08-30.242 [Notice] (StreamServer) StreamServer::NewConnection: 192.168.8.129
2021-01-06 11-08-30.247 [Info] (Server) Hello from 15133707-0ad4-46b4-862c-1d9a7ce7cfa1, host: SM-A405FN, v0.22.0, ClientName: Snapclient, OS: Android 10, Arch: arm64-v8a, Protocol version: 2

How can I help debug this?
Thanks,

Snapserver doesn't start

Hi :)

Firstly, I want to say I'm not an advanced user of linux and Docker.

So my problem is that when I launch the command :
docker run -d --name snapserver --net host -e DEVICE_NAME=Snapcast mazzolino/librespot-snapserver

I just see the id of the container and nothing more. No logs of the snapserver of librespot.

Do I have to do something more ?

Thank you for your time

Web GUI

Does this come with the web GUI (Snapweb)? I can't seem to be able to access it at :1780?
The resource '/' was not found.

Issues running on dietpi distribution

Hi all - I'm experiencing some issues starting up the docker image when running it on the DietPi distribution (https://dietpi.com/): The output of starting the docker image is the following:

$ docker run --name snapserver --net host -e DEVICE_NAME=Snapcast mazzolino/librespot-snapserver
2020-12-27 19-09-48 [Info] (main) Adding stream: librespot:///librespot?name=Spotify&devicename=Snapcast&bitrate=320&volume=100
2020-12-27 19-09-48 [Notice] (init) Settings file: "/root/.config/snapserver/server.json"
2020-12-27 19-09-48 [Error] (init) Error reading config: [json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input; expected '[', '{', or a literal
2020-12-27 19-09-48 [Error] (Avahi) Failed to create client: Daemon not running
2020-12-27 19-09-48 [Info] (start) Creating TCP acceptor for address: 0.0.0.0, port: 1705
2020-12-27 19-09-48 [Info] (start) Creating HTTP acceptor for address: 0.0.0.0, port: 1780
2020-12-27 19-09-48 [Info] (PcmStream) PcmStream sampleFormat: 44100:16:2
2020-12-27 19-09-48 [Info] (PcmStream) metadata={
2020-12-27 19-09-48 [Info] (PcmStream)     "STREAM": "Spotify"
2020-12-27 19-09-48 [Info] (PcmStream) }
2020-12-27 19-09-48 [Info] (onMetaChanged) onMetaChanged (Spotify)
2020-12-27 19-09-48 [Info] (start) Stream: {"fragment":"","host":"","path":"/librespot","query":{"bitrate":"320","chunk_ms":"20","codec":"flac","devicename":"Snapcast","name":"Spotify","sampleformat":"44100:16:2","volume":"100"},"raw":"librespot:////librespot?bitrate=320&chunk_ms=20&codec=flac&devicename=Snapcast&name=Spotify&sampleformat=44100:16:2&volume=100","scheme":"librespot"}
2020-12-27 19-09-48 [Error] (PosixStream) Connect exception: execve failed: No such file or directory
2020-12-27 19-09-48 [Info] (start) Creating stream acceptor for address: 0.0.0.0, port: 1704
2020-12-27 19-09-48 [Info] (main) number of threads: 4, hw threads: 4
2020-12-27 19-09-48 [Error] (PosixStream) Connect exception: execve failed: No such file or directory
2020-12-27 19-09-48 [Error] (PosixStream) Connect exception: execve failed: No such file or directory
2020-12-27 19-09-48 [Error] (PosixStream) Connect exception: execve failed: No such file or directory

-and it just continues writing: [Error] (PosixStream) Connect exception: execve failed: No such file or directory. It never starts up

/etc/snapserver.conf not found on armhf

Hi,
When I try to create a container with your image I get an error:

[alarm@rpi4 ~]$ sudo docker run --name snapserver --net host -e DEVICE_NAME=Snapcast mazzolino/librespot-snapserver
sed: can't read /etc/snapserver.conf: No such file or directory

Is the image broken?

sed: cannot rename /etc/sedv8NZWT: Device or resource busy

Hello everybody,

I was trying to pull up this container but I am left with the following error and everything stops.

My configuration is as follows:

snapserver:
user: root
volumes:
- '/mnt/dockerData/mopidy/snapcast:/tmp/snapcast'
- '/mnt/dockerData/mopidy/snapcast/conf/snapserver.conf:/etc/snapserver.conf'
image: mazzolino/librespot-snapserver
container_name: snapserver
environment:
- DEVICE_NAME=Snapcast
- USERNAME=xxxxxxxxxxxxxxxxxx
- PASSWORD=xxxxxxxxxxxxxxxxxx

snapserver.conf

[stream]
stream = pipe:///tmp/snapcast/snapfifo?name=Snapserver

[http]
doc_root = /usr/share/snapserver/snapweb

Many thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.