mopidy / mopidy-gmusic

DEPRECATED (Mopidy extension for playing music from Google Play Music)

Home Page:https://mopidy.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

First few seconds of gmusic songs are not played

grantbaker opened this issue · comments

I am using mopidy-gmusic as a backend for mopidy, and when I play a song after another song, the first few seconds are skipped. In more detail, here is the problem:

  1. Add two songs to the queue. The first one plays through from beginning to end just fine.
  2. The first song reaches the end, and the elapsed time ticks 3-4 seconds beyond the end of the song. No audio is played during this time.
  3. Mopidy switches to the second song, starting playback 3-4 seconds after the beginning of the second song. The rest of the song plays fine.

From searching the rest of the issues, it does not appear that this problem is common.

Here is some more relevant information:

  • I have 90 Mbps internet. I have access to 200 Mbps internet, and I have the same problems on both speeds. It does not appear that streaming speed affects the issue at all.
  • I tried increasing the GStreamer playbin buffer-size and buffer-duration in Mopidy here, and these changes did not affect the problem at all.
  • I tried following some fixes in #161, including adding the download flag to GStreamer and using this proxy. Neither worked.
  • I looked at the gmusicapi logs, and it appears that get-stream-url for the second song is called about 5 seconds before the first song ends.

A few solutions I've thought about, but don't know how to implement:

  • Change whatever calls get-stream-url from being called ~5 seconds before playback ends to ~10 seconds before playback ends. I couldn't find where this ultimately gets called. This is mostly a workaround.
  • Maybe there are some other GStreamer flags or configuration options that can change this (I haven't been able to find any in the documentation).
  • Cache in memory any songs that are in the queue. This might be a lot of work, and Google might not like this. Probably shouldn't do this.
  • Pause for 3-4 seconds before starting the second song. This is sub-optimal because ideally, we want gapless playback (although I'd prefer a short pause over skipping the first part of the song).

I feel like I've tried a lot of things that might reasonably fix the problem but didn't, so any suggestions would be greatly appreciated. Thanks.

I know that this issue is pretty old, did you manage to fix it?

If no, have you tried testing other backend plugins for mopidy?

I just clean installed everything, and the issue still happens. I tried a few different gstreamer buffer sizes and on 300 Mbps internet and this playback delay still happens.

I also tried it using the Spotify backend, and everything worked perfectly.

I clean installed Ubuntu 18.04 with mopidy and mopidy-gmusic and I don't have any issues. I still don't know what the problem was, but it's gone now. My best guess is that it was probably something like an incompatible gstreamer version. I'm going to close this issue.