Kodi Community Forum

Full Version: Spotify for Kodi
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi i am running win 11 and kodi 22  i have bought a account with spotify  after doing the cookie etc it worked then it wont work i have got user name and password in spotify xml   even restarted kodi  .any thoughts thanks
(2023-10-12, 15:29)kthxbye Wrote: [ -> ]
(2023-10-11, 01:01)glk1001 Wrote: [ -> ]
(2023-10-10, 19:57)kthxbye Wrote: [ -> ]https://en.wikipedia.org/wiki/Amazon_Fire_TV
yeah here it is:
https://pastebin.com/8LRdkC50

It plays for some time, but then stops and skips to the next track + in a few situations it would error with wrong user/password, but that happened only 2 or 3 times
It streams for about 30 seconds then times out. So there's probably a timeout setting somewhere. I'll have a look. Is the device you're using pretty slow?

hi! the device is rooted amazon fire tv stick 4k. not sure if thats considered to be slow? it does handle most of the audio/video stuff I let it play, but spotify might be a different story in this context. mostly using it to stream some inet radio stations, mp3/flac/wav and videos from a nas
PS it did play  much longer then 30 seconds in some cases. even played few songs without interrupting, so not sure about a particular times limit that is set somewhere?

PPS I looked up the specs - 4x ARM Cortex - A55 up to 2.0 GHz with 1.5gb of ram. not much ram, so could that be the case?

Hi, This is pretty difficult to figure out. I tried a Firestick Lite and it worked fine with the Spotify plugin. It's specs are:

Running on Amazon AFTSS with Android TV 9.0.0 API level 28, kernel: Linux ARM 32-bit version 4.4.162+
FFmpeg version/source: 4.4.1-Kodi
Host CPU: ARMv7 Processor rev 4 (v7l), 4 cores available
Product: sheldon, Device: sheldon, Board: sheldon - Manufacturer: Amazon, Brand: Amazon, Model: AFTSS, Hardware: mt8695

It has only 1GB of RAM so I don't think RAM is the issue. It also runs on Android 9 not Android 7 like yours and it was released Sep 2020 whereas yours is Oct 2018.
Looking at your log again I'm guessing Kodi is doing something that messes with the stream. I don't think it's necessarily a timeout. In your log there is this:

2023-10-10 20:44:22.794 T:11268    info <general>: plugin.audio.spotifyConfusedpotty_audio_streamer:__log_continue_sending: Continue sending track '3boUavIi1pXlifQ4VPHMg5' - sent so far:  10.5MB ( 21%).
2023-10-10 20:44:26.758 T:10480    info <general>: XBMCApp: Finishing the activity
2023-10-10 20:44:26.791 T:10455    info <general>: CAndroidUtils: Current resolution: 1920x1080 3840x2160 @ 60.000004 - Full Screen
2023-10-10 20:44:27.031 T:10480    info <general>: CWinSystemAndroid:Big GrinestroyWindow
2023-10-10 20:44:27.697 T:10455 warning <general>: CPeripheralBusAndroid: failed to update input device with ID 3 because it couldn't be found
2023-10-10 20:44:27.698 T:10455 warning <general>: CPeripheralBusAndroid: failed to update input device with ID 4 because it couldn't be found
2023-10-10 20:44:27.715 T:10479    info <general>: XBMCApp: Stopping the application...
2023-10-10 20:44:27.725 T:10480    info <general>: Stopping the application...
2023-10-10 20:44:27.725 T:10480    info <general>: Stopping player

I have no idea why Kodi is prematurely finishing the activity here. If you can figure out how to get debug logging to work that may help. (I tried setting 'debug' in both the GUI and 'advancedsettings.xml' but Kodi would not output any debug lines.)
(2023-10-12, 17:58)mollyrocco Wrote: [ -> ]hi i am running win 11 and kodi 22  i have bought a account with spotify  after doing the cookie etc it worked then it wont work i have got user name and password in spotify xml   even restarted kodi  .any thoughts thanks
This sounds like "stehohrhase"s problem from a recent post. He/she posted
Quote:as workaround I entered my username in spotty_helper.py. This works fine.
I don't know, why password can read from settings.xml and username not.
Perhaps you could try that. Otherwise if you could paste me a log that might help.
(2023-10-13, 07:08)glk1001 Wrote: [ -> ]
(2023-10-12, 15:29)kthxbye Wrote: [ -> ]
(2023-10-11, 01:01)glk1001 Wrote: [ -> ]It streams for about 30 seconds then times out. So there's probably a timeout setting somewhere. I'll have a look. Is the device you're using pretty slow?

