Saiyato / volumio-snapcast-plugin

Volumio 2 SnapCast plugin, to easily manage SnapCast functionality
115 stars 25 forks source link

SnapCast Plugin not installing on PI0 #68

Closed karba78 closed 2 years ago

karba78 commented 5 years ago

i upgraded/reinstalled from scratch a PI0 i had running with Volumio and SnapCast. tried many times, the plugin get installed; see trace below but the moment you click to activate it; errors shows -------run trace----- image image

-----install trace---- Downloading plugin at http://volumio.github.io/volumio-plugins/plugins/volumio/armhf/miscellanea/snapcast/snapcast.zip END DOWNLOAD: http://volumio.github.io/volumio-plugins/plugins/volumio/armhf/miscellanea/snapcast/snapcast.zip Creating folder on disk Unpacking plugin Checking for duplicate plugin Copying Plugin into location Installing dependencies Installing SnapCast and its dependencies... Hit http://archive.volumio.org jessie InRelease Hit http://archive.volumio.org jessie InRelease Hit http://archive.volumio.org jessie/main Sources Hit http://archive.volumio.org jessie/contrib Sources Hit http://archive.volumio.org jessie/non-free Sources Hit http://archive.volumio.org jessie/rpi Sources Hit http://archive.volumio.org jessie/main armhf Packages Hit http://archive.volumio.org jessie/contrib armhf Packages Hit http://archive.volumio.org jessie/non-free armhf Packages Hit http://archive.volumio.org jessie/rpi armhf Packages Hit http://archive.volumio.org jessie/main Sources Hit http://archive.volumio.org jessie/ui Sources Hit http://archive.volumio.org jessie/main armhf Packages Hit http://archive.volumio.org jessie/ui armhf Packages Ign http://archive.volumio.org jessie/contrib Translation-en Ign http://archive.volumio.org jessie/main Translation-en Ign http://archive.volumio.org jessie/non-free Translation-en Ign http://archive.volumio.org jessie/rpi Translation-en Ign http://archive.volumio.org jessie/main Translation-en Ign http://archive.volumio.org jessie/ui Translation-en Reading package lists... Detecting cpu cpu: armv6l Selecting previously unselected package snapclient. (Reading database ... 20654 files and directories currently installed.) Preparing to unpack .../snapclient_0.16.0_armhf.deb ... Unpacking snapclient (0.16.0-1) ... Processing triggers for systemd (215-17+deb8u8) ... Selecting previously unselected package snapserver. (Reading database ... 20664 files and directories currently installed.) Preparing to unpack .../snapserver_0.16.0_armhf.deb ... Unpacking snapserver (0.16.0-1) ... Processing triggers for systemd (215-17+deb8u8) ... Reading package lists... Building dependency tree... Reading state information... Correcting dependencies... Done The following packages will be REMOVED: snapclient snapserver 0 upgraded, 0 newly installed, 2 to remove and 24 not upgraded. 2 not fully installed or removed. After this operation, 1966 kB disk space will be freed. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 20676 files and directories currently installed.) Removing snapclient (0.16.0-1) ... Removing snapserver (0.16.0-1) ... Adding plugin to registry Plugin Successfully Installed

gbnardo commented 5 years ago

hi, Same problem on PI0 in /etc/init.d are two files named snapclient.dpkg-new and snapserver.dpkg-new in /usr/bin are missed snapclient and snapserver

ruuperke commented 4 years ago

Hi, Same issue here on my Pi0. previously worked fine on Pi0, with no issues. I also did a new (added) Pi0 volumio install and snapcast plugin, but suddenly got same error displayed, when trying to enable snapcast.

Saiyato commented 4 years ago

Can anyone confirm this is solved when manually installing the latest version?

karba78 commented 4 years ago

worked for me, many thanks :) still have an error when clicking save on the snapcast server save button, i am using it as client working i guess as a server it won't work see error below Configuration failed Failed to touch asound configuration file with error: Error: Command failed: /bin/touch /etc/asound.conf /bin/touch: cannot touch '/etc/asound.conf': Permission denied

Saiyato commented 4 years ago

