Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetching likes list from soundcloud crashes ncmpcpp #45

Closed
laur89 opened this issue Jan 25, 2015 · 3 comments
Closed

Fetching likes list from soundcloud crashes ncmpcpp #45

laur89 opened this issue Jan 25, 2015 · 3 comments
Milestone

Comments

@laur89
Copy link

laur89 commented Jan 25, 2015

This sound more like ncmpcpp issue really, but can't quite believe it.
Fetcing likes list causes ncmpcpp to crash with the following message in console, leaving terminal instance unusable:

ncmpcpp: src/send.c:61: send_check: Assertion 'connection != ((void *)0)' failed.
Connected to localhost!                                                          Aborted

mopidy log looks okay to me. It appears to be successful fetching the tracks. Could it be related to fact the likes list is somewhat largeish, totaling ~370 items? Playing small sets has no issues whatsoever.

#   Mopidy 0.19.5
#   Mopidy-HTTP 0.19.5
#   Mopidy-Local 0.19.5
#   Mopidy-MPD 0.19.5
#   Mopidy-SoftwareMixer 0.19.5
#   Mopidy-SoundCloud 1.2.5
#   Mopidy-Spotify 1.2.0
#   Mopidy-Stream 0.19.5

Note: hand-patched the changes introduced by 461ef6c and ac137b2

full log @ http://pastebin.com/Sicnuw45

On an unrelated note, is it normal that mopidy is detecting connections all over the 48XXX port range?
After launching mopidy. it prints information about new mpd connections every second:

[..]
INFO     New MPD connection from [::ffff:127.0.0.1]:48838
INFO     New MPD connection from [::ffff:127.0.0.1]:48840
INFO     New MPD connection from [::ffff:127.0.0.1]:48842
INFO     New MPD connection from [::ffff:127.0.0.1]:48844
INFO     New MPD connection from [::ffff:127.0.0.1]:48846
INFO     New MPD connection from [::ffff:127.0.0.1]:48848
INFO     New MPD connection from [::ffff:127.0.0.1]:48850
INFO     New MPD connection from [::ffff:127.0.0.1]:48852
INFO     New MPD connection from [::ffff:127.0.0.1]:48854
[..]
@adamcik
Copy link
Member

adamcik commented Jan 25, 2015

Those port numbers are the outgoing ports that ncmcpp is using, which is picked at random within a given range by the kernel as ncmcpp doesn't specify a source port.

@laur89
Copy link
Author

laur89 commented Jan 25, 2015

Atm it appears to be related to two different aspects:
a) the request limit needs to be brought from 1000 down to ~50;
b) soundcloud.py.get_user_liked() should look something like this:

def get_user_liked(self):
    likes = []
    liked = self._get('e1/me/likes.json?limit=50')

    for data in liked:
        track = data['track']
        if track:
            parsed_track = self.parse_track(track)
            pl = data['playlist']

            if parsed_track:
                likes.append(parsed_track)
            if pl:
                likes.append((pl['title'], str(pl['id'])))
    return likes

Otherwise there's good chance that parse_track() returns empty array, thus creating problems, since empty element is pushed to likes.
There's also some uri parsing issue for some tracks:

File "/usr/lib/python2.7/dist-packages/mopidy/backend/__init__.py", line 164, in play
    self.change_track(track)
  File "/usr/lib/python2.7/dist-packages/mopidy/backend/__init__.py", line 177, in change_track
    self.audio.set_uri(track.uri).get()
AttributeError: 'list' object has no attribute 'uri'

@jodal
Copy link
Member

jodal commented Jan 27, 2016

Parts of this is fixed by #69. If the other parts are still an issue, please open a new issue.

@jodal jodal closed this as completed Jan 27, 2016
@jodal jodal added this to the v2.1 milestone Jun 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants