[RELEASE] Spotimc: Another Spotify music addon

  Thread Rating:
  • 32 Vote(s) - 4.72 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
superstream Offline
Junior Member
Posts: 5
Joined: May 2016
Reputation: 0
Post: #976
I was able to compile the ARM libspotify.so intended for Android on debian stretch, with aarch64 architecture. Spotimc is installed and configured in Kodi Jarvis stock build. Despite making a number of directories with the architecture name, spotimc cannot find libspotify.so. Is there a way to force spotimc to find a specific directory containing libspotify.so or modify the script to find it? Apologies if I missed the answer in this giant thread.


19:45:57 T:546909482784 WARNING: CPythonInvoker(3): Script invoked without an addon. Adding all addon modules installed to python path as fallback. This behaviour will be removed in future version.
19:46:28 T:546909482784 ERROR: Traceback (most recent call last):
19:46:28 T:546909482784 ERROR: File "/home/noah/.kodi/addons/script.audio.spotimc/resources/libs/spotimcgui/main.py", line 509, in main
19:46:28 T:546909482784 ERROR: gui_main(__addon_path__)
19:46:28 T:546909482784 ERROR: File "/home/noah/.kodi/addons/script.audio.spotimc/resources/libs/spotimcgui/main.py", line 393, in gui_main
19:46:28 T:546909482784 ERROR: initially_unload_playlists=False,
19:46:28 T:546909482784 ERROR: File "/home/noah/.kodi/addons/script.audio.spotimc/resources/libs/pyspotify-ctypes/src/spotify/session.py", line 310, in __init__
19:46:28 T:546909482784 ERROR: err = self.__session_interface.create(ctypes.byref(config), ctypes.byref(self.__session_struct))
19:46:28 T:546909482784 ERROR: File "/home/noah/.kodi/addons/script.audio.spotimc/resources/libs/pyspotify-ctypes/src/_spotify/session.py", line 129, in create
19:46:28 T:546909482784 ERROR: ctypes.POINTER(config), ctypes.POINTER(ctypes.c_void_p)
19:46:28 T:546909482784 ERROR: File "/home/noah/.kodi/addons/script.audio.spotimc/resources/libs/pyspotify-ctypes/src/_spotify/__init__.py", line 73, in _get_func
19:46:28 T:546909482784 ERROR: lib = self.get_library()
19:46:28 T:546909482784 ERROR: File "/home/noah/.kodi/addons/script.audio.spotimc/resources/libs/pyspotify-ctypes/src/_spotify/__init__.py", line 66, in get_library
19:46:28 T:546909482784 ERROR: self.__library = self._load_library()
19:46:28 T:546909482784 ERROR: File "/home/noah/.kodi/addons/script.audio.spotimc/resources/libs/pyspotify-ctypes/src/_spotify/__init__.py", line 91, in _load_library
19:46:28 T:546909482784 ERROR: return ll.load('libspotify')
19:46:28 T:546909482784 ERROR: File "/home/noah/.kodi/addons/script.audio.spotimc/resources/libs/pyspotify-ctypes/src/_spotify/__init__.py", line 189, in load
19:46:28 T:546909482784 ERROR: _library_cache[name] = self._load(name)
19:46:28 T:546909482784 ERROR: File "/home/noah/.kodi/addons/script.audio.spotimc/resources/libs/pyspotify-ctypes/src/_spotify/__init__.py", line 183, in _load
19:46:28 T:546909482784 ERROR: return self._load_from_sys_path(loader, name)
19:46:28 T:546909482784 ERROR: File "/home/noah/.kodi/addons/script.audio.spotimc/resources/libs/pyspotify-ctypes/src/_spotify/__init__.py", line 165, in _load_from_sys_path
19:46:28 T:546909482784 ERROR: raise OSError("Unable to find '%s'" % name)
19:46:28 T:546909482784 ERROR: OSError: Unable to find 'libspotify'
19:46:28 T:546909482784 ERROR: Exception
19:46:28 T:546909482784 ERROR: OSError
19:46:28 T:546909482784 ERROR: :
19:46:28 T:546909482784 ERROR: OSError("Unable to find 'libspotify'",)
19:46:28 T:546909482784 ERROR: in
19:46:28 T:546909482784 ERROR: <bound method ?.? of <spotify.session.Session instance at 0x7f552d1d40>>
19:46:28 T:546909482784 ERROR: ignored
find quote
marcelveldt Online
Skilled Skinner
Posts: 6,079
Joined: Jul 2014
Reputation: 211
Location: The Netherlands
Post: #977
(2016-05-06 21:51)superstream Wrote:  I was able to compile the ARM libspotify.so intended for Android on debian stretch, with aarch64 architecture. Spotimc is installed and configured in Kodi Jarvis stock build. Despite making a number of directories with the architecture name, spotimc cannot find libspotify.so. Is there a way to force spotimc to find a specific directory containing libspotify.so or modify the script to find it? Apologies if I missed the answer in this giant thread.