Awesome! @karba78 did you install any other plugins? This seems to be caused by a rights issue, even thought the plugin should be more than able to write asound.conf. What version are you running on?

karba78 commented 4 years ago

Hello :) nope that's the only plugin ; installed on a fresh clean 2.657 Volumio, image

Saiyato commented 4 years ago

I'm seeing the same behaviour now as well, which is weird... the asound.conf file is now owned by root instead of volumio and I can't invoke sed (replacement tool) without sudo. I'm going to have to work out a new strategy here, seems like Volumio is hardening its system.

ruuperke commented 4 years ago

Hi there, The updated snapcast plugin worked for me to also, on my Pi0, Volumio version 2.632. Altough I first received the same error message, as Karba78 discribed ,when enabling the server, I can live with that, because I'm also using it as a client only.

But now, almost a week later, I enabled the server again, because I wanted to make a printscreen of the error message to add it to this comment, it just worked, without any error message and nothing was changed in between.

Many thanks to Saiyato, for keeping up the great work.

Kind Regards

joschplusa commented 4 years ago

I'm seeing the same behaviour now as well, which is weird... the asound.conf file is now owned by root instead of volumio and I can't invoke sed (replacement tool) without sudo. I'm going to have to work out a new strategy here, seems like Volumio is hardening its system.

Is there a temporary fix? Because my snapcast stuff isn't working anymore because of this asound permission issue. Can I manually edit the permissions? Don't want to reflash my whole system with an older volumio version.

Saiyato commented 4 years ago

You can work around it by chowning the file: sudo chown volumio:volumio /etc/asound.conf

monte-monte commented 4 years ago

The latest version of snapcast (0.17.1) can't be installed, because it requires libstdc++6 >= 6 and volumio is currently running on outdated Debian Jessie, which is a shame. Compiling from sources also requires libboost 1.70, which is not available in repositories.

Saiyato commented 4 years ago

Correct, this is already fixed and can be merged into the Volumio repo, see this PR: https://github.com/volumio/volumio-plugins/pull/371

I added the 0.15 version to the package and will make sure when Volumio moves to Buster, that will fetch latest version instead.

monte-monte commented 4 years ago

@Saiyato how about using a docker container to run Snapcast. That way we won't be constrained by Volumio's distro and libs. Considering how long it takes them to upgrade the system, it may be a proper way. For example pydpiper, which is used to display mpd info on displays makes use of docker to abstract itself from host OS and provide solution for multiple player systems including Volumio.

ToeiRei commented 4 years ago

Problem still persists - raspberry pi 2b

Saiyato commented 4 years ago

@Saiyato how about using a docker container to run Snapcast. That way we won't be constrained by Volumio's distro and libs. Considering how long it takes them to upgrade the system, it may be a proper way. For example pydpiper, which is used to display mpd info on displays makes use of docker to abstract itself from host OS and provide solution for multiple player systems including Volumio.

That would solve this issue yes, but I'm not too familiar with Docker, if you can help building the container, that'd be great. I'm going to read into making it run in Docker, this will take time (and effort), don't expect this in the near future. But yes, that would solve dependency issues, this goes for all plugins using binaries of course.

Note that adding a Docker container, also introduces overhead, which means small systems (Pi0, PiB and B+ will be less responsive).

monte-monte commented 4 years ago

As for myself, I've managed to compile snapcast binaries on RPi itself. It took some time and effort, but it's doable for sure. Now I'm not sure if it's worse the hassle with docker, as you already providing binaries in your package. You could build 0.17.1 binaries, all you need is to manually install boost libraries higher than 1.70. That's pretty staright forward process. The only thing is required, that kept me away from success for a while was lack of RAM for building boost. But it is easy to overcome by making a 1GB swap file and activating it specifically for the time of the build. After boost libraries are installed you follow build notes on snapcast docs and you get 2 deb files which should work on any volumio setup. Docker can be more flexible and doesn't require recompile a binary for every new version, but I myself not a pro in it to help you build a working image right now. But extensive googling would do, if I'll have the time.

ToeiRei commented 4 years ago

I would also be against a dockerized solution as it brings in a full stack of binaries wanting to be maintained. Wouldn't we have the same case again here?

