Snapcast: New release?

Created on 15 Oct 2019  ·  23Comments  ·  Source: badaix/snapcast

Hi

Are there plans for a new release soon?

thanks

Most helpful comment

yes, within the next few days, I'm testing and cleaning up. Release notes will look something like that:

Version 0.16.0

Features

  • Control server: websocket support for JSON RPC
  • Control server: simple webserver integrated to host web UIs
  • Control server: bind-to addresses are configurable
  • Control server: streams can be added and Removed (PR #443)
  • Control server: group names can be changed (PR #467)
  • Librespot: add onevent parameter (PR #465)

Bugfixes

  • Fix build on macOS (Issue #474)

General

  • Control server uses less threads (one in total, instead of 1+2n)
  • Snapserver: Configuration is moved into a file
  • Removed submodules "popl" and "aixlog" to ease build
  • Snapcast depends on boost::asio and boost::beast (header only)
  • Tidy up code base
  • Makefile doesn't statically link libgcc and libstdc++

All 23 comments

yes, within the next few days, I'm testing and cleaning up. Release notes will look something like that:

Version 0.16.0

Features

  • Control server: websocket support for JSON RPC
  • Control server: simple webserver integrated to host web UIs
  • Control server: bind-to addresses are configurable
  • Control server: streams can be added and Removed (PR #443)
  • Control server: group names can be changed (PR #467)
  • Librespot: add onevent parameter (PR #465)

Bugfixes

  • Fix build on macOS (Issue #474)

General

  • Control server uses less threads (one in total, instead of 1+2n)
  • Snapserver: Configuration is moved into a file
  • Removed submodules "popl" and "aixlog" to ease build
  • Snapcast depends on boost::asio and boost::beast (header only)
  • Tidy up code base
  • Makefile doesn't statically link libgcc and libstdc++

@badaix

Thanks for the release but it is failing to start on Debian Testing :rotating_light:

systemctl status snapserver.service                                                                                                              :(
● snapserver.service - Snapcast server
   Loaded: loaded (/lib/systemd/system/snapserver.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2019-10-16 18:13:37 CDT; 2s ago
     Docs: man:snapserver(1)
  Process: 30366 ExecStart=/usr/bin/snapserver $SNAPSERVER_OPTS (code=exited, status=1/FAILURE)
 Main PID: 30366 (code=exited, status=1/FAILURE)

Oct 16 18:13:37  systemd[1]: snapserver.service: Service RestartSec=100ms expired, scheduling restart.
Oct 16 18:13:37  systemd[1]: snapserver.service: Scheduled restart job, restart counter is at 5.
Oct 16 18:13:37  systemd[1]: Stopped Snapcast server.
Oct 16 18:13:37  systemd[1]: snapserver.service: Start request repeated too quickly.
Oct 16 18:13:37  systemd[1]: snapserver.service: Failed with result 'exit-code'.
Oct 16 18:13:37  systemd[1]: Failed to start Snapcast server.

I think there is an issue with the snapserver user but I cant figure it out.

Btw how does the web server feature work?

I replaced my debian packaging scripts with the official debian ones. The official debian package is using the username and groupname "_snapserver" and "_snapclient". Maybe this is the problem.
On one of my test systems I had to purge the old installation sudo dpkg --purge snapserver. Can you try this?

regarding the webserver: you can configure the doc_root in /etc/snapserver.conf to e.g. (there is a basic web UI interface.html in the snapcast source tree):

[http]
doc_root = /home/johannes/Develop/snapcast/server/etc

after restart sudo service snapserver restart you can open http:\\<IP of your server>:1780\interface.html in a browser.
For the web UI to work, you should put your snapserver's IP address in this line of interface.html:
var connection = new WebSocket('ws://127.0.0.1:1780/jsonrpc');

Minor optimization would be to change the line to

var connection = new WebSocket('ws://'+window.location.hostname+':1780/jsonrpc');

Great that you included Webserver and WebSocket :)

Hi glause, sorry for not getting back to you, this is exactly the question I wanted to ask you :)
I'm thinking of how to optionally ship this UI with the installer, this is planned for the next release

What's missing in the docs right now:
the websocket server can be fired with the really same json RPC commands as the telnet server (which is still built-in and will stay in future releases) at:
ws://<server host address>:1780/jsonrpc

You can also HTTP POST JSON RPC commands to the really same address (of course this is without push notifications):
http://<server host address>:1780/jsonrpc

the whole HTTP server can be enabled/disabled in /etc/snapserver.conf, also the port is configurable (default is 1780), as well as the doc_root and the listening address, which can be used to bind the servert to a specific network interface (also the loopback interface (127.0.0.1))

At the moment there is no TLS (HTTPS or WSS) available, this is planned for some later release.
Of course, it's not recommended to expose the HTTP server to the internet.

Hi, thanks for the new release!
I'm the maintainer for the archlinux AUR package (https://aur.archlinux.org/packages/snapcast/).
I haven't yet looked into compiling the updated package, but looking through the recent commits I did notice that the system users and groups have changed to have a leading underscore (also mentioned earlier in this thread). Is there any particular reason for that?
This seems to clash with arch conventions, so I want to double check whether this is something to take on board or not ...
Thanks in advance!

Hi @mogwa1
I don't know the reason for the leading underscores, they came in by copying the debian build scripts. Also I didn't find anything on Google, but just wrote the maintainer an email, asking for the reason.
In my Raspbian's passwd file there is one more user with underscore: _apt.
In general snapcast doesn't depend on specific users, but needs certain permissions, e.g. the client needs access to audio devices.

Hi @badaix, I appreciate the quick answer! So it's not just me that couldn't find anything on these underscores. :-)

Ok, I'll sleep on it another night. I think I'm going to keep the current users (without underscores) for the time being.
Arch is using systemd-sysusers to create the system users, which AFAIK has no way of removing sysusers. They're supposed to be removed manually by the sysadmin when they're no longer needed. So, introducing new sysusers at this point in time would litter systems which already had a previous version installed.

Another thing: would it be a good idea to mention the arch AUR package in the README.md?

I don't know the reason for the leading underscores, they came in by copying the debian build scripts. Also I didn't find anything on Google, but just wrote the maintainer an email, asking for the reason.
In my Raspbian's passwd file there is one more user with underscore: _apt.
In general snapcast doesn't depend on specific users, but needs certain permissions, e.g. the client needs access to audio devices.

I would like, to get back to the old user/group, as this update broke everything, because of the new user (and other stuff of course :) ) I am back to a 0.15 backup for now.
I use MPDwith Pulse and some legacy fifos, the fifos were working after i fixed the config, streams, but the pulse targets not.

@badaix

Thanks for the release but it is failing to start on Debian Testing rotating_light

systemctl status snapserver.service                                                                                                              :(
● snapserver.service - Snapcast server
   Loaded: loaded (/lib/systemd/system/snapserver.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2019-10-16 18:13:37 CDT; 2s ago
     Docs: man:snapserver(1)
  Process: 30366 ExecStart=/usr/bin/snapserver $SNAPSERVER_OPTS (code=exited, status=1/FAILURE)
 Main PID: 30366 (code=exited, status=1/FAILURE)

Oct 16 18:13:37  systemd[1]: snapserver.service: Service RestartSec=100ms expired, scheduling restart.
Oct 16 18:13:37  systemd[1]: snapserver.service: Scheduled restart job, restart counter is at 5.
Oct 16 18:13:37  systemd[1]: Stopped Snapcast server.
Oct 16 18:13:37  systemd[1]: snapserver.service: Start request repeated too quickly.
Oct 16 18:13:37  systemd[1]: snapserver.service: Failed with result 'exit-code'.
Oct 16 18:13:37  systemd[1]: Failed to start Snapcast server.

I fall into the same issue but i've fixed it.
By running sudo -u _snapserver /usr/bin/snapserver i notice a permission error to /var/lib/snapserver/server.json. The owner was numeric. This means my system has no user found for that user id. Maybe a mistake by building the package. After running chown _snapserver:_snapserver /var/lib/snapserver/server.json the service starts running.

So the service works fine, but my Spotify couldn't find my librespot device. After switching to the new config format this was fixed too.

I hope this help!

I don't get an answer yet from the debian package maintainer. I'm thinking about to remove the underscores from the user names/group names. In a new installation the underscore will not harm, but it's causing problems when updating an older version (w/o underscores). On the other hand, this is in line with the official debian package, and will make updates from the official to a more recent unofficial release easier.

@mogwa1

Another thing: would it be a good idea to mention the arch AUR package in the README.md?

yes, of course, it's a good idea to point Arch users to the official packages, as they are much more compatible, convenient and auto updated compared to make install installations.
I'm actually proud about the fact that there are official packages for some of the big Linux distros available.

I've created pull request #491 to update the documentation to mention the Arch package.

thanks @mogwa1 it's already merged

regarding the underscores: Felix, the debian package maintainer, said that the underscores are prepended to the user name to avoid conflicts with existing user names (unlikely, but not impossible)

What's missing in the docs right now:
the websocket server can be fired with the really same json RPC commands as the telnet server (which is still built-in and will stay in future releases) at:
ws://<server host address>:1780/jsonrpc

You can also HTTP POST JSON RPC commands to the really same address (of course this is without push notifications):
http://<server host address>:1780/jsonrpc

the whole HTTP server can be enabled/disabled in /etc/snapserver.conf, also the port is configurable (default is 1780), as well as the doc_root and the listening address, which can be used to bind the servert to a specific network interface (also the loopback interface (127.0.0.1))

At the moment there is no TLS (HTTPS or WSS) available, this is planned for some later release.
Of course, it's not recommended to expose the HTTP server to the internet.

Just testet the websoket interface. Thank you so much for introducing websockets and http server support. It makes the hydraplay setup less complex!

I use since some days the debian package for 0.17.1 (on ubuntu 18.04) and this works very good.
The user change back to the old one (without "_") was really good. THANK YOU !

I really appreciate the progress of this !

@mariolukas good to hear :) see you at the dorkbot ;)

Was this page helpful?
0 / 5 - 0 ratings