Great stuff you compiled the libspotify for aarch64. That should also work on nvidia shield, right ?
Would it be possible for you to send me your compiled version ? In that case I can fix support for it in my spotify addon for you.
If you want to use it in spotimc, you will have to modify the code. If I recall correctly there's a method in one of the helper classes to detect the system's architecture and set the correct path to the libspotify library.
find quote
superstream Offline
Junior Member
Posts: 5
Joined: May 2016
Reputation: 0
Post: #978
2 tar files for you here, 1 with the full dir used for compiling & 1 with libspotify.so (as compiled on aarch64) only:

http://hq.fsn.net/spotify/

If you need more, please ask.

Please modify spotimc to include aarch64 architecture if possible. I tried to put the libspotify.so into ~/.kodi/...../linux/aarch64/libspotify.so but it did not work. Also I copied libspotify.so (android arm64) to all of the architecture directories and made up a couple of others (arm64, aarch64, arm) and no luck.

Looking forward to using your coveted script. I'm on a aarch64 development board running debian stretch.

Edit: I assume it will work with anything arm64 or aarch64, so it should be fine for Nvidia Shield's octo core cortex. I have a development board with the same and will test it once ready.



Regards -
(This post was last modified: 2016-05-07 17:43 by superstream.)
find quote
marcelveldt Online
Skilled Skinner
Posts: 6,079
Joined: Jul 2014
Reputation: 211
Location: The Netherlands
Post: #979
(2016-05-07 06:39)superstream Wrote:  2 tar files for you here, 1 with the full dir used for compiling & 1 with libspotify.so (as compiled on aarch64) only:

Thanks but the link doesn't work. Possible to send me an updated link (may as well be through PM if you prefer) ?
find quote
superstream Offline
Junior Member
Posts: 5
Joined: May 2016
Reputation: 0
Post: #980
Apologies, here it is on a more reliable server:

https://drive.google.com/folderview?id=0...sp=sharing
find quote
marcelveldt Online
Skilled Skinner
Posts: 6,079
Joined: Jul 2014
Reputation: 211
Location: The Netherlands
Post: #981
(2016-05-08 22:48)superstream Wrote:  Apologies, here it is on a more reliable server:

Thanks, this link worked :-)

I have integrated your compiled version for aarch64 on android into my spotify addon (not yet in spotimc).
Can you please test it with my spotify addon to see if it works ?

https://github.com/marcelveldt/plugin.au...master.zip

I did a little guessing for the platform detection. If it fails on your setup, please have a look at utils.py in the resources directory, around line 124

If it works in my addon I can also make the changes to the spotimc addon if you like.
find quote
superstream Offline
Junior Member
Posts: 5
Joined: May 2016
Reputation: 0
Post: #982
Hi marcelveldt -

For clarity / reference, I compiled the Android / ARM64 libspotify on Debian Stretch running a 4.4.8 linux kernel, using a aarch64 CPU (not Android).

Today I removed all references to spotify & spotimc from kodi, then installed your zip file as an add-on. It successfully installed, but shows there is an update available. I tried both with & without the update.