hi! the device is rooted amazon fire tv stick 4k. not sure if thats considered to be slow? it does handle most of the audio/video stuff I let it play, but spotify might be a different story in this context. mostly using it to stream some inet radio stations, mp3/flac/wav and videos from a nas
PS it did play  much longer then 30 seconds in some cases. even played few songs without interrupting, so not sure about a particular times limit that is set somewhere?

PPS I looked up the specs - 4x ARM Cortex - A55 up to 2.0 GHz with 1.5gb of ram. not much ram, so could that be the case?

Hi, This is pretty difficult to figure out. I tried a Firestick Lite and it worked fine with the Spotify plugin. It's specs are:

Running on Amazon AFTSS with Android TV 9.0.0 API level 28, kernel: Linux ARM 32-bit version 4.4.162+
FFmpeg version/source: 4.4.1-Kodi
Host CPU: ARMv7 Processor rev 4 (v7l), 4 cores available
Product: sheldon, Device: sheldon, Board: sheldon - Manufacturer: Amazon, Brand: Amazon, Model: AFTSS, Hardware: mt8695

It has only 1GB of RAM so I don't think RAM is the issue. It also runs on Android 9 not Android 7 like yours and it was released Sep 2020 whereas yours is Oct 2018.
Looking at your log again I'm guessing Kodi is doing something that messes with the stream. I don't think it's necessarily a timeout. In your log there is this:

2023-10-10 20:44:22.794 T:11268    info <general>: plugin.audio.spotifyConfusedpotty_audio_streamer:__log_continue_sending: Continue sending track '3boUavIi1pXlifQ4VPHMg5' - sent so far:  10.5MB ( 21%).
2023-10-10 20:44:26.758 T:10480    info <general>: XBMCApp: Finishing the activity
2023-10-10 20:44:26.791 T:10455    info <general>: CAndroidUtils: Current resolution: 1920x1080 3840x2160 @ 60.000004 - Full Screen
2023-10-10 20:44:27.031 T:10480    info <general>: CWinSystemAndroid:Big GrinestroyWindow
2023-10-10 20:44:27.697 T:10455 warning <general>: CPeripheralBusAndroid: failed to update input device with ID 3 because it couldn't be found
2023-10-10 20:44:27.698 T:10455 warning <general>: CPeripheralBusAndroid: failed to update input device with ID 4 because it couldn't be found
2023-10-10 20:44:27.715 T:10479    info <general>: XBMCApp: Stopping the application...
2023-10-10 20:44:27.725 T:10480    info <general>: Stopping the application...
2023-10-10 20:44:27.725 T:10480    info <general>: Stopping player

I have no idea why Kodi is prematurely finishing the activity here. If you can figure out how to get debug logging to work that may help. (I tried setting 'debug' in both the GUI and 'advancedsettings.xml' but Kodi would not output any debug lines.)

thank you very much for taking the time to check all of this! I will look into debug logging and try to get some data. 
PS I have not updated anything system related since I rooted it, which was in like 2020, so do you think it could be some sort of incampatibility cause by kodi/spoti plugin relying on something that it outdated and needs and update?
Really hard to say if updating the firestick will help. I think it will still stay at Android 7 and maybe Android 7 is the compatibility issue. Without more information on what the actual error is, it's too hard to figure out.
(2023-10-14, 05:07)glk1001 Wrote: [ -> ]Really hard to say if updating the firestick will help. I think it will still stay at Android 7 and maybe Android 7 is the compatibility issue. Without more information on what the actual error is, it's too hard to figure out.
(2023-10-13, 08:18)kthxbye Wrote: [ -> ]thank you very much for taking the time to check all of this! I will look into debug logging and try to get some data. 
PS I have not updated anything system related since I rooted it, which was in like 2020, so do you think it could be some sort of incampatibility cause by kodi/spoti plugin relying on something that it outdated and needs and update?

@kthxbye

if you were capable of rooting, are you comfortable now to do some higher level debugging - it could reveal quite a lot more and even if not leading to an resolution it could mean an answer

i am not sure if your device is affected but some fire os devices are not set to output log level DEBUG, it has to be enabled from adb - see here https://forum.kodi.tv/showthread.php?tid=371987

once you are getting debug level messages, an 'adb logcat' output would show what Android is doing at the time Kodi is acting up, something that the Kodi log will not show

using grep, you can filter to the kodi process initially -
'ps -A | grep xbmc' to get the pid of Kodi
then 'logcat | grep 1234' replace 1234 with the pid to get messages pertaining to kodi

