Saiyato / volumio-snapcast-plugin

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

Snapcast Ports Not Open? #94

Closed ghost closed 3 years ago

ghost commented 3 years ago

End goal: Get multi-room audio working with Spotify Connect.

From a fresh install on a RPi4, I have:

At this point, I can start playing audio from Spotify, but the only single device playing any output is the local Volumio server; no remote Snapcast clients are playing audio. I'm not sure if this is from a misconfiguration, or if the plugin isn't working, or if I simply missed steps somewhere. I'm just getting brutally confused. There's no simple guide posted anywhere for connecting a simple multi-room audio setup to Spotify.

I cannot seem to figure out Snapcast on this setup. I've previously had no issues making it work on a Mopidy-based setup, but this one seems a little tougher. Of note, ports 1704, 1705, and 1780 are all closed. Normally when Snapcast is installed, these ports get opened where Snapserver exists. These ports are still closed on the Snapserver implementation after installing the Snapcast plugin. Is this normal behaviour? I can't seem to get any remote Snapcast clients with Snapclient communicating to this server.

As far as I know, I'm configured the clients by:

Am I missing any steps? Can someone provide a little insight into this process? I'd love to configure this, but I might have to move back to Mopidy and use the web-interface there (I wasn't able to get Spotify Connect with Librespot working on that build).

ghost commented 3 years ago

I'll note the contents of the relevant files here, as well as screenshots of the Volumio GUI plugin configurations.

  1. /etc/snapserver.conf

    source = pipe:///tmp/snapfifo?name=default

    Everything else is commented out, leaving it to its defaults.

  2. /etc/default/snapserver

    USER_OPTS="--user snapserver:snapserver"
    SNAPSERVER_OPTS="-d -s pipe:///tmp/snapfifo?name=VOLUMIO-MPD&mode=read&sampleformat=44100:16:2"
  3. /etc/mpd.conf

    
    audio_output {
    type            "alsa"
    enabled      "no"
    name          "alsa"
    device         "hw:1,0"
    dop             "no"

audio_output { type "fifo" enabled "yes" name "multiroom" path "/tmp/snapfifo" format "44100:16:2"



![Screenshot from 2021-05-03 14-19-23](https://user-images.githubusercontent.com/10491668/116928713-a7d7d880-ac1a-11eb-8dc7-dcbe7b95c510.png)
![Screenshot from 2021-05-03 14-19-46](https://user-images.githubusercontent.com/10491668/116928732-ac03f600-ac1a-11eb-9b41-55396b8b2154.png)

Note: The majority of these are defaults. The single non-default item that I've selected is in the "Spotify Integration Settings" area of the Snapcast Plugin Settings. I changed the "Spotify Implementation" to "Spotify for Volumio 2 (native: SPOP)" as this is the version of Spotify that is installed by the plugin. I'm not sure if this is correct or not.
ghost commented 3 years ago

I'm starting to see a couple of references from @Saiyato suggesting that the Snapcast installation needs to be pulled manually from Github instead of installed through the plugin library through the Volumio interface:

I'm thinking this might be accurate, so I'm going to try this method out. That said, I'm still unsure of the appropriate configuration files to use, so if someone can review the configurations with the specific text and images above, that will still help hugely.

ghost commented 3 years ago

Screenshot from 2021-05-03 15-20-19

I checked to see the status of the Snapcast service as a port-scan with NMAP was showing that the ports weren't open, and the above screenshot shows the results.

ghost commented 3 years ago

Last comment for now: here's a screenshot of journalctl to try and explain why it's not starting up. I have no idea what I'm looking at. Screenshot from 2021-05-03 15-26-34

Screenshot from 2021-05-03 15-29-21

ghost commented 3 years ago

Wow! I think I figured it out! I'm learning the ropes of Snapcast quickly.

/etc/default/snapserver takes priority over the configs in the base config file at /etc/snapserver.conf. In there, there was a reference to "codec=2" as shown in the second to final screenshot in this thread.

I removed the reference to that codec, and now Snapcast is working!! Holy smokes.

Steps:

  1. Install Volumio.
  2. Install the Spotify and Spotify Connect plugins.
  3. Toggle the Spotify Connect plugin for Multi-User on/off. This triggers the multi-user session to open up on the network.
  4. Reboot the device.
  5. Install Snapcast from the Github repository. This is critical. a) git clone https://github.com/Saiyato/volumio-snapcast-plugin b) cd volumio-snapcast-plugin c) rm volumio-snapcast-plugin.zip d) volumio plugin install e) Once you see #ENDOFSNAPCAST<br> <br>Finalizing installation<br>Finalizing installation, wait approximately 60s, and press Ctrl+C to exit the installation process. It is complete, it just doesn't exit the process naturally.
  6. In the Spotify Integration Settings, select Spotify for Volumio 2. Leave the "Dedicated Stream" switch off.
  7. Reload the Snapcast configuration page and ensure the Patch Spotify Configuration Templates changes to spop.
  8. SSH into the Volumio server, and edit the /etc/default/snapserver file. Remove the &codec=2 portion, restart the service.
  9. Tie your clients into the Snapcast server: /etc/default/snapclient --> SNAPCLIENT_OPTS="--host <IPv4 Address>

Substitute <IPv4 Address> for the full 32-bit IP address of your host. Do not leave the "< >" remaining, replace these too so all you have is the address.