mopidy / mopidy-gmusic

DEPRECATED (Mopidy extension for playing music from Google Play Music)
https://mopidy.com
Apache License 2.0
214 stars 60 forks source link

Randomly stops playing after few minutes #161

Closed wf1nder closed 3 years ago

wf1nder commented 7 years ago

Can’t get gmusic plugin to work normally. It starts playing, but after a some time (few minutes) randomly stops. There appears message on console: ERROR GStreamer error: gst-resource-error-quark: Forbidden (15)

Switching to next track fixes problem for the next few minutes. Tried on my Raspberry PI 1, Raspberry PI 2, Odroid C2, and on PC. Distros: Ubuntu, Debian, Raspbian, Volumio, Ubuntu on C2. Tried on 3 diffirent USB dacs, and on I2S dac. Also, mopidy was installed from deb-repo, or from pip. In all cases problem appears. Now using last versions of mopidy and mopidy from pip: mopidy=2.0.1, mopidy-gmusic=2.0.0. Also, gstreamer1.0.

fgtham commented 7 years ago

Same here, sample debug output:

DEBUG    2017-01-02 11:54:24,501 [17253:HttpServer] mopidy.http.handlers Received WebSocket message from 127.0.0.1: u'{"method":"core.playback.get_time_position","jsonrpc":"2.0","id":445}'
DEBUG    2017-01-02 11:54:24,503 [17253:HttpServer] mopidy.http.handlers Sent WebSocket message to 127.0.0.1: '{"jsonrpc": "2.0", "id": 445, "result": 419113}'
DEBUG    2017-01-02 11:54:25,502 [17253:HttpServer] mopidy.http.handlers Received WebSocket message from 127.0.0.1: u'{"method":"core.playback.get_time_position","jsonrpc":"2.0","id":446}'
DEBUG    2017-01-02 11:54:25,504 [17253:HttpServer] mopidy.http.handlers Sent WebSocket message to 127.0.0.1: '{"jsonrpc": "2.0", "id": 446, "result": 420113}'
DEBUG    2017-01-02 11:54:26,356 [17253:MainThread] mopidy.audio.gst Got ERROR bus message: error=u'gst-resource-error-quark: Forbidden (15)' debug=u'/var/tmp/portage/media-plugins/gst-plugins-soup-1.8.3/work/gst-plugins-good-1.8.3/ext/soup/gstsouphttpsrc.c(1634): gst_soup_http_src_parse_status (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstSoupHTTPSrc:source:\nForbidden (403), URL: https://r5---sn-4g57knd6.c.doc-0-0-sj.sj.googleusercontent.com/videoplayback?id=<...>&itag=25&source=skyjam&begin=0&upn=IXy4QPnlE-g&o=<...>&cmbypass=yes&ratebypass=yes&ip=<...>&ipbits=0&expire=1483354133&sparams=cmbypass,expire,id,ip,ipbits,itag,mm,mn,ms,mv,nh,o,pl,ratebypass,source,upn&signature=<...>&key=cms1&mm=31&mn=sn-4g57knd6&ms=au&mt=1483353727&mv=m&nh=<...>&pl=22, Redirect to: (NULL)'
ERROR    2017-01-02 11:54:26,357 [17253:MainThread] mopidy.audio.gst GStreamer error: gst-resource-error-quark: Forbidden (15)
DEBUG    2017-01-02 11:54:26,363 [17253:MainThread] mopidy.audio.gst Changing state to GST_STATE_NULL: result=GST_STATE_CHANGE_SUCCESS
$ mopidy deps
Executable: /home/flo/bin/mopidy
Platform: Linux-4.9.0-gentoo-x86_64-Intel-R-_Core-TM-_i5-4570_CPU_@_3.20GHz-with-gentoo-2.3
Python: CPython 2.7.12 from /usr/lib64/python2.7
Mopidy: 2.0.1 from /home/flo/.local/lib64/python2.7/site-packages
  tornado>=2.3: 4.4.2 from /usr/lib64/python2.7/site-packages
    singledispatch: 3.4.0.3 from /usr/lib64/python2.7/site-packages
      six: 1.10.0 from /usr/lib64/python2.7/site-packages
    certifi: 2016.9.26 from /usr/lib64/python2.7/site-packages
    backports_abc>=0.4: 0.5 from /home/flo/.local/lib64/python2.7/site-packages
  requests>=2.0: 2.12.4 from /usr/lib64/python2.7/site-packages
  Pykka>=1.1: 1.2.1 from /home/flo/.local/lib64/python2.7/site-packages
  setuptools: 32.3.1 from /home/flo/.local/lib64/python2.7/site-packages
Mopidy-MusicBox-Webclient: 2.3.0 from /home/flo/.local/lib64/python2.7/site-packages
  Mopidy>=1.1.0: 2.0.1 from /home/flo/.local/lib64/python2.7/site-packages
    tornado>=2.3: 4.4.2 from /usr/lib64/python2.7/site-packages
      singledispatch: 3.4.0.3 from /usr/lib64/python2.7/site-packages
        six: 1.10.0 from /usr/lib64/python2.7/site-packages
      certifi: 2016.9.26 from /usr/lib64/python2.7/site-packages
      backports_abc>=0.4: 0.5 from /home/flo/.local/lib64/python2.7/site-packages
    requests>=2.0: 2.12.4 from /usr/lib64/python2.7/site-packages
    Pykka>=1.1: 1.2.1 from /home/flo/.local/lib64/python2.7/site-packages
    setuptools: 32.3.1 from /home/flo/.local/lib64/python2.7/site-packages
  setuptools: 32.3.1 from /home/flo/.local/lib64/python2.7/site-packages