Once installed, I added my premium account information. However, the spotify plugin did not launch the browser to authenticate. I was using midori. Then I installed chromium and it finally launched and successfully authenticated.

I see these new files here:

./addons/plugin.audio.spotify-master/resources/dlls/android/aarch64/libspotify.so.12.1.51
./addons/plugin.audio.spotify-master/resources/dlls/android/aarch64/libspotify.so
./addons/plugin.audio.spotify-master/resources/dlls/android/aarch64/libspotify.so.12

I do not see a new aarch64 directory here:

./addons/plugin.audio.spotify-master/resources/dlls/linux/*

So I created one and copied the files from android/aarch64/ to /dlls/linux/aarch64/.

I see around line 124 in utils.py, that kodi is trying to identify the architecture, but my guess is that the directory is still off.

I successfully authenticated with accounts.spotify but get a blank box "Login error:" pop-up after a few minutes of waiting.

Here's the logs:

14:15:43 T:546459086624 NOTICE: Spotify --> Your platform (aarch64 System.Platform.Linux)
14:15:43 T:546459086624 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.OSError'>
Error Contents: This platform is not supported (aarch64 System.Platform.Linux)
Traceback (most recent call last):
File "/home/noah/.kodi/addons/plugin.audio.spotify-master/spotifyservice.py", line 3, in <module>
import resources.playbackservice as service
File "/home/noah/.kodi/addons/plugin.audio.spotify-master/resources/playbackservice.py", line 9, in <module>
load_all_libraries()
File "/home/noah/.kodi/addons/plugin.audio.spotify-master/resources/utils.py", line 83, in load_all_libraries
add_native_libraries()
File "/home/noah/.kodi/addons/plugin.audio.spotify-master/resources/utils.py", line 112, in add_native_libraries
raise OSError('This platform is not supported (%s %s)' % (architecture, platform))
OSError: This platform is not supported (aarch64 System.Platform.Linux)
-->End of Python script error report<--
find quote
marcelveldt Online
Skilled Skinner
Posts: 6,079
Joined: Jul 2014
Reputation: 211
Location: The Netherlands
Post: #983
(2016-05-10 16:30)superstream Wrote:  I see around line 124 in utils.py, that kodi is trying to identify the architecture, but my guess is that the directory is still off.
I successfully authenticated with accounts.spotify but get a blank box "Login error:" pop-up after a few minutes of waiting.

Ah okay, sorry that's my bad. My understanding was that you were actually on the android platform.
I will post a new version in a few hours.
find quote
superstream Offline
Junior Member
Posts: 5
Joined: May 2016
Reputation: 0
Post: #984
Hi Marcelveldt -

Any luck with incorporating it into Kodi for Debian?

Thanks -
find quote
marcelveldt Online
Skilled Skinner
Posts: 6,079
Joined: Jul 2014
Reputation: 211
Location: The Netherlands
Post: #985
(2016-05-25 01:48)superstream Wrote:  Hi Marcelveldt -

Any luck with incorporating it into Kodi for Debian?

Thanks -

Sorry, forgot to reply. A new version of my own spotify addon is available. Can you test with that ?

http://www.mb3admin.com/downloads/addons...1.0.15.zip
find quote
Ruckus Online
Junior Member
Posts: 47
Joined: Oct 2012
Reputation: 1
Location: Costa Rica
Post: #986
fantastic addon, but for the life of me i cant find out or work out where to set playlist to shuffle, anyoneConfusedConfused
find quote
marcelveldt Online
Skilled Skinner
Posts: 6,079
Joined: Jul 2014
Reputation: 211
Location: The Netherlands
Post: #987
(2016-06-18 23:28)Ruckus Wrote:  fantastic addon, but for the life of me i cant find out or work out where to set playlist to shuffle, anyoneConfusedConfused

You can do that in Kodi itself. When you start the playback you can enable random/shuffle in the Kodi OSD.
find quote
Post Reply