Kodi Community Forum
[WIP] XBMC + Spotify = True (an XBMC implementation that uses Spotify's official API) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Discussions (https://forum.kodi.tv/forumdisplay.php?fid=222)
+--- Forum: Kodi related discussions (https://forum.kodi.tv/forumdisplay.php?fid=6)
+--- Thread: [WIP] XBMC + Spotify = True (an XBMC implementation that uses Spotify's official API) (/showthread.php?tid=67012)



- jaaps - 2010-05-24

Kitof Wrote:I made some changes to be able to compile spotyXBMC under linux with libspotify 0.4.

Everything works well, and my fork is here :

http://github.com/Kitof/spotyxbmc

Anyone got this working? I have tried applying the patch to several svn revisions and got it succesfully compiled and XBMC starts but after entering the spotify login details XBMC just crashes.


- drvdijk - 2010-05-27

jaaps Wrote:Anyone got this working? I have tried applying the patch to several svn revisions and got it succesfully compiled and XBMC starts but after entering the spotify login details XBMC just crashes.

First I tried to patch the current svn trunk with the .diff, which obviously failed. However, release 28310 failed as well oddly enough. So now I got the 9.11 source as promoted on the download page on the main xbmc page. The diff doesn't patch automatically on that one either.

So I merged the diff manually (no that was not fun), and am now compiling. Manually merging was doable, however in the xbmc/FileSystem/Directory.cpp stuff was changed too much to add the spotify line. Well, let's see how it works without it! Wink

Compiling this heap of source probably takes a while on this Asrock ION. I'll post back after I get some shuteye.

Edit: eyes didn't shut, but got blown open by an error:
Code:
make[1]: Entering directory `/home/drvdijk/spotify/xbmc-9.11-spotify/xbmc'
g++ -MD -c -O2 -g -D_DEBUG -Wall -D_LINUX -D_FILE_DEFINED -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DINSTALL_PATH="\"/usr/local/share/xbmc\"" -DHAS_SDL_JOYSTICK -D'SVN_REV="Unknown"' -DHAVE_CONFIG_H  -I. -Ilinux -Icores -I../guilib -Iutils -IFileSystem -I/usr/include/freetype2 -Icores/dvdplayer -Icores/ffmpeg -Ilib/libUPnP/Platinum/Source/Core -Ilib/libUPnP/Platinum/Source/Platinum -Ilib/libUPnP/Platinum/Source/Devices/MediaServer -Ilib/libUPnP/Platinum/Source/Devices/MediaConnect -Ilib/libUPnP/Platinum/Source/Devices/MediaRenderer -Ilib/libUPnP/Neptune/Source/System/Posix -Ilib/libUPnP/Neptune/Source/Core -Ilib/libcdio/libcdio/include -I/home/drvdijk/spotify/xbmc-9.11-spotify     -I/usr/include/fribidi     -I/usr/include/libpng12         -I/usr/include/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -I/usr/include/freetype2       -I/usr/include/alsa               -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include   -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/hal -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include   -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL   -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/hal -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include   -I/usr/include/lzo spotinterface.cpp -o spotinterface.o
In file included from spotinterface.cpp:22:
spotinterface.h:88: error: ‘XFILE::MUSICDATABASEDIRECTORY’ has not been declared
spotinterface.h:88: error: ISO C++ forbids declaration of ‘NODE_TYPE’ with no type
spotinterface.h:88: error: expected ‘;’ before ‘getChildType’
spotinterface.cpp: In static member function ‘static void SpotifyInterface::cb_albumBrowseComplete(sp_albumbrowse*, void*)’:
spotinterface.cpp:210: error: ‘CacheThumb’ is not a member of ‘CPicture’
spotinterface.cpp: In constructor ‘SpotifyInterface::SpotifyInterface()’:
spotinterface.cpp:703: error: ‘CDirectory’ has not been declared
spotinterface.cpp: In member function ‘void SpotifyInterface::clean(bool, bool, bool, bool, bool, bool, bool, bool, bool)’:
spotinterface.cpp:910: error: ‘CDirectory’ has not been declared
spotinterface.cpp:916: error: ‘CDirectory’ has not been declared
spotinterface.cpp:922: error: ‘CDirectory’ has not been declared
spotinterface.cpp:928: error: ‘CDirectory’ has not been declared
spotinterface.cpp: At global scope:
spotinterface.cpp:1123: error: ‘XFILE::MUSICDATABASEDIRECTORY’ has not been declared
spotinterface.cpp:1123: error: expected constructor, destructor, or type conversion before ‘SpotifyInterface’
make[1]: *** [spotinterface.o] Error 1
make[1]: Leaving directory `/home/drvdijk/spotify/xbmc-9.11-spotify/xbmc'
make: *** [xbmc/xbmc.a] Error 2

Edit 2: Right, so now I got all there errors gone Big Grin Basically, namespaces changed considerably in the Directory.h and MusicDatabaseDirectory.cpp files (in xbmc/FileSystem). Also, the CacheThumb method in the xbmc/Picture.h file was removed, so I removed references from spotinterface.cpp to them (lets see how that goes..) make now flew by the spotinterface.cpp compilation, and is now again continuing with much more work. To be continued!


- akezeke - 2010-05-28

As many of you have notice, the precompiled versions of spotyXBMC is not working anymore. It is due to the update from spotify.

Until the new addon system is fully implemented in XBMC I will not do any coding on this. In the future I will do a rewrite of the project and it will be reborn as a plugin... hopefully

However you can use spotifys official lib as suggested, I have updated the source so it will apply on the current svn.

/David


- jaaps - 2010-05-29

Still having problems getting it running.
I checked out the SVN of XBMC and your code on github. Patch went succesfully. Then I installed libspotify and edited spotinterface.h to point to libspotify. Also filled my api key in the right place. Run some steps and added -lspotify to LIBS

When compiling I got an error about api.h. So I installed the api.h from Kitof's github. Now everything was succesfully compiled. So I did a sudo make install and tried running XBMC. XBMC loads up fine and ask for spotify login details. But after entering the details XBMC crashes. Nothing really in xbmc.log.

Hope you can help me get this running.. I really want to.


- spark - 2010-05-31

My experience is identical to Jaap's. I'm also very interested in being able to use spotify from xbmc again (I used it previously on an older system with the precompiled binaries).

Is there any way to get this working again with recent sources?


- wido - 2010-06-13

I've had the same issue with XBMC under Ubuntu 10.04 (AMD64).

My XBMC crashed and the strace showed that it happened in libspotify.so

I tried several things, but wasn't able to resolve it, but then i got an idea, what if i enable the library mode before enabling Spotify?

So i disabled Spotify in advancedsettings.xml and then added some local MP3's into my library (I'm using MySQL as backend).

After my library was scanned i shutdown XBMC and enabled Spotify. And then, voila, XBMC started without any troubles and Spotify is working brilliant!

Some data:

OS: Ubuntu 10.04 (AMD64)
XBMC: Revision 31058 (SVN)
Spotify: Using libspotify 0.4 with api.h from spotyxbmc

Btw, i had to manually apply the patch in "./project/VS2008Express/XBMC.vcproj" since automated patching failed.


Dharma - Talle - 2010-07-19

Hi.

Since the new addonsystem is now done I wonder if ther will be a Spotify AddOn?

Sincerly

//Talle


- akezeke - 2010-07-19

Yes there will be, but not until its possible to create addons in c++, might be sooner, or later...

/David


- jaaps - 2010-07-19

Maybe you could create something like a HTTP Gateway to communicate with Python?


- akezeke - 2010-07-20

jaaps Wrote:Maybe you could create something like a HTTP Gateway to communicate with Python?

Guess I could but what´s the point when support for C++ addons are in the works, a solution without involving python suites this project better I think.

/David


- soder - 2010-07-24

Now when it's possible to install Spotify on Linux, isn't it possible to make some "front" as an add-on in XBMC to control Spotify running in the background?

/Söder


- watzen - 2010-07-25

akezeke Wrote:Guess I could but what´s the point when support for C++ addons are in the works, a solution without involving python suites this project better I think.

/David

any confirmation that c++ plugin support is in the works?


- eXisTa - 2010-08-10

I would die to have SpotifyXBMC working.

Any update on the progress?


- akezeke - 2010-08-10

@eXisTa

If you would die to have it working, I guess you will be glad to hear that it is working, I´m using it every day on both windows and Linux, all you have to do is compile it yourself with libspotify from http://developer.spotify.com/en/.

Until the addon is released that is the only way to do I´m afraid.


mac? - jansink - 2010-08-11

Is it working on a mac also?