Mopidy-Moped: 0.7.0 from /home/flo/.local/lib64/python2.7/site-packages
  setuptools: 32.3.1 from /home/flo/.local/lib64/python2.7/site-packages
  Mopidy>=1.0.0: 2.0.1 from /home/flo/.local/lib64/python2.7/site-packages
    tornado>=2.3: 4.4.2 from /usr/lib64/python2.7/site-packages
      singledispatch: 3.4.0.3 from /usr/lib64/python2.7/site-packages
        six: 1.10.0 from /usr/lib64/python2.7/site-packages
      certifi: 2016.9.26 from /usr/lib64/python2.7/site-packages
      backports_abc>=0.4: 0.5 from /home/flo/.local/lib64/python2.7/site-packages
    requests>=2.0: 2.12.4 from /usr/lib64/python2.7/site-packages
    Pykka>=1.1: 1.2.1 from /home/flo/.local/lib64/python2.7/site-packages
    setuptools: 32.3.1 from /home/flo/.local/lib64/python2.7/site-packages
Mopidy-GMusic: 2.0.0 from /home/flo/.local/lib64/python2.7/site-packages
  setuptools: 32.3.1 from /home/flo/.local/lib64/python2.7/site-packages
  Pykka>=1.1: 1.2.1 from /home/flo/.local/lib64/python2.7/site-packages
  cachetools>=1.0: 2.0.0 from /home/flo/.local/lib64/python2.7/site-packages
  Mopidy>=1.0: 2.0.1 from /home/flo/.local/lib64/python2.7/site-packages
    tornado>=2.3: 4.4.2 from /usr/lib64/python2.7/site-packages
      singledispatch: 3.4.0.3 from /usr/lib64/python2.7/site-packages
        six: 1.10.0 from /usr/lib64/python2.7/site-packages
      certifi: 2016.9.26 from /usr/lib64/python2.7/site-packages
      backports_abc>=0.4: 0.5 from /home/flo/.local/lib64/python2.7/site-packages
    requests>=2.0: 2.12.4 from /usr/lib64/python2.7/site-packages
    Pykka>=1.1: 1.2.1 from /home/flo/.local/lib64/python2.7/site-packages
    setuptools: 32.3.1 from /home/flo/.local/lib64/python2.7/site-packages
  gmusicapi>=10.1: 10.1.0 from /home/flo/.local/lib64/python2.7/site-packages
    validictory!=0.9.2,>=0.8.0: 1.1.0 from /home/flo/.local/lib64/python2.7/site-packages
    decorator>=3.3.1: 4.0.2 from /usr/lib64/python2.7/site-packages
    mutagen>=1.34: 1.36 from /home/flo/.local/lib64/python2.7/site-packages
    requests!=1.2.0,!=2.2.1,!=2.8.0,!=2.8.1,>=1.1.0: 2.12.4 from /usr/lib64/python2.7/site-packages
    python-dateutil!=2.0,>=1.3: 2.4.2 from /usr/lib64/python2.7/site-packages
      six>=1.5: 1.10.0 from /usr/lib64/python2.7/site-packages
    proboscis>=1.2.5.1: 1.2.6.0 from /home/flo/.local/lib64/python2.7/site-packages
    protobuf>=3.0.0: 3.1.0.post1 from /home/flo/.local/lib64/python2.7/site-packages
      six>=1.9: 1.10.0 from /usr/lib64/python2.7/site-packages
      setuptools: 32.3.1 from /home/flo/.local/lib64/python2.7/site-packages
    oauth2client>=1.1: 2.0.1 from /usr/lib64/python2.7/site-packages
      httplib2>=0.9.1: 0.9.2 from /usr/lib64/python2.7/site-packages
      pyasn1>=0.1.7: 0.1.8 from /usr/lib64/python2.7/site-packages
      pyasn1-modules>=0.0.5: 0.0.5 from /usr/lib64/python2.7/site-packages
        pyasn1>=0.1.4: 0.1.8 from /usr/lib64/python2.7/site-packages
      rsa>=3.1.4: 3.2.3 from /usr/lib64/python2.7/site-packages
        pyasn1>=0.1.3: 0.1.8 from /usr/lib64/python2.7/site-packages
      six>=1.6.1: 1.10.0 from /usr/lib64/python2.7/site-packages
    mock>=0.7.0: 2.0.0 from /home/flo/.local/lib64/python2.7/site-packages
      funcsigs>=1; python_version < "3.3": 1.0.2 from /home/flo/.local/lib64/python2.7/site-packages
      six>=1.9: 1.10.0 from /usr/lib64/python2.7/site-packages
      pbr>=0.11: 1.10.0 from /usr/lib64/python2.7/site-packages
    appdirs>=1.1.0: 1.4.0 from /home/flo/.local/lib64/python2.7/site-packages
    gpsoauth>=0.2.0: 0.4.0 from /home/flo/.local/lib64/python2.7/site-packages
      pycryptodomex>=3.0: 3.4.3 from /home/flo/.local/lib64/python2.7/site-packages
      requests: 2.12.4 from /usr/lib64/python2.7/site-packages
    MechanicalSoup>=0.4.0: 0.6.0 from /home/flo/.local/lib64/python2.7/site-packages
      requests>=2.0: 2.12.4 from /usr/lib64/python2.7/site-packages
      beautifulsoup4: 4.5.1 from /home/flo/.local/lib64/python2.7/site-packages
      six>=1.4: 1.10.0 from /usr/lib64/python2.7/site-packages
    six>=1.9.0: 1.10.0 from /usr/lib64/python2.7/site-packages
    future: 0.16.0 from /home/flo/.local/lib64/python2.7/site-packages
  requests>=2.0: 2.12.4 from /usr/lib64/python2.7/site-packages
GStreamer: 1.8.3.0 from /usr/lib64/python2.7/site-packages/gi
  Detailed information: 
    Python wrapper: python-gi 3.20.1
    Relevant elements:
      Found:
        uridecodebin
        souphttpsrc
        appsrc
        alsasink
        pulsesink
        id3demux
        lamemp3enc
        mad
        mpegaudioparse
        mpg123audiodec
        vorbisdec
        vorbisenc
        vorbisparse
        oggdemux
        oggmux
        oggparse
        flacparse
      Not found:
        osssink
        oss4sink
        flump3dec
        id3v2mux
        flacdec
        shout2send
fgtham commented 7 years ago

Issue seems to be on Google's side. With the server returning HTTP 403, there's not much one can do.

belak commented 7 years ago

Grabbing the whole track at once would probably fix the issue but that's not as simple as it should be.

ghost commented 7 years ago

@wf1nder Can you try a different gstreamer package and let us know? I removed gstreamer0.10-0.10.36-16 and it seems to have cleared up the problem. The extension has always worked for me in the past before I started tinkering with my gstreamer plugins recently.

marcik4 commented 7 years ago

This issue started to happen for me in last few weeks - it was working stable before. Didn't update gstreamer.

xtedy commented 7 years ago

I have this problem too. I dont make any update

ERROR    GStreamer error: gst-resource-error-quark: Forbidden (15)
ERROR    GStreamer error: gst-resource-error-quark: Forbidden (15)
ERROR    GStreamer error: gst-resource-error-quark: Forbidden (15)
Executable: /usr/bin/mopidy
Platform: Linux-3.10.0-514.10.2.el7.x86_64-x86_64-with-centos-7.3.1611-Core
Python: CPython 2.7.5 from /usr/lib64/python2.7
Mopidy: 2.0.1 from /usr/lib/python2.7/site-packages
  setuptools: 28.8.0 from /usr/lib/python2.7/site-packages
  Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/site-packages
  requests>=2.0: 2.12.1 from /usr/lib/python2.7/site-packages
  tornado>=2.3: 4.4.2 from /usr/lib64/python2.7/site-packages
    backports.ssl_match_hostname: 3.5.0.1 from /usr/lib/python2.7/site-packages
    singledispatch: 3.4.0.3 from /usr/lib/python2.7/site-packages
      six: 1.10.0 from /usr/lib/python2.7/site-packages
    certifi: 2016.9.26 from /usr/lib/python2.7/site-packages
    backports_abc>=0.4: 0.5 from /usr/lib/python2.7/site-packages
Mopidy-GMusic: 2.0.0 from /usr/lib64/python2.7/site-packages
  cachetools>=1.0: 2.0.0 from /usr/lib/python2.7/site-packages
  Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/site-packages
  requests>=2.0: 2.12.1 from /usr/lib/python2.7/site-packages
  setuptools: 28.8.0 from /usr/lib/python2.7/site-packages
  gmusicapi>=10.1: 10.1.0 from /usr/lib/python2.7/site-packages
    validictory!=0.9.2,>=0.8.0: 1.1.0 from /usr/lib/python2.7/site-packages
    decorator>=3.3.1: 4.0.10 from /usr/lib/python2.7/site-packages
    mutagen>=1.34: 1.35.1 from /usr/lib/python2.7/site-packages
    requests!=1.2.0,!=2.2.1,!=2.8.0,!=2.8.1,>=1.1.0: 2.12.1 from /usr/lib/python2.7/site-packages
    python-dateutil!=2.0,>=1.3: 2.6.0 from /usr/lib/python2.7/site-packages
      six>=1.5: 1.10.0 from /usr/lib/python2.7/site-packages
    proboscis>=1.2.5.1: 1.2.6.0 from /usr/lib/python2.7/site-packages
    protobuf>=3.0.0: 3.1.0.post1 from /usr/lib/python2.7/site-packages
      setuptools: 28.8.0 from /usr/lib/python2.7/site-packages
      six>=1.9: 1.10.0 from /usr/lib/python2.7/site-packages
    oauth2client>=1.1: 4.0.0 from /usr/lib/python2.7/site-packages
      six>=1.6.1: 1.10.0 from /usr/lib/python2.7/site-packages
      pyasn1>=0.1.7: 0.1.9 from /usr/lib/python2.7/site-packages
      pyasn1-modules>=0.0.5: 0.0.8 from /usr/lib/python2.7/site-packages
        pyasn1>=0.1.8: 0.1.9 from /usr/lib/python2.7/site-packages
      rsa>=3.1.4: 3.4.2 from /usr/lib/python2.7/site-packages
        pyasn1>=0.1.3: 0.1.9 from /usr/lib/python2.7/site-packages
      httplib2>=0.9.1: 0.9.2 from /usr/lib/python2.7/site-packages
    mock>=0.7.0: 2.0.0 from /usr/lib/python2.7/site-packages
      funcsigs>=1; python_version < "3.3": 1.0.2 from /usr/lib/python2.7/site-packages
      pbr>=0.11: 1.10.0 from /usr/lib/python2.7/site-packages
      six>=1.9: 1.10.0 from /usr/lib/python2.7/site-packages
    appdirs>=1.1.0: 1.4.0 from /usr/lib/python2.7/site-packages
    gpsoauth>=0.2.0: 0.4.0 from /usr/lib/python2.7/site-packages
      pycryptodomex>=3.0: 3.4.3 from /usr/lib64/python2.7/site-packages
      requests: 2.12.1 from /usr/lib/python2.7/site-packages
    MechanicalSoup>=0.4.0: 0.6.0 from /usr/lib/python2.7/site-packages
      six>=1.4: 1.10.0 from /usr/lib/python2.7/site-packages
      requests>=2.0: 2.12.1 from /usr/lib/python2.7/site-packages
      beautifulsoup4: 4.5.1 from /usr/lib/python2.7/site-packages
    six>=1.9.0: 1.10.0 from /usr/lib/python2.7/site-packages
    future: 0.16.0 from /usr/lib/python2.7/site-packages
  Mopidy>=1.0: 2.0.1 from /usr/lib/python2.7/site-packages
    setuptools: 28.8.0 from /usr/lib/python2.7/site-packages
    Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/site-packages
    requests>=2.0: 2.12.1 from /usr/lib/python2.7/site-packages
    tornado>=2.3: 4.4.2 from /usr/lib64/python2.7/site-packages
      backports.ssl_match_hostname: 3.5.0.1 from /usr/lib/python2.7/site-packages
      singledispatch: 3.4.0.3 from /usr/lib/python2.7/site-packages
        six: 1.10.0 from /usr/lib/python2.7/site-packages
      certifi: 2016.9.26 from /usr/lib/python2.7/site-packages
      backports_abc>=0.4: 0.5 from /usr/lib/python2.7/site-packages
