Saiyato / volumio-lastfm-plugin

Plugin to scrobble music played in Volumio 2.x to LastFM.
7 stars 8 forks source link

Internal error triggers volumio restart when selecting a new song #3

Closed emanjavacas closed 6 years ago

emanjavacas commented 6 years ago

Hi,

I am trying your plugin, but I don't seem to be able to make it work. I've set up the API configuration with my key and secret. But when I select a song, volumio restarts. This is what I've been able to dig out from the volumio journal:

Dec 29 15:19:52 volumio volumio[17741]: info: STATE SERVICE {"status":"play","position":0,"seek":0,"duration":170,"samplerate":"44.1 KHz","bitdepth":"24 bit","channels":2,"random":false,"updatedb":false,"repeat":false,"isStreaming":false,"title":"Do the Du","artist":"A Certain Ratio","album":"The Old & The New","uri":"USB/MEDIA/Music/Quique/A Certain Ratio/The Old & The New/1-02 Do the Du.mp3","trackType":"mp3"}
Dec 29 15:19:52 volumio volumio[17741]: info: CURRENT POSITION 196
Dec 29 15:19:52 volumio volumio[17741]: info: [1514560792935] CoreStateMachine::syncState   stateService play
Dec 29 15:19:52 volumio volumio[17741]: info: [1514560792936] CoreStateMachine::syncState   currentStatus stop
Dec 29 15:19:52 volumio volumio[17741]: info: [1514560792937] CoreStateMachine::pushState
Dec 29 15:19:52 volumio volumio[17741]: info: [1514560792938] CoreStateMachine::getState
Dec 29 15:19:52 volumio volumio[17741]: info: [1514560792939] CorePlayQueue::getTrack 196
Dec 29 15:19:52 volumio volumio[17741]: info: CoreCommandRouter::volumioPushState
Dec 29 15:19:52 volumio volumio[17741]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Dec 29 15:19:52 volumio volumio[17741]: info: [1514560792943] interfaceApi::pushState
Dec 29 15:19:52 volumio volumio[17741]: info: [1514560792944] InterfaceWebUI::pushState
Dec 29 15:19:52 volumio volumio[17741]: info: [1514560792993] ------------------------------ 93ms
Dec 29 15:19:52 volumio volumio[17741]: info: Pushing Favourites {"service":"mpd","uri":"mnt/USB/MEDIA/Music/Quique/A Certain Ratio/The Old & The New/1-02 Do the Du.mp3","favourite":false}
Dec 29 15:19:53 volumio volumio[17741]: info: [1514560792999] parsing response...
Dec 29 15:19:53 volumio volumio[17741]: info: [1514560793000] ControllerMpd::parseState
Dec 29 15:19:53 volumio volumio[17741]: info: [1514560793002] ControllerMpd::sendMpdCommand playlistinfo
Dec 29 15:19:53 volumio volumio[17741]: info: [1514560793003] sending command...
Dec 29 15:19:53 volumio volumio[17741]: info: [LastFM] timer should be there... using the existing instance
Dec 29 15:19:53 volumio volumio[17741]: info: --------------------------------------------------------------------// [LastFM] new state has been pushed; status: play | service: mpd | duration: 170 | title: Do the Du | previous title:
Dec 29 15:19:53 volumio volumio[17741]: info: [LastFM] artist and song are (still) the same; but not necessarily no update.
Dec 29 15:19:53 volumio volumio[17741]: info: [LastFM] trying to authenticate...
Dec 29 15:19:53 volumio volumio[17741]: crypto.js:74
Dec 29 15:19:53 volumio volumio[17741]: this._handle.update(data, encoding);
Dec 29 15:19:53 volumio volumio[17741]: ^
Dec 29 15:19:53 volumio volumio[17741]: TypeError: Data must be a string or a buffer
Dec 29 15:19:53 volumio volumio[17741]: at TypeError (native)
Dec 29 15:19:53 volumio volumio[17741]: at Hash.update (crypto.js:74:16)
Dec 29 15:19:53 volumio volumio[17741]: at md5 (/data/plugins/miscellanea/lastfm/node_modules/simple-lastfm/lib/index.js:415:34)
Dec 29 15:19:53 volumio volumio[17741]: at Lastfm.getSessionKey (/data/plugins/miscellanea/lastfm/node_modules/simple-lastfm/lib/index.js:80:38)
Dec 29 15:19:53 volumio volumio[17741]: at ControllerLastFM.updateNowPlaying (/data/plugins/miscellanea/lastfm/index.js:459:7)
Dec 29 15:19:53 volumio volumio[17741]: at Socket.<anonymous> (/data/plugins/miscellanea/lastfm/index.js:96:10)
Dec 29 15:19:53 volumio volumio[17741]: at Socket.Emitter.emit (/data/plugins/miscellanea/lastfm/node_modules/component-emitter/index.js:133:20)
Dec 29 15:19:53 volumio volumio[17741]: at Socket.onevent (/data/plugins/miscellanea/lastfm/node_modules/socket.io-client/lib/socket.js:270:10)
Dec 29 15:19:53 volumio volumio[17741]: at Socket.onpacket (/data/plugins/miscellanea/lastfm/node_modules/socket.io-client/lib/socket.js:228:12)
Dec 29 15:19:53 volumio volumio[17741]: at Manager.<anonymous> (/data/plugins/miscellanea/lastfm/node_modules/component-bind/index.js:21:15)
Dec 29 15:19:53 volumio volumio[17741]: at Manager.Emitter.emit (/data/plugins/miscellanea/lastfm/node_modules/component-emitter/index.js:133:20)
Dec 29 15:19:53 volumio volumio[17741]: at Manager.ondecoded (/data/plugins/miscellanea/lastfm/node_modules/socket.io-client/lib/manager.js:345:8)
Dec 29 15:19:53 volumio volumio[17741]: at Decoder.<anonymous> (/data/plugins/miscellanea/lastfm/node_modules/component-bind/index.js:21:15)
Dec 29 15:19:53 volumio volumio[17741]: at Decoder.Emitter.emit (/data/plugins/miscellanea/lastfm/node_modules/component-emitter/index.js:133:20)
Dec 29 15:19:53 volumio volumio[17741]: at Decoder.add (/data/plugins/miscellanea/lastfm/node_modules/socket.io-parser/index.js:241:12)
Dec 29 15:19:53 volumio volumio[17741]: at Manager.ondata (/data/plugins/miscellanea/lastfm/node_modules/socket.io-client/lib/manager.js:335:16)