if that is not specific enough then just logcat but it could get very large and if there is a delay until it acts up the log can get very large, outputting to a file on your desktop computer (where adb is) would be recommended
(2023-10-14, 05:34)izprtxqkft Wrote: [ -> ]
(2023-10-14, 05:07)glk1001 Wrote: [ -> ]Really hard to say if updating the firestick will help. I think it will still stay at Android 7 and maybe Android 7 is the compatibility issue. Without more information on what the actual error is, it's too hard to figure out.
(2023-10-13, 08:18)kthxbye Wrote: [ -> ]thank you very much for taking the time to check all of this! I will look into debug logging and try to get some data. 
PS I have not updated anything system related since I rooted it, which was in like 2020, so do you think it could be some sort of incampatibility cause by kodi/spoti plugin relying on something that it outdated and needs and update?

@kthxbye

if you were capable of rooting, are you comfortable now to do some higher level debugging - it could reveal quite a lot more and even if not leading to an resolution it could mean an answer

i am not sure if your device is affected but some fire os devices are not set to output log level DEBUG, it has to be enabled from adb - see here https://forum.kodi.tv/showthread.php?tid=371987

once you are getting debug level messages, an 'adb logcat' output would show what Android is doing at the time Kodi is acting up, something that the Kodi log will not show

using grep, you can filter to the kodi process initially -
'ps -A | grep xbmc' to get the pid of Kodi
then 'logcat | grep 1234' replace 1234 with the pid to get messages pertaining to kodi

if that is not specific enough then just logcat but it could get very large and if there is a delay until it acts up the log can get very large, outputting to a file on your desktop computer (where adb is) would be recommended

Im no expert, but I will look into this after some days as I dont have time now. reall curious about having spotify inside kodi... fire stick has no its own volume control and that is the main reason, since I need to control volume level at the source. otherwise Id just use spotify app... was also gonna check out spotifyd. if it allows volume change
(2023-10-14, 11:01)kthxbye Wrote: [ -> ]Im no expert, but I will look into this after some days as I dont have time now. reall curious about having spotify inside kodi... fire stick has no its own volume control and that is the main reason, since I need to control volume level at the source. otherwise Id just use spotify app... was also gonna check out spotifyd. if it allows volume change

all good, i rarely offer this option to people because most cannot do it but i saw you had rooted and thought perhaps you would be able

hope things work out for you
Hello glk1001,
i have the impression that the Spotify addon causes password changings. Today after playing some tracks i got again a message from Spotify that said that they have to reset my password to protect my account due to strange activities.
It is not a fake mail. Can you please check this.
Thanks
Christian
Hi,

No the plugin does not do anything with the password. Whatever is in 'userdata/addon_data/plugin.audio.spotify/settings.xml' gets passed to the 'spotty' binary which gets an authorization token
for use by 'spotipy'.

I have had the problem you describe once and I think the problem was that I was using another spotify device at the same time I was using the plugin - so two devices using the same spotify account. Otherwise I have had no problems - I've probably used the plugin daily over the last couple of years with only the one issue.
(2023-10-13, 07:14)glk1001 Wrote: [ -> ]
(2023-10-12, 17:58)mollyrocco Wrote: [ -> ]hi i am running win 11 and kodi 22  i have bought a account with spotify  after doing the cookie etc it worked then it wont work i have got user name and password in spotify xml   even restarted kodi  .any thoughts thanks
This sounds like "stehohrhase"s problem from a recent post. He/she posted
thanks for your reply , i tried the help file with no luck i had to reinstall tio get it to work
Quote:as workaround I entered my username in spotty_helper.py. This works fine.
I don't know, why password can read from settings.xml and username not.
Perhaps you could try that. Otherwise if you could paste me a log that might help.
(2023-10-16, 16:02)mollyrocco Wrote: [ -> ]
(2023-10-13, 07:14)glk1001 Wrote: [ -> ]
(2023-10-12, 17:58)mollyrocco Wrote: [ -> ]hi i am running win 11 and kodi 22  i have bought a account with spotify  after doing the cookie etc it worked then it wont work i have got user name and password in spotify xml   even restarted kodi  .any thoughts thanks
This sounds like "stehohrhase"s problem from a recent post. He/she posted
thanks for your reply , i tried the help file with no luck i had to reinstall tio get it to work
Quote:as workaround I entered my username in spotty_helper.py. This works fine.
I don't know, why password can read from settings.xml and username not.
Perhaps you could try that. Otherwise if you could paste me a log that might help.
thanks for your reply since it reinstalled it spotify works  thanks
yeah I already had several 'logged out' moments. not sure what exactyl causes it though...
right now it happened again.
spotify send an email about the 'suspicious activity' and account block, so then you have to unblock it.
I disabled the plugin for now, until I have time to fiddlie with it
Yes, same here and i only use this one Kodi device only and not two at once with same account.
I wish spotify would say what the suspicious activity is. The only one I had was on Oct 7. I will keep testing the plugin and see what happens.