Mopidy-MusicBox-Webclient: 2.3.0 from /usr/lib/python2.7/site-packages
  setuptools: 28.8.0 from /usr/lib/python2.7/site-packages
  Mopidy>=1.1.0: 2.0.1 from /usr/lib/python2.7/site-packages
    setuptools: 28.8.0 from /usr/lib/python2.7/site-packages
    Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/site-packages
    requests>=2.0: 2.12.1 from /usr/lib/python2.7/site-packages
    tornado>=2.3: 4.4.2 from /usr/lib64/python2.7/site-packages
      backports.ssl_match_hostname: 3.5.0.1 from /usr/lib/python2.7/site-packages
      singledispatch: 3.4.0.3 from /usr/lib/python2.7/site-packages
        six: 1.10.0 from /usr/lib/python2.7/site-packages
      certifi: 2016.9.26 from /usr/lib/python2.7/site-packages
      backports_abc>=0.4: 0.5 from /usr/lib/python2.7/site-packages
Mopidy-Mopify: 1.6.0 from /usr/lib/python2.7/site-packages
  setuptools: 28.8.0 from /usr/lib/python2.7/site-packages
  Mopidy>=0.19: 2.0.1 from /usr/lib/python2.7/site-packages
    setuptools: 28.8.0 from /usr/lib/python2.7/site-packages
    Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/site-packages
    requests>=2.0: 2.12.1 from /usr/lib/python2.7/site-packages
    tornado>=2.3: 4.4.2 from /usr/lib64/python2.7/site-packages
      backports.ssl_match_hostname: 3.5.0.1 from /usr/lib/python2.7/site-packages
      singledispatch: 3.4.0.3 from /usr/lib/python2.7/site-packages
        six: 1.10.0 from /usr/lib/python2.7/site-packages
      certifi: 2016.9.26 from /usr/lib/python2.7/site-packages
      backports_abc>=0.4: 0.5 from /usr/lib/python2.7/site-packages
  ConfigObj: 5.0.6 from /usr/lib/python2.7/site-packages
    six: 1.10.0 from /usr/lib/python2.7/site-packages
Mopidy-Moped: 0.7.0 from /usr/lib/python2.7/site-packages
  setuptools: 28.8.0 from /usr/lib/python2.7/site-packages
  Mopidy>=1.0.0: 2.0.1 from /usr/lib/python2.7/site-packages
    setuptools: 28.8.0 from /usr/lib/python2.7/site-packages
    Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/site-packages
    requests>=2.0: 2.12.1 from /usr/lib/python2.7/site-packages
    tornado>=2.3: 4.4.2 from /usr/lib64/python2.7/site-packages
      backports.ssl_match_hostname: 3.5.0.1 from /usr/lib/python2.7/site-packages
      singledispatch: 3.4.0.3 from /usr/lib/python2.7/site-packages
        six: 1.10.0 from /usr/lib/python2.7/site-packages
      certifi: 2016.9.26 from /usr/lib/python2.7/site-packages
      backports_abc>=0.4: 0.5 from /usr/lib/python2.7/site-packages
Mopidy-Material-Webclient: 0.2.1 from /usr/lib/python2.7/site-packages
  setuptools: 28.8.0 from /usr/lib/python2.7/site-packages
  Mopidy>=1.0: 2.0.1 from /usr/lib/python2.7/site-packages
    setuptools: 28.8.0 from /usr/lib/python2.7/site-packages
    Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/site-packages
    requests>=2.0: 2.12.1 from /usr/lib/python2.7/site-packages
    tornado>=2.3: 4.4.2 from /usr/lib64/python2.7/site-packages
      backports.ssl_match_hostname: 3.5.0.1 from /usr/lib/python2.7/site-packages
      singledispatch: 3.4.0.3 from /usr/lib/python2.7/site-packages
        six: 1.10.0 from /usr/lib/python2.7/site-packages
      certifi: 2016.9.26 from /usr/lib/python2.7/site-packages
      backports_abc>=0.4: 0.5 from /usr/lib/python2.7/site-packages
  wifi>=0.3.4: 0.3.4 from /usr/lib/python2.7/site-packages
    setuptools: 28.8.0 from /usr/lib/python2.7/site-packages
    pbkdf2: 1.3 from /usr/lib/python2.7/site-packages
GStreamer: 1.10.2.0 from /usr/lib64/python2.7/site-packages/gi
  Detailed information: 
    Python wrapper: python-gi 3.14.0
    Relevant elements:
      Found:
        uridecodebin
        souphttpsrc
        appsrc
        alsasink
        osssink
        oss4sink
        pulsesink
        id3demux
        id3v2mux
        lamemp3enc
        mad
        mpegaudioparse
        vorbisdec
        vorbisenc
        vorbisparse
        oggdemux
        oggmux
        oggparse
        flacdec
        flacparse
        shout2send
      Not found:
        flump3dec
        mpg123audiodec
disconnect5852 commented 7 years ago

Same happens here, "GStreamer error: gst-resource-error-quark: Forbidden (15)" Everything is the newest. With mopidy-spotify there is no such error

marcik4 commented 7 years ago

BTW - not a proper solution, but I run now simple watchdog on the logs, and just tell mpd to play next song when this happens. It sucks, but better than a full stop.

tail -F /var/log/mopidy.log | awk '/GStreamer error: gst-resource-error-quark: Forbidden/ {system("mpc next")}'

kingosticks commented 7 years ago

Spotify uses a very different method of accessing gstreamer so it'd be interesting if any of the other backends showed this issue. Literally any other backend.

belak commented 7 years ago

I'd be interested in seeing if there's anything useful in the gmusicapi logs...

That's located at ~/.cache/gmusicapi/log/gmusicapi.log on linux. Please note that this may contain the clientID/deviceID, so you may want to edit those out.