Seems to come from crypto, could it be that the password isnt' being passed over?

Saiyato commented 6 years ago

I have not seen this behaviour... if your password contains special characters, can you try changing it and see if it solves the problem?

emanjavacas commented 6 years ago

Mmh, it doesn't really solve the issue...

I've noticed crypto is not in the package dependencies list. Could this be an issue with the crypto version? The one in my lastfm plugin node_modules is 1.0.1

Saiyato commented 6 years ago

Not entirely sure, but will update the package.json to include all needed deps.

cortegedusage commented 6 years ago

I have the same behaviour.. had it working, think i might have updated volumio And then it happend

emanjavacas commented 6 years ago

Yeh, I am also running the very last version of Volumio. That'd be a good pointer where to start looking at!

2017-12-31 15:04 GMT+01:00 cortegedusage notifications@github.com:

I have the same behaviour.. had it working, think i might have updated volumio And then it happend

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Saiyato/volumio-lastfm-plugin/issues/3#issuecomment-354605596, or mute the thread https://github.com/notifications/unsubscribe-auth/AF6Ho580s91qhfvDWsHrNzhrjcxf0Nrkks5tF5SIgaJpZM4RPMQa .

-- Enrique Manjavacas.

Jucgshu commented 6 years ago

Add me to the list. Problem is only present on the Volumio repoitory, not from the the package on Github.

I opened a forum post here: https://volumio.org/forum/lastfm-scrobbler-plugin-crashes-volumio-t8473.html

-j

cortegedusage commented 6 years ago

wow you are absolutely right, just installed zip from github and its scrobling out of the box...

2018-01-02 19:25 GMT+01:00 Jucgshu notifications@github.com:

Add me to the list. Problem is only present on the Volumio repoitory, not from the the package on Github.

I opened a forum post here: https://volumio.org/forum/ lastfm-scrobbler-plugin-crashes-volumio-t8473.html

-j

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Saiyato/volumio-lastfm-plugin/issues/3#issuecomment-354839231, or mute the thread https://github.com/notifications/unsubscribe-auth/AV69TXrvqkayCfZyNRcANTj-XUA_aKKCks5tGnSfgaJpZM4RPMQa .

Saiyato commented 6 years ago

I know what the problem is, although I don't know how I can fix this. To enable to 'now playing' option and the token (so I don't have to save the password) I heavily modified the simple-lastfm module.

I don't really want to PR my changes, as chances are slim they are ever going to be committed.

So I need to create an NPM package myself... somehow...

This is because the Volumio-repo is stripped of all modules, actually the main reason why the snapcast plugin has not yet been committed.

Saiyato commented 6 years ago

Should be fixed, I created PR https://github.com/volumio/volumio-plugins/pull/118 for this