Saiyato commented 4 years ago

@ToeiRei yes, if you're referring to Docker itself, then you are absolutely correct. It should be better maintained by the team of Docker I presume, but it's still a little bit of a risk. Apart from the aforementioned overhead which does impact performance (and possibly wear and tear of the SD card).

ToeiRei commented 4 years ago

@Saiyato running things inside docker should be something the volumio should consider - not a simple plugin. Because that way we'll have a huge mess soon.

monte-monte commented 4 years ago

@ToeiRei what mess do you imply exactly? I can't see any possible mess with docker which is robust technology and doesn't require any maintaining according to the use we are talking about. Take a look at this paper if you have any doubts about my words https://domino.research.ibm.com/library/cyberdig.nsf/papers/0929052195DD819C85257D2300681E7B/$File/rc25482.pdf

ToeiRei commented 4 years ago

@monte-monte, let me ask you a couple of questions

If you're willing to implement docker on the volumio core side - for ALL plugins to use, I'm not against it, even if there are better ways to do things.

But keep in mind - it will wear down the sdcards of any raspi if not done right. Plus: it will eat valuable resources which aren't great on the first raspi devices - so you'd also cut down on low end devices...

monte-monte commented 4 years ago

@ToeiRei

I see no need for ALL plugins to use Docker. Docker is abstraction layer used to run Snapcast binaries (in this particular case) within appropriate environment. Volumio plugins themselves are just Node.js, that doesn't need any abstraction. How do you think docker will increase sdcard wear? By what means? In this usecase docker will increase RAM consumption by maximum 10MB.

ToeiRei commented 4 years ago

@monte-monte, you seem to ignore Saiyato's answers from above.

I am sure that you are aware of Docker writing its files as root whereas volumio runs its stuff as user. How would you tackle this in the end? I just see no clean solution that is 'simple' as in just compile those binaries, drop them in and run.

besides that, I won't stop you from doing a proper pull request or even fork this plugin ;)

monte-monte commented 4 years ago

@ToeiRei sudo usermod -a -G docker volumio? For the install purpose volumio already runs install.sh as root. So I don't really see any issues here. I may do a proper pull request with added docker image. But from the other side I've already compiled fresh binaries of snapcast for my setup, so I won't personally benefit from it at this time.

monte-monte commented 4 years ago

Okay I admit I've made few mistakes in my replies.

All in all, I've managed to make a working docker image based on alpine with latest snapcast binaries. In fact the binaries are even present in alpine repos. Docker image size is 15Mb, it works without issues so far.

@Saiyato do you have any interest in testing this? For a note, Alpine linux which is base to this image apparently works completely from RAM, so I guess we can forget about SD wearing out because of it. But feel free to discover this question further.

badaix commented 4 years ago

Btw: you don't need to install boost to build Snapcast, you only need the headers. All you have to do is to download and extract the latest boost and point cmake to the extracted root dir.

mullermeck commented 4 years ago

Is there an easy fix to get it up and working? How long time is it for a fix? I think docker is a bad idea, for it should that be easier to fix. Btw: Thanks @Saiyato for you maintaining this plugin!

monte-monte commented 4 years ago

@mullermeck

mullermeck commented 4 years ago

That's looks for almost to advance for me. I will probably wait for a fix, but thanks for the answer!

mattmofr commented 4 years ago