disconnect5852 commented 7 years ago

No, nothing in that file when error, only the info about opening a new file, the normal things.

wf1nder commented 7 years ago

@sphaugh

Can you try a different gstreamer package and let us know?

Tried different versions of gstreamer before, in different linux distros, and have the same issue.

shark0der commented 7 years ago

Affects me as well and it's annoying as hell - literally can't listen to Google music anymore because of this, it just stops after a couple of minutes.

Since it's on Google's side, can't we mimic Google Music app and download the songs in a similar fashion?

belak commented 7 years ago

I'd love to do that, but then we'd need to manage our own cache directory and handle that sort of thing so we can hand mopidy local URLs... which would be possible since we're given IDs... but it would be a fairly large rewrite of the playback portion.

belak commented 7 years ago

Well, if it makes anyone here feel better, I can finally reproduce it. I'll see if I can nail it down and get an update here soon-ish.

belak commented 7 years ago

There's an experimental fix against mopidy here: https://github.com/mopidy/mopidy/pull/1608

I'm testing this locally, but this should fix the issue :crossed_fingers:. I've made it through 6 tracks so far and it's worked fine (before it would trigger after 1 or 2).

If anyone here is familiar with running mopidy from git and has been running into this, I'd appreciate more testers.

If you're not comfortable with that, it may help to set the bitrate to 160 rather than 320, but that's a temporary fix.

belak commented 7 years ago

