Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spotify doesn't work anymore #589

Closed
fuzzybear62 opened this issue Jul 28, 2022 · 10 comments · Fixed by #610
Closed

Spotify doesn't work anymore #589

fuzzybear62 opened this issue Jul 28, 2022 · 10 comments · Fixed by #610
Labels
bug Something isn't working

Comments

@fuzzybear62
Copy link

Describe the problem
Spotify stop working, no sound at all and song skipping on the spotify app

Device information

  • Balena-fin 1.1
@fuzzybear62 fuzzybear62 added the bug Something isn't working label Jul 28, 2022
@freakyjoe8
Copy link

Yep. Same here and same error with balenaOS 2.99.27. Error from logs:

spotify [2022-07-28T18:19:39Z INFO librespot_playback::player] Loading <Temple of Love - 1992> with Spotify URI <spotify:track:53O11dqezFoFYaaMjr1SPP> spotify [2022-07-28T18:19:39Z ERROR librespot_core::channel] channel error: 2 1 spotify [2022-07-28T18:19:39Z ERROR librespot_playback::player] Unable to load encrypted file: ChannelError spotify [2022-07-28T18:19:39Z WARN librespot_playback::player] Unable to load <SpotifyId { id: 221052802452224273845189659844783082157, audio_type: Track }> spotify Skipping to next track

@freakyjoe8
Copy link

seems to be tracked here: librespot-org/librespot#972

@fuzzybear62
Copy link
Author

On another client I use https://github.com/spocon/spocon and it works fine

@andrewn
Copy link
Contributor

andrewn commented Aug 1, 2022

This is fixed in librespot@0.4.2 so as a temporary workaround I forked this repo and pushed an upgraded librespot docker image.

@AmauryBJ
Copy link

AmauryBJ commented Aug 1, 2022

@andrewn thanks ! How can i deploy the update ?

@andrewn
Copy link
Contributor

andrewn commented Aug 2, 2022

@andrewn thanks ! How can i deploy the update ?

If you check out the forked repository, then run balena push to upload the forked code to your fleet.

This is just temporary while the main repository catches up as I can't offer any support.

@jonaskor
Copy link

jonaskor commented Aug 7, 2022

Blocking apresolve.spotify.com in your router config can be a temporary fix, too.

@maggie44
Copy link
Contributor

maggie44 commented Aug 11, 2022

@andrewn, thanks for the fix.

I'm thinking it may be easier to integrate if we were to move the contents of your forked repo in to this one. So instead of relying on tmigone/librespot:... which draws on an external image, we move that build process in to this repo which will make it easier to maintain and keep up to date. Would you be able to look at submitting a pull request for that?

Ping me in the pull request if you are able to get it working and I will take a look and try and get it merged (I'm not a balena Sound user, but trust you guys know better than I do the best way to go).

@andrewn
Copy link
Contributor

andrewn commented Nov 10, 2022

@Maggie0002 I'd be happy to give this a go.

I'm not sure the best way to structure this, so can you point me to some examples please?

@maggie44
Copy link
Contributor

maggie44 commented Nov 10, 2022

@andrewn, that's great news, I would have had no way to test this. Really appreciate it.

It seems like your fix is to use a forked version of the librespot:0.3.1-pulseaudio package and bump the version inside: andrewn@c6eba2c?

So the current Dockerfile in this repo (https://github.com/balena-labs-projects/balena-sound/blob/master/plugins/spotify/Dockerfile.template) looks like this:

FROM tmigone/librespot:0.3.1-pulseaudio

ENV PULSE_SERVER=tcp:localhost:4317

COPY start.sh /usr/src/

CMD [ "/bin/bash", "/usr/src/start.sh" ]

I don't think we need to maintain librespot:0.3.1-pulseaudio as a separate package anymore, we can bring it in to this repo and maintain it here. So the Dockerfile (https://github.com/balena-labs-projects/balena-sound/blob/master/plugins/spotify/Dockerfile.template) would change to something like this, and hopefully will all work ok?

ARG BALENA_ARCH=%%BALENA_ARCH%%

# Build process from: https://git.alpinelinux.org/aports/tree/testing/librespot/APKBUILD
FROM balenalib/$BALENA_ARCH-alpine:edge as librespot-builder
WORKDIR /app

ARG LIBRESPOT_VERSION=0.4.2

RUN install_packages alsa-lib-dev pulseaudio-dev cargo curl

RUN curl -sL "https://github.com/librespot-org/librespot/archive/refs/tags/v${LIBRESPOT_VERSION}.tar.gz" --output librespot.tar.gz && \
    mkdir /app/librespot-src && \
    tar -zxvf librespot.tar.gz --directory /app/librespot-src --strip-components=1

WORKDIR /app/librespot-src

ENV CARGO_HOME=/app/cargo
ENV RUSTFLAGS="-C target-feature=-crt-static"

RUN cargo build \
    --release \
    --features alsa-backend,pulseaudio-backend \
    --verbose


FROM balenalib/$BALENA_ARCH-alpine:3.14-run
WORKDIR /app

ENV PULSE_SERVER=tcp:localhost:4317

RUN install_packages libgcc alsa-lib-dev pulseaudio-dev

COPY --from=librespot-builder /app/librespot-src/target/release/librespot /usr/bin/librespot

COPY start.sh /usr/src/

CMD [ "/bin/bash", "/usr/src/start.sh" ]

There is a new Alpine version out, I think 3.16? Ideally we wouldn't need to keep using the alpine:edge if you can get the package you need from 3.16? It would avoid breaking changes in the future if we can avoid using edge.

andrewn added a commit to andrewn/balena-sound that referenced this issue Nov 29, 2022
Spotify playback is broken in librespot 0.3.1 and depending on tmigone/librespot:0.3.1-pulseaudio means we can't easily upgrade to the latest version. Building within the project allows us to choose which version is tracked by balena-sound
maggie44 pushed a commit that referenced this issue Nov 30, 2022
Spotify playback is broken in librespot 0.3.1 and depending on tmigone/librespot:0.3.1-pulseaudio means we can't easily upgrade to the latest version. Building within the project allows us to choose which version is tracked by balena-sound
zgc pushed a commit to zgc/balena-sound that referenced this issue Nov 30, 2022
Spotify playback is broken in librespot 0.3.1 and depending on tmigone/librespot:0.3.1-pulseaudio means we can't easily upgrade to the latest version. Building within the project allows us to choose which version is tracked by balena-sound
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants