bang-olufsen / create

Software for the HifiBerry/BeoCreate Re-Create project for upcycling vintage loudspeakers
https://www.hifiberry.com/beocreate
MIT License
175 stars 43 forks source link

Disable Spotify Connect #139

Closed 0bmxa closed 3 years ago

0bmxa commented 3 years ago

Hello!

I'm looking for an option to disable Spotify Connect, because when I stream music from the Spotify app on my phone I see BT, AirPlay and Spotify Connect targets, all with the same name, and that's a bit confusing.

I came across https://github.com/bang-olufsen/create/blob/bbe50300d14fe6b08c3711c42bdfe3f2a0d3bff9/Beocreate2/beo-extensions/spotify/spotify-client.js which sounds pretty much like what I want, but I can't find this in the UI. Is that an issue of my installation, or is that currently disabled?

Not sure if that's related, but I'm on a Pi Zero W, and spotify's package.json mentions https://github.com/bang-olufsen/create/blob/bbe50300d14fe6b08c3711c42bdfe3f2a0d3bff9/Beocreate2/beo-extensions/spotify/package.json#L28 but the spotify daemon is running on my system regardless.

For now I just SSH'd into the Pi and ran systemctl stop spotify, which seems to do what I want, but will probably be gone after the next reboot.

0bmxa commented 3 years ago

Okay I just found that Spotify is not actually supposed to be available on the Pi Zero https://github.com/hifiberry/hifiberry-os/blob/c13f386d80c7f558cf5fa21d9ff873e4a4a62ae4/doc/services.md#L10 so I guess then it's rather the question why its still running (and working I think) even if its not supposed to.

Sorry for incorrectly bringing this up here!

tuomashamalainen commented 3 years ago

Hi Max,

Spotify Connect is indeed not supposed to be available on the Pi Zero as ARMv7 is listed as a requirement for the UI to show up. However, the UI just obeys these directives, it's not directly tied to the underlying services, so this kind of discrepancy can happen.

As a temporary measure, you can run 'systemctl disable --now spotify', which will not only stop the service but will also prevent it from starting up with the system – this is the mechanism that the UI also uses to turn sources off.

@hifiberry (they're responsible for packaging everything) can you check what is to be done here?

0bmxa commented 3 years ago

Hey Tuomas,

Thanks for the quick reply and the hint! I was mainly skeptical about modifying services directly because I feared some parts might not respond well to that (like they maybe also expect some config file to be updated or so), but if thats the way to go, I'm happy for now!

I was also thinking of open the issue in hifiberry-os, but as it turned out to be an issue with the Pi Zero (and that's not officially supported) I didn't want to bother them.

In any case thanks for the great product and also beautiful interface!

hifiberry commented 3 years ago

@0bmxa Are you sure Spotify connect is running on the Pi0? It should not be included at all. Whats the output of

systemctl status spotify

0bmxa commented 3 years ago

@hifiberry As I had killed it's only

● spotify.service - Vollibrespot
     Loaded: loaded (/usr/lib/systemd/system/spotify.service; disabled; vendor preset: enabled)
     Active: inactive (dead) since Sun 2021-02-07 15:35:50 CET; 1 day 3h ago
   Main PID: 6437 (code=killed, signal=TERM)

Warning: journal has been rotated since unit was started, output may be incomplete.

I started it now, now it says


● spotify.service - Vollibrespot
     Loaded: loaded (/usr/lib/systemd/system/spotify.service; disabled; vendor preset: enabled)
     Active: active (running) since Mon 2021-02-08 19:14:20 CET; 3s ago
    Process: 26084 ExecStartPre=/opt/hifiberry/bin/bootmsg Starting Vollibrespot (code=exited, status=0/SUCCESS)
    Process: 26088 ExecStartPre=/opt/hifiberry/bin/store-volume /tmp/spotifyvol (code=exited, status=0/SUCCESS)
    Process: 26094 ExecStartPost=/usr/bin/sleep 1 (code=exited, status=0/SUCCESS)
    Process: 26096 ExecStartPost=/opt/hifiberry/bin/restore-volume /tmp/spotifyvol (code=exited, status=0/SUCCESS)
    Process: 26105 ExecStartPost=/usr/bin/rm /tmp/spotifyvol (code=exited, status=0/SUCCESS)
   Main PID: 26093 (vollibrespot)
      Tasks: 1 (limit: 795)
     CGroup: /system.slice/spotify.service
             └─26093 /usr/bin/vollibrespot -c /etc/vollibrespot.conf

Feb 08 19:14:18 bedroomhifi systemd[1]: Starting Vollibrespot...
Feb 08 19:14:19 bedroomhifi vollibrespot[26093]: vollibrespot v0.2.2 UNKNOWN UNKNOWN (librespot 1a224a3 2020-10-25) -- Built On 2021-02-03
Feb 08 19:14:19 bedroomhifi vollibrespot[26093]: Reading Config from "/etc/vollibrespot.conf"
Feb 08 19:14:19 bedroomhifi vollibrespot[26093]: [Vollibrespot] : Using Alsa backend with device: default
Feb 08 19:14:20 bedroomhifi systemd[1]: Started Vollibrespot.```