There are a number of possibilities here, but the main complications are that gmusic stream URLs expire after 90 seconds and gstreamer will sometimes hit the URL more than once, possibly if the connection is closed (I didn't get that deep into debugging it).

Mopidy attempts to make this less of an issue by providing a fairly large buffer (5M) but also limits it to 5 seconds. I'm not sure how these values interact.

So, what I think is happening:

Other possibilities are weird interactions between the internal bitrate and what we're guessing... and the possibility that Google changed the default to 320. However, I don't have any insight into what happens at Google, so I can't know for sure what caused this.

I've now made it through a full album without any issues, so I think my hunch may be correct. :)

shark0der commented 7 years ago

I've installed it using pip install 'git+https://github.com/belak/mopidy@0d87a2a#egg=mopidy' --upgrade (correct me if there's something wrong).

I created a playlist with 6 podcasts (30-60') and I'm listening to them already for a couple of hours - works great! Thanks a lot!

shark0der commented 7 years ago

Found a track that still stops, pretty much reproducible every time, it stops around 4:10: gmusic:track:6e673e49-2035-3d06-9bf4-4ab511440ac7 (Dream Stalker by Hybrid, I Choose Noise (Bonus Track)). Total track length: 6:29.

After it stops, if I press the "|<<" (previous) button, it (probably retries the download and then) continues to play from where it stopped.

I can provide os & software versions / logs / other info as requested, can test PRs/commits if necessary.

belak commented 7 years ago

Is that an uploaded track, or an All Access track?

shark0der commented 7 years ago

All Access, that's why I gave its id :)

On Apr 3, 2017 20:30, "Kaleb Elwert" notifications@github.com wrote:

Is that an uploaded track, or an All Access track?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mopidy/mopidy-gmusic/issues/161#issuecomment-291214558, or mute the thread https://github.com/notifications/unsubscribe-auth/AAgSP__2shWAtN7pgx-ohzexckPXq433ks5rsSy3gaJpZM4LVN1z .

belak commented 7 years ago

Hm, I can't reproduce it with gmusic:track:Tuicpadq7f2stsgqw34rrkza6dq which seems to correspond to the song you mentioned. All Access track IDs should always start with a T, so I'm not sure where that UUID is even coming from.

shark0der commented 7 years ago

Got it using chrome's devtools (right click, inspect). It's probably worth mentioning that I'm not using a raspberry pie, mopidy is installed using pip on a Ubuntu 14.04 server. Can provide more details if needed (versions, logs, etc).

On Apr 3, 2017 20:52, "Kaleb Elwert" notifications@github.com wrote:

Hm, I can't reproduce it with gmusic:track:Tuicpadq7f2stsgqw34rrkza6dq which seems to correspond to the song you mentioned. All Access track IDs should always start with a T, so I'm not sure where that UUID is even coming from.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mopidy/mopidy-gmusic/issues/161#issuecomment-291220694, or mute the thread https://github.com/notifications/unsubscribe-auth/AAgSP9wxmKRe8VOj6aXmj1jh_sE8jSShks5rsTHYgaJpZM4LVN1z .

belak commented 7 years ago

Easiest way is to get it from the "share" link on the official web frontend. That works for albums, artists and tracks.

belak commented 7 years ago

This issue does seem to happen much more on the rPI... I guess my fix doesn't fix it everywhere.

xtedy commented 7 years ago

pip install 'git+https://github.com/belak/mopidy@0d87a2a#egg=mopidy' --upgrade works great for me . Thanks

shark0der commented 7 years ago

Easiest way is to get it from the "share" link on the official web frontend

Can you tell me please which one is the official frontend? I have a couple of them installed but none has a "share" link on a album/artist.

image

kingosticks commented 7 years ago

I think he's referring to https://play.google.com/music

shark0der commented 7 years ago

Just FYI, I was able to find the song using the search form, by the song id I mentioned (6e673e49-2035-3d06-9bf4-4ab511440ac7). Didn't work with Tuicpadq7f2stsgqw34rrkza6dq.

image

shark0der commented 7 years ago

I took a look at my config and noticed that I've set the bitrate for Google Music to 320:

[gmusic]
deviceid = [redacted]
username = [redacted]
password = [redacted]
bitrate = 320

I believe this is what it makes it not being reproducible on your end. It seems to have only 3 valid values: 128, 160, and 320. Setting it to 160 kinda defeats the purpose of having an audio system (or an audio DAC in case of a rPi).

ernesst commented 7 years ago

Thanks gents, i got the same problem after upgrading.

To fix it : pip install 'git+https://github.com/belak/mopidy@develop#egg=mopidy' --upgrade

belak commented 7 years ago

That actually shouldn't fix it, @ernesst. You'd need to base it on the add-download-flag-to-playbin branch, not develop. So, pip install git+https://github.com/belak/mopidy@add-download-flag-to-playbin#egg=mopidy' --upgrade

There's a PR open against mopidy, so I hope that gets some traction soon.

ernesst commented 7 years ago

Thanks for the feedback, i'm changing revision now. the corrected code is pip install 'git+https://github.com/belak/mopidy@add-download-flag-to-playbin#egg=mopidy' --upgrade

Fortunatly my mopidy was more stable with the develop version... i'll keep you update with this one.

marcik4 commented 7 years ago

@shark0der - I use 320 bitrate and it's working fine for me with a fix. Double check that you have fixed code?

in mopidy/audio/actor.py you should have a line:

_GST_PLAY_FLAGS_AUDIO = 0x02 + 0x80

(https://github.com/mopidy/mopidy/pull/1608/commits/0d87a2af150cb12f42e65aca01fa745cf8116ed9)

ernesst commented 7 years ago

@belak, After testing this week-end i came back on the develop git, this one solve my playing stop after couple of songs with the error mentioned in the initial post.

jjok commented 7 years ago

I'd love to do that, but then we'd need to manage our own cache directory and handle that sort of thing so we can hand mopidy local URLs... which would be possible since we're given IDs... but it would be a fairly large rewrite of the playback portion.

@belak Could caching the entire current track be a feature to add to Mopidy? Does it already support it? Is it something that Gstreamer supports?

I often have playback issues on Deezer that I think may be solved by that kind of feature. https://github.com/rusty-dev/mopidy-deezer/issues/10

belak commented 7 years ago

I don't know for certain, but if I had to guess, caching like that is a pretty big legal grey area. gstreamer has a flag on the playbin (the one mentioned above) which will attempt to download the entire track rather than just streaming it as it plays, but other than that I don't think there's support for track caching in gstreamer or mopidy.

ghost commented 7 years ago

I haven't tested the changes yet, but FWIW this has started happening to me on the official Android app...

shark0der commented 7 years ago

@marcik4 yes, I do have that line:

$ grep _GST_PLAY_FLAGS_AUDIO -B 1 /usr/local/lib/python2.7/dist-packages/mopidy/audio/actor.py
# 0x02 specifies "audio" and 0x80 specifies "download"
_GST_PLAY_FLAGS_AUDIO = 0x02 + 0x80
--
        playbin = Gst.ElementFactory.make('playbin')
        playbin.set_property('flags', _GST_PLAY_FLAGS_AUDIO)

I've switched to 160 bitrate and it keeps happening, even with short songs. I simply cannot use gmusic anymore.

More info:

$ python --version
Python 2.7.6

$ pip --version
pip 9.0.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)

$ mopidy --version
Mopidy 2.1.0

$ pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
appdirs (1.4.3)
apt-xapian-index (0.45)
backports-abc (0.5)
backports.ssl-match-hostname (3.5.0.1)
beautifulsoup4 (4.5.1)
cachetools (2.0.0)
certifi (2017.4.17)
cffi (1.8.3)
chardet (2.0.1)
colorama (0.2.5)
configobj (5.0.6)
cryptography (1.5.3)
decorator (4.0.11)
distro-info (0.12)
docutils (0.12)
enum34 (1.1.6)
euca2ools (3.0.1)
eyeD3 (0.7.11)
funcsigs (1.0.2)
future (0.16.0)
gmusicapi (10.1.1)
gmusicproxy (1.0.9b1, /root/src/gmusicproxy)
gpsoauth (0.4.1)
html5lib (0.999)
httplib2 (0.9.2)
idna (2.1)
ipaddress (1.0.17)
lockfile (0.12.2)
lxml (3.3.3)
MechanicalSoup (0.6.0)
mock (2.0.0)
Mopidy (2.1.0)
Mopidy-GMusic (2.0.0)
Mopidy-Iris (2.13.7)
Mopidy-Local-Images (1.0.0)
Mopidy-Local-SQLite (1.0.0)
Mopidy-Material-Webclient (0.2.1)
Mopidy-Moped (0.7.0)
Mopidy-MusicBox-Webclient (2.3.0)
Mopidy-SoundCloud (2.0.2)
Mopidy-Spotify (3.0.0)
Mopidy-TuneIn (0.4.1)
Mopidy-Youtube (2.0.2)
mutagen (1.37)
MySQL-python (1.2.3)
ndg-httpsclient (0.4.2)
netifaces (0.10.5)
oauth2client (4.0.0)
packaging (16.8)
pafy (0.5.2)
pbkdf2 (1.3)
pbr (1.10.0)
pip (9.0.1)
pip-review (0.5)
proboscis (1.2.6.0)
protobuf (3.2.0)
pyasn1 (0.1.9)
pyasn1-modules (0.0.8)
pycparser (2.17)
pycryptodome (3.4.3)
pycryptodomex (3.4.5)
pycurl (7.19.3)
pygobject (3.12.0)
Pykka (1.2.1)
pylast (1.8.0)
pyOpenSSL (16.2.0)
pyparsing (2.2.0)
pyspotify (2.0.5)
python-apt (0.9.3.5ubuntu2)
python-daemon (2.1.2)
python-dateutil (2.6.0)
python-debian (0.1.21-nmu2ubuntu2)
pyxdg (0.25)
requestbuilder (0.1.0b1)
requests (2.13.0)
rsa (3.4.2)
setuptools (35.0.1)
singledispatch (3.4.0.3)
six (1.10.0)
spotipy (2.4.4)
ssh-import-id (3.21)
tornado (4.5)
uritools (2.0.0)
urllib3 (1.7.1)
urwid (1.1.1)
validictory (1.1.0)
wheel (0.24.0)
wifi (0.3.8)

Any help is appreciated =/

kingosticks commented 7 years ago

mopidy deps is generally more interesting as it also includes Gstreamer versions.

This may or may not be useful... but perhaps it's worth trying to capture a gstreamer log to see what it's doing differently when it works and when it doesn't: GST_DEBUG=3 mopidy -v. Note that this will produce a lot of output.

morenocruzf commented 7 years ago

@belak

There's an experimental fix against mopidy here: mopidy/mopidy#1608 I'm testing this locally, but this should fix the issue :crossed_fingers:. I've made it through 6 tracks so far and it's worked fine (before it would trigger after 1 or 2). If anyone here is familiar with running mopidy from git and has been running into this, I'd appreciate more testers. If you're not comfortable with that, it may help to set the bitrate to 160 rather than 320, but that's a temporary fix.

Sorry guys, I don't get it. Does this solve the issue or is with the bitrate or is it still un-solved?

Thanks for your work guys, really looking forward to listening a whole playlist for once xD

EDIT: I have Pi3 with Raspbian Jessie and mopidy though EDIT2: After installing it with sudo pip install 'git+https://github.com/belak/mopidy@0d87a2 a#egg=mopidy' --upgrade I get lot of warnings and Mopidy won't work anymore:

● mopidy.service - Mopidy music server
   Loaded: loaded (/lib/systemd/system/mopidy.service; enabled)
   Active: failed (Result: exit-code) since Sat 2017-04-22 19:39:32 CEST; 4s ago
  Process: 1529 ExecStart=/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf (code=exited, status=1/FAILURE)
  Process: 1525 ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy (code=exited, status=0/SUCCESS)
  Process: 1521 ExecStartPre=/bin/mkdir -p /var/cache/mopidy (code=exited, status=0/SUCCESS)
 Main PID: 1529 (code=exited, status=1/FAILURE)
maemigh commented 7 years ago

I've tested pip install 'git+https://github.com/belak/mopidy@develop#egg=mopidy' --upgrade and it seems to be more stable, but still occasionally fails to load the next track in the playlist.

belak commented 7 years ago

There were a few reports of people seeing that with mopidy in general and not just gmusic which need to be looked into. Are you still seeing the "GStreamer error" when mopidy fails to load the next track?

maemigh commented 7 years ago

These are the errors I see in the log from earlier:

2017-05-02 11:54:08,176 WARNING [28347:MainThread] mopidy.audio.gst: GStreamer warning: gst-stream-error-quark: No volume control found (3)
2017-05-02 12:09:12,072 WARNING [28347:Dummy-20] py.warnings: sys:1: Warning: g_timer_continue: assertion 'timer->active == FALSE' failed

Not sure at what time mopidy stopped playing, but when it failed to load the next track it also stopped being responsive and needed a manual kill and restart.

morenocruzf commented 7 years ago

The error failing to load "next" track 2017-05-02 12:09:12,072 WARNING [28347:Dummy-20] py.warnings: sys:1: Warning: g_timer_continue: assertion 'timer->active == FALSE' failed might be mopidy itself: a buggy version or a config error. I've dived around this forum and I haven't read it much (at least without solution). So keep trying buddy, sure you fix it finally.

The hidden bug unfortunately is with gmusic functionality. There's no solution so far for the random stops. It might work for a whole day without a single error or just 5 songs in a row. ERROR GStreamer error: gst-resource-error-quark: Forbidden (15)


I think also, that a lot of us have this issue too. But as far as I know, without solution either yet. GStreamer warning: gst-stream-error-quark: No volume control found (3)

juanghurtado commented 7 years ago

Same problem here. It randomly stops playing. Sometimes I can be playing music for hours, and suddenly I can't have no more than 1 minute of continuous play.

I thought that maybe downgrading the bitrate to 192 or lower would help, and so it was for some time, but here we are again.

belak commented 7 years ago

@juanghurtado Have you tried the commit mentioned, or is that with the stable version of mopidy?

Also, this issue is about mopidy stopping in the middle of a track. If you're having issues with it going to the next track, please feel free to file that as a separate issue, otherwise it will get confusing trying to debug two potentially unrelated issues in the same thread.

juanghurtado commented 7 years ago

I'm sorry if I wasn't clear enough: my problem is the same, it randomly stops playing in the middle of a song.

My mopidy deps is:

Executable: /usr/local/bin/mopidy
Platform: Darwin-15.6.0-x86_64-i386-64bit
Python: CPython 2.7.13 from /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7
Mopidy: 2.1.0 from /usr/local/lib/python2.7/site-packages
  Pykka>=1.1: 1.2.1 from /usr/local/lib/python2.7/site-packages
  requests>=2.0: 2.11.0 from /usr/local/lib/python2.7/site-packages
  setuptools: 32.1.0 from /usr/local/lib/python2.7/site-packages
  tornado>=3.2: 4.4.1 from /usr/local/lib/python2.7/site-packages
    singledispatch: 3.4.0.3 from /usr/local/lib/python2.7/site-packages
      six: 1.10.0 from /usr/local/lib/python2.7/site-packages
    certifi: 2016.8.8 from /usr/local/lib/python2.7/site-packages
    backports_abc>=0.4: 0.4 from /usr/local/lib/python2.7/site-packages
Mopidy-Subsonic: 1.0.0 from /usr/local/lib/python2.7/site-packages
  Pykka>=1.1: 1.2.1 from /usr/local/lib/python2.7/site-packages
  py-sonic: 0.6.2 from /usr/local/lib/python2.7/site-packages
  setuptools: 32.1.0 from /usr/local/lib/python2.7/site-packages
  Mopidy>=1.0: 2.1.0 from /usr/local/lib/python2.7/site-packages
    Pykka>=1.1: 1.2.1 from /usr/local/lib/python2.7/site-packages
    requests>=2.0: 2.11.0 from /usr/local/lib/python2.7/site-packages
    setuptools: 32.1.0 from /usr/local/lib/python2.7/site-packages
    tornado>=3.2: 4.4.1 from /usr/local/lib/python2.7/site-packages
      singledispatch: 3.4.0.3 from /usr/local/lib/python2.7/site-packages
        six: 1.10.0 from /usr/local/lib/python2.7/site-packages
      certifi: 2016.8.8 from /usr/local/lib/python2.7/site-packages
      backports_abc>=0.4: 0.4 from /usr/local/lib/python2.7/site-packages
Mopidy-GMusic: 2.0.0 from /usr/local/lib/python2.7/site-packages
  Mopidy>=1.0: 2.1.0 from /usr/local/lib/python2.7/site-packages
    Pykka>=1.1: 1.2.1 from /usr/local/lib/python2.7/site-packages
    requests>=2.0: 2.11.0 from /usr/local/lib/python2.7/site-packages
    setuptools: 32.1.0 from /usr/local/lib/python2.7/site-packages
    tornado>=3.2: 4.4.1 from /usr/local/lib/python2.7/site-packages
      singledispatch: 3.4.0.3 from /usr/local/lib/python2.7/site-packages
        six: 1.10.0 from /usr/local/lib/python2.7/site-packages
      certifi: 2016.8.8 from /usr/local/lib/python2.7/site-packages
      backports_abc>=0.4: 0.4 from /usr/local/lib/python2.7/site-packages
  Pykka>=1.1: 1.2.1 from /usr/local/lib/python2.7/site-packages
  requests>=2.0: 2.11.0 from /usr/local/lib/python2.7/site-packages
  setuptools: 32.1.0 from /usr/local/lib/python2.7/site-packages
  gmusicapi>=10.1: 10.1.2 from /usr/local/lib/python2.7/site-packages
    MechanicalSoup>=0.4.0: 0.6.0 from /usr/local/lib/python2.7/site-packages
      six>=1.4: 1.10.0 from /usr/local/lib/python2.7/site-packages
      requests>=2.0: 2.11.0 from /usr/local/lib/python2.7/site-packages
      beautifulsoup4: 4.5.3 from /usr/local/lib/python2.7/site-packages
    mutagen>=1.34: 1.37 from /usr/local/lib/python2.7/site-packages
    requests!=1.2.0,!=2.12.0,!=2.12.1,!=2.12.2,!=2.2.1,!=2.8.0,!=2.8.1,>=1.1.0: 2.11.0 from /usr/local/lib/python2.7/site-packages
    python-dateutil!=2.0,>=1.3: 2.6.0 from /usr/local/lib/python2.7/site-packages
      six>=1.5: 1.10.0 from /usr/local/lib/python2.7/site-packages
    decorator>=3.3.1: 4.0.11 from /usr/local/lib/python2.7/site-packages
    mock>=0.7.0: 2.0.0 from /usr/local/lib/python2.7/site-packages
      pbr>=0.11: 3.0.0 from /usr/local/lib/python2.7/site-packages
      funcsigs>=1; python_version < "3.3": 1.0.2 from /usr/local/lib/python2.7/site-packages
      six>=1.9: 1.10.0 from /usr/local/lib/python2.7/site-packages
    future: 0.16.0 from /usr/local/lib/python2.7/site-packages
    validictory!=0.9.2,>=0.8.0: 1.1.1 from /usr/local/lib/python2.7/site-packages
    proboscis>=1.2.5.1: 1.2.6.0 from /usr/local/lib/python2.7/site-packages
    gpsoauth>=0.2.0: 0.4.1 from /usr/local/lib/python2.7/site-packages
      requests: 2.11.0 from /usr/local/lib/python2.7/site-packages
      pycryptodomex>=3.0: 3.4.5 from /usr/local/lib/python2.7/site-packages
    oauth2client>=1.1: 4.0.0 from /usr/local/lib/python2.7/site-packages
      pyasn1>=0.1.7: 0.2.3 from /usr/local/lib/python2.7/site-packages
      pyasn1-modules>=0.0.5: 0.0.8 from /usr/local/lib/python2.7/site-packages
        pyasn1>=0.1.8: 0.2.3 from /usr/local/lib/python2.7/site-packages
      six>=1.6.1: 1.10.0 from /usr/local/lib/python2.7/site-packages
      httplib2>=0.9.1: 0.10.3 from /usr/local/lib/python2.7/site-packages
      rsa>=3.1.4: 3.4.2 from /usr/local/lib/python2.7/site-packages
        pyasn1>=0.1.3: 0.2.3 from /usr/local/lib/python2.7/site-packages
    protobuf>=3.0.0: 3.3.0 from /usr/local/lib/python2.7/site-packages
      setuptools: 32.1.0 from /usr/local/lib/python2.7/site-packages
      six>=1.9: 1.10.0 from /usr/local/lib/python2.7/site-packages
    six>=1.9.0: 1.10.0 from /usr/local/lib/python2.7/site-packages
    appdirs>=1.1.0: 1.4.3 from /usr/local/lib/python2.7/site-packages
  cachetools>=1.0: 2.0.0 from /usr/local/lib/python2.7/site-packages
GStreamer: 1.10.4.0 from /usr/local/lib/python2.7/site-packages/gi
  Detailed information: 
    Python wrapper: python-gi 3.24.1
    Relevant elements:
      Found:
        uridecodebin
        souphttpsrc
        appsrc
        oss4sink
        id3demux
        id3v2mux
        lamemp3enc
        mad
        mpegaudioparse
        vorbisdec
        vorbisenc
        vorbisparse
        oggdemux
        oggmux
        oggparse
        flacdec
        flacparse
        shout2send
      Not found:
        alsasink
        osssink
        pulsesink
        flump3dec
        mpg123audiodec

Platform: OSX, mopidy installed through Homebrew.

gzurowski commented 7 years ago

I experience the same issues with mopidy-gmusic as initially described. The proposed fix (commit 0d87a2a) seems to fix the issue, but introduces stability issues where mopidy crashes after a couple of hours of activity. Did anyone else observe similar behavior?

jcgruenhage commented 7 years ago

To get this right, the problem is that the stream expires, because the stream that the play music api provides is only working for some time, which is shorter than most songs, correct? If that is the problem, why not do what gmusicproxy is doing, or use that in general? It provides static streams which don't expire.