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

Update Spotify and GStreamer in docker image #973

Open
2 of 10 tasks
alanmilinovic opened this issue Oct 22, 2024 · 15 comments
Open
2 of 10 tasks

Update Spotify and GStreamer in docker image #973

alanmilinovic opened this issue Oct 22, 2024 · 15 comments
Labels

Comments

@alanmilinovic
Copy link

alanmilinovic commented Oct 22, 2024

Iris version

3.69.3

Operating system(s) affected

  • Windows
  • MacOS
  • iOS
  • Android
  • Linux
  • Other

Browser(s) affected

  • Firefox
  • Chrome
  • Edge
  • Other

What happened?

Spotify is not playing songs because of outdated Spotify plugin and outdated GStreamer.

Can you please update docker image with Mopidy-Spotify v5.0.0a3 and gst-plugin-spotify_0.14.0~alpha.1-1 versions.
That will make username and password for Spotify obsolete and will be able to play songs.

More info here:
mopidy/mopidy-spotify#388

I tried to make it work by playing with Dockerfile and it is working if docker is running as root, but then I have some strange stuttering when songs are playing, not just from spotify also local songs.

This is what I have right now in my Dockerfile:

USER root
RUN sudo wget https://github.com/kingosticks/gst-plugins-rs-build/releases/download/gst-plugin-spotify_0.14.0-alpha.1-1/gst-plugin-spotify_0.14.0.alpha.1-1_amd64.deb -O /tmp/package.deb
RUN sudo apt install /tmp/package.deb
RUN sudo rm -f /tmp/package.deb

USER mopidy # when I remove this line, it is working but with audio stuttering
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install --break-system-packages Mopidy-Spotify==5.0.0a3

This is the error when tried to play song:

ERROR    2024-10-22 12:08:46,160 [7:MainThread] mopidy.audio.gst
  GStreamer error: Resource not found.

This is my docker-compose.yml

version: "3"
services:
  snapserver:
    image: jaedb/snapserver
    network_mode: host
    depends_on:
      mopidy:
        condition: service_healthy
    #ports:
      #- 1704
      #- 1705
      #- 1780
    volumes:
      - /tmp/snapserver:/tmp
      - ./docker/snapserver/snapserver.conf:/etc/snapserver.conf
      - ./docker/snapserver/snapserver.json:/root/.config/snapserver/server.json
    restart: unless-stopped

  mopidy:
    environment:
      - PIP_PACKAGES=Mopidy-YouTube Mopidy-YTMusic Mopidy-Spotify Mopidy-SoundCloud Mopidy-MusicBox-Webclient Mopidy-TuneIn Mopidy-Scrobbler
    build:
      context: .
    ports:
      - 6600:6600
      - 6680:6680
    healthcheck:
      test: curl -f http://localhost:6680/iris/http/get_config || exit 1
      timeout: 5s
      retries: 5
    volumes:
      # - ./mopidy/iris:/iris/mopidy/iris # To use a locally-built UI 
      - ./docker/mopidy/iris:/var/lib/mopidy/iris # Iris-specific storage
      - ./docker/mopidy/m3u:/var/lib/mopidy/m3u # To persist local playlists
      - ./docker/mopidy/local:/var/lib/mopidy/local # To persist database and covers
      - ./docker/mopidy/mopidy.conf:/config/mopidy.conf
      - ./docker/mopidy/auth.json:/var/lib/mopidy/auth.json # To persist ytmusic authentication
      - /home/amilino/Music:/var/lib/mopidy/media
      - /tmp/snapserver:/tmp
    restart: unless-stopped

I start container with:

docker-compose down &&
docker-compose build --pull &&
docker-compose up -d &&

Logs

No response

@kingosticks
Copy link
Contributor

You should also persist the Mopidy-Spotify auth file which normally lives in /var/lib/mopidy/spotify/credentials-cache.
Personally, I would properly persist the whole data_dir and cache_dir locations to avoid future headaches and worse performance.

@alanmilinovic
Copy link
Author

alanmilinovic commented Oct 22, 2024

Can you give me an example, you mean me to persist the whole /var/lib/mopidy/spotify/ or? Not sure that it will fix the original issue?

@kingosticks
Copy link
Contributor

It would be better to persist all of /var/lib/mopidy (the data_dir) rather than pick certain files that are currently required but could change tomorrow.

Not sure that it will fix the original issue?

Persisting the data_dir directory properly would not fix the usage of "outdated Spotify plugin and outdated GStreamer.", if that's what you mean. My recommendation is in addition to upgrading the outdated software.

@alanmilinovic
Copy link
Author

It would be better to persist all of /var/lib/mopidy (the data_dir) rather than pick certain files that are currently required but could change tomorrow.

Not sure that it will fix the original issue?

Persisting the data_dir directory properly would not fix the usage of "outdated Spotify plugin and outdated GStreamer.", if that's what you mean. My recommendation is in addition to upgrading the outdated software.

And do you know how to upgrade to outdated software? I tried with root and it works, but running container as root is causing audio to stutter.

@kingosticks
Copy link
Contributor

I don't know how to do that for a docker container I am unfamiliar with. I guess:

USER root
RUN wget https://github.com/kingosticks/gst-plugins-rs-build/releases/download/gst-plugin-spotify_0.14.0-alpha.1-1/gst-plugin-spotify_0.14.0.alpha.1-1_amd64.deb -O /tmp/package.deb
RUN dpkg -i /tmp/package.deb
RUN rm -f /tmp/package.deb

RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install --break-system-packages Mopidy-Spotify==5.0.0a3

I would definitely avoid running the resulting container as root, that should not be necessary.

@alanmilinovic
Copy link
Author

Ok, thanks maybe someone else can help, but the best solution would be for author to update the image of course.

@alanmilinovic
Copy link
Author

Tried to setup persistence for entire data it it is causing so many issues. That I gave up. I will stick to targeting only folders that are relevant.

@kingosticks
Copy link
Contributor

Good luck

@alanmilinovic
Copy link
Author

alanmilinovic commented Oct 22, 2024

Good luck

Lucky, is it working for you? Some example would be much appreciated, rather then twisting my arm all the time.

@alanmilinovic
Copy link
Author

@jaedb can you please help?

@alanmilinovic
Copy link
Author

I guess this project is dead?

@kingosticks
Copy link
Contributor

Good luck

Lucky, is it working for you? Some example would be much appreciated, rather then twisting my arm all the time.

Oh, I didn't see your edit. How rude. I've been clear I don't use this, I tried to help, sorry that wasn't enough but this bad attitude doesn't motivate me.

It's also incredibly rude to insuitiate that a project is "dead" because someone didn't have time in the last 10 days to drop everything and look at your problem. That's not the way to go about getting support for free software. Instead, contribute something more constructive, like asking if there's any more information they need or anything else you've tried in the meantime to show you're still stuck.

@alanmilinovic
Copy link
Author

alanmilinovic commented Nov 1, 2024

I did asked a lot of questions and got reply from you like "good luck" very demotivating. I didn't insulted the project, it is normal that sometimes projects are not developed any longer for what ever reason.

@kingosticks
Copy link
Contributor

kingosticks commented Nov 1, 2024

I did asked a lot of questions and got reply from you like "good luck" very demotivating. I didn't insulted the project, it is normal that sometimes projects are not developed any longer for what ever reason.

It was a sincere good luck, I don't use docker, it's a lot of random black magic, luck is required in my opinion.

That is normal, but it's been a few days. Have some respect for other people's time.

I hope you solve this, and that my earlier suggestion also gets a look by @jaedb when they have time.

@alanmilinovic
Copy link
Author

alanmilinovic commented Nov 1, 2024

I did asked a lot of questions and got reply from you like "good luck" very demotivating. I didn't insulted the project, it is normal that sometimes projects are not developed any longer for what ever reason.

It was a sincere good luck, I don't use docker, it's a lot of random black magic, luck is required in my opinion.

That is normal, but it's been a few days. Have some respect for other people's time.

I hope you solve this, and that my earlier suggestion also gets a look by @jaedb when they have time.

It is not a black magic, it is quite predictable.

Earlier suggestion is same what I wrote in my first post.

Ok, sorry if I made wrong assumptions, I do have respekt for everyones time. Hope that there will be some new updates in the future and that docker image will be updated. Happy to test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants