I’m using Mopidy with GMusic.
I try to debug using the python mpd client.
Sometimes, after after a manual song change in the current playlist (using previous or next or “addid”), mopidy does not update the “current” playing song, and the status() display the “old” song.
Also next (manual) “next” use that same information and replay the same song.
Looks like mopidy does not “know” that gmusic changed song.
Looking at gmusicapi logs, it shows that the GetStreamUrl return the right URL on song change. So the problem is somewhere between the gmusicapi and mopidy.
Hi, log not useful, they shot correct URI change.
The problem exists only with the bitrate = 320
The problem does not shows if song is short (33s)
Here is two programs to reproduce the problem:
With the problem:
# Test next() but song is repeated (you have to listen to test)
# Song is 169 seconds long
#
# Problem is present only if bitrate = 320 !
import datetime
import time
import mpd
ALBUM = 'Sheik Yerbouti'
SONG = 'bobby'
c = mpd.MPDClient()
c.connect('localhost', 6600)
c.clear()
a = [t for t in c.find('title', ALBUM)
if t.get('file').startswith('gmusic:album')][0]
c.add(a['file'])
sid = [s['id'] for s in c.playlistinfo() if SONG in s['title'].lower()][0]
c.playid(sid)
time.sleep(1) # let start
print "[%s] Song ID: %s" % (datetime.datetime.now(), sid)
time.sleep(5)
c.next()
print "[%s] Song should have changed but not" % datetime.datetime.now()
sid = c.status()['songid']
print "[%s] Song ID is now: %s" % (datetime.datetime.now(), sid)
Working as expected:
# Test next() working
# Song is 33 seconds long
import datetime
import time
import mpd
ALBUM = 'Sheik Yerbouti'
SONG = 'minute'
c = mpd.MPDClient()
c.connect('localhost', 6600)
c.clear()
a = [t for t in c.find('title', ALBUM)
if t.get('file').startswith('gmusic:album')][0]
c.add(a['file'])
sid = [s['id'] for s in c.playlistinfo() if SONG in s['title'].lower()][0]
c.playid(sid)
time.sleep(1) # let start
print "[%s] Song ID: %s" % (datetime.datetime.now(), sid)
time.sleep(5)
c.next()
print "[%s] Song have indeed changed" % datetime.datetime.now()
sid = c.status()['songid']
print "[%s] Song ID is now: %s" % (datetime.datetime.now(), sid)