Hello Folks, I just updated volumio without checking issues and discovered that snapcast plugin is not working anymore with the same error of the first post of this thread. I'm using raspberry pi 0 W. All my system was relying on snapcast for synchronized multiroom. I even developed a remote controller to modify volumes of each room. It was a year of work in my spare time. And I realized how much time Saiyato spent on this plugin. Thanks for the huge work ! I'm now desperate to see that no fixes have been made (unless I missed something). The chown workaround is not working for me. Does anyone have another fix solution? Or can anyone point me to the latest version which works with Saiyato snapcast plugin so I can make a rollback (I can't remember which version I had before!)?

PS : Do you think Volumio is changing its strategy by making rights tighter so that third party plugins are limited to simple functionalities? In other words, do you think Volumio is leaving the open world to proprietary world?

Saiyato commented 4 years ago

Hi @mattmo92270 the PR has not been merged yet, which means the version in the store is not the latest. You can manually install the latest version (refer my plugin helper repo if you don't know how).

As for the rights issue, Volumio is tightening security, not so much to stop being open source, but to harden the system ;) Making it less vulnerable for malicious actors. I have not yet found a way to actually solve the rights issue, chowning the file doesn't work, because the sed-command wants to create a tmp file in /etc/, so you should recursively chown /etc/ which seems a bit excessive. I'm still trying to figure out ways around this.

mattmofr commented 4 years ago

Hi @mattmo92270 the PR has not been merged yet, which means the version in the store is not the latest. You can manually install the latest version (refer my plugin helper repo if you don't know how).

As for the rights issue, Volumio is tightening security, not so much to stop being open source, but to harden the system ;) Making it less vulnerable for malicious actors. I have not yet found a way to actually solve the rights issue, chowning the file doesn't work, because the sed-command wants to create a tmp file in /etc/, so you should recursively chown /etc/ which seems a bit excessive. I'm still trying to figure out ways around this.

Thanks Saiyato for your quick response. And once again, thanks for you awesome job . If I understand well, the latest version of your plugin in your repo will correct the issue with the latest version of Volumio ? I'll download it and install it manually following your guide. (I thought I wasn't a newbee anymore, but I still need to follow it) ;)

Cheers Matt

Edit : Oh and good news if the rights tightening is in order to make the system safer !

mattmofr commented 4 years ago

@Saiyato it worked perfectly. System is now up and running. Thank you so much !!

Saiyato commented 4 years ago

@monte-monte I finally got around playing with Docker, and managed to get a build to trigger on every update in the master of its corresponding GitHub repo. See here

Do you have the Dockerfile (or arguments) for your Alpine build? Right now I'm using raspbian, which seems a bit overkill (188MB). Maybe it's the same as mine, but with another base image ;)

monte-monte commented 4 years ago

@Saiyato I was trying for a proof of concept, so I didn't write propper Dockerfile. All I did to test if it works: pulled latest alpine image, ran it and attached to it. Inside newly created container I ran:

apk update
apk add snapcast
snapclient -l
snapclient -h 192.168.2.55 -s 3

As I remember it worked. I committed changes locally and it produced snapclient image 13.3MB size.

Saiyato commented 4 years ago

Hi @monte-monte ,

I've managed to setup automated builds for snapclient and snapserver, I didn't want to combine the two just yet. You can find them on Docker Hub; snapserver and snapclient.

Currently the snapserver is one phase ahead, I want to build for each architecture, for snapclient I only have arm32v7 images for now. All based on Alpine images, so the size is reasonable (around 8 megs). I have confirmed them to be working on my Pi2B, but maybe someone else can test as well... ;)

The next step is making sure the client is built for all architectures as well, I was just having trouble with arm64v8, so I'll check in the morning (made some changes just now). The step after that is re-creating plugins; one for the server and one for the client, both loaded with standard settings, but leaving the opportunity to fiddle around.

Then there's the matter of overhead, how much overhead will be created by running Docker and the binaries from within a container? This needs answering at some point I suppose.

Anyways, have a great evening!

HemiBob commented 3 years ago

As a first time user, I am really struggling to get snapcast plugin to install. I've found so many postings and different suggestions that now I can't see the wood for the trees. I thought I had cracked it when I came across "volumio-plugin-helper" but alas I got bogged down with Linux messages that meant nothing to me. Can anyone just confirm I am on the right track using "volumio-plugin-helper" and the zip file found here? "https://github.com/Saiyato/volumio-snapcast-plugin/blob/master/volumio-snapcast-plugin.zip" Thanks guys

Saiyato commented 2 years ago

Hi buddy,

Yes the plugin helper will definitely make your life easier (I use it myself as well, so I don't have to memorize commands or type the URLs). Please install these plugins instead: https://github.com/Saiyato/volumio-snapserver-plugin https://github.com/Saiyato/volumio-snapclient-plugin

I have separated the server from the client part, they should install on Volumio 2 and 3