mopidy / mopidy

Mopidy is an extensible music server written in Python
https://mopidy.com
Apache License 2.0
8.03k stars 686 forks source link

Switching between multiple music sources in the queue is buggy in several ways #2142

Open PureTryOut opened 10 months ago

PureTryOut commented 10 months ago

Describe the bug When playing audio from e.g. a Spotify source and then switching to a different source (in my case Soundcloud or Youtube) is buggy. Buggy meaning either the current track will be played on repeat rather than switching to the next track in the queue, the music stops playing entirely, or Mopidy fails to play any track and it removes every track it encounters any error at (which at that point is every track, after each other) from the queue.

How to reproduce Make a queue of tracks from multiple sources. In my case the primary source of music is Spotify so start with that, then a track from either Soundcloud or Youtube.

Expected behaviour The next track to play, as a listener not noticing that the source of music has changed.

Environment Please complete the following information:

[core]
data_dir = /var/lib/mopidy

[local]
enabled = false
media_dir = /var/lib/mopidy/media

[audio]
output = alsasink device=rate48000Hz

[m3u]
enabled = true
playlists_dir = /var/lib/mopidy/playlists

[http]
hostname = 0.0.0.0
default_app = iris

[mpd]
enabled = false

[spotify]
enabled = true
client_id = <redacted>
client_secret = <redacted>
username = <redacted>
password = <redacted>
private_session = true
allow_playlists = false

[youtube]
enabled = true
youtube_dl_package = yt_dlp
autoplay_enabled = false

[soundcloud]
enabled = true
auth_token = <redacted>

[pandora]
enabled = false

[tidal]
enabled = false

[ytmusic]
enabled = false
kingosticks commented 10 months ago

Are you able to reproduce this with any combination of music sources or do you need to start with Spotify music? Likewise, can you reproduce when only using local music? Can you reproduce with other sinks or is (loopback) alsasink only?

To make any progress we need software versions and a log.

PureTryOut commented 10 months ago

Mopidy version 3.4.2, mopidy-spotify commit a82e1b2016dbfeddb4ac9c6027c2cdaf0331b9b1, Iris 3.69.2.

I'll give it a shot without Spotify in the equation tomorrow, and get you some logs if there is anything relevant in there.

Trying other sinks is going to be hard, the machine that Mopidy is running on is remote and has no speaker attached.

kingosticks commented 10 months ago

Re sinks, you can try some of the other ways to hook up Mopidy and Snapchat. There's a few given in their docs.

PureTryOut commented 8 months ago

Sorry for the very late response. Switching from any source to Spotify is the one going wrong, I can switch between Soundcloud and Youtube just fine for example. And I can switch from Spotify, just not to Spotify.

When things go wrong nothing appears in logs, it just starts skipping songs...

kingosticks commented 8 months ago

Thanks, that is very useful. And just to double check: so it's the opposite of what's described in the original post? I think I can imagine switching to Spotify being more likely to have a problematic given GStreamer's rellatively young spotify source element.

Would you be able to get a verbose log when it goes wrong? Ideally with GST_DEBUG=3 ?