Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

First few seconds of gmusic songs are not played #187

Closed
grantbaker opened this issue Feb 28, 2018 · 3 comments
Closed

First few seconds of gmusic songs are not played #187

grantbaker opened this issue Feb 28, 2018 · 3 comments

Comments

@grantbaker
Copy link

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 Randomly stops playing after few minutes #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.

@adnidor
Copy link
Contributor

adnidor commented May 25, 2018

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?

@grantbaker
Copy link
Author

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.

@grantbaker
Copy link
Author

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.

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

No branches or pull requests

2 participants