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)



- abandonow - 2011-08-11

I got the source (as of one hour ago) and recompiled. I will not be able to test before I get home later today. All I have is ssh connection.


- abandonow - 2011-08-11

Okay, I've done some more testing.

HARDWARE:
  • Corsair VX 450W, PSU
  • Gigabyte GA-EG45M-DS2H, motherboard [intel G45 chipset]
  • Intel Core 2 Duo E8400, CPU
  • Kingston HyperX DDR2-800 4 GB (2x2048), RAM
  • Lian Li PC-C37 Muse Sort, case
  • Logitech Cordless MediaBoard Pro (PS3), keyboard

This is hooked up to a 42" toshiba LCD tv with HDMI and S/PDIF to a Samsung surround system.


What I did, step by step:
  1. I compiled the new version without problems, adding appkey.h to spotyxbmc and spotyxbmc/xbmc (I guess the first dir is correct, but I did not take any chances).

    This were the XBMC configuration:
    Code:
    ------------------------
      XBMC Configuration:
    ------------------------
      Debugging:    Yes
      Profiling:    No
      Optimization:    Yes
      Crosscomp.:    No
      target ARCH:    no
      target CPU:    no
      OpenGL:    Yes
      ALSA:        Yes
      VDPAU:    No
      VAAPI:    No
      CrystalHD:    No
      VDADecoder:    No
      VTBDecoder:    No
      OpenMax:    No
      Joystick:    Yes
      XRandR:    Yes
      GOOM:        No
      Bluray:    No
      TexturePacker:Yes
      MID Support:    No
      ccache:    No
      PulseAudio:    Yes
      HAL Support:    Yes
      DVDCSS:    Yes
      Avahi:    Yes
      Non-free:    Yes
      ASAP Codec:    No
      Webserver:    Yes
      libRTMP support:    Yes
      libnfs support:    No
      Optical drive:    Yes
      External FFmpeg:    No
      prefix:    /usr/local
    ------------------------

  2. I renamed my previous .xbmc directory to get fresh start. I was a bit worried my relativly large mp3 collection in the xbmc library was causing the issues.


  3. I started XBMC, went to Spotyxbmc plugin and entered my username and password. I then pressed ok, and went to the main menu. Then I quit xbmc.
    Terminal output and crashlog for first run (setting username/pw): https://gist.github.com/1140287


  4. Started up XBMC, waited to the terminal output came to an halt and went into Music. Voila – behold the great Spotify. Success.
    Terminal output and crashlog for second run (successfully loaded spotify): https://gist.github.com/1140302


  5. Quit, and started XBMC again. Waited to the terminal output came to an halt and went into music. Nothing. Spotify is not enabled.
    Terminal output and crashlog for second run (did not load spotify): https://gist.github.com/1140304

And btw. I have NO starred songs in Spotify (according to the OS X Spotify client), and that should be correct since I haven't used that feature.
Image

I don't understand enough to figure this out, so I hope this helps you akezeke Smile

If you want me to test anything else, just ask. Smile


- neoflex - 2011-08-11

I had the same segmentation fault problem and I solved it but I dont really know how. After tracking the pb a little bit I had the impression that it crash while loading the playlists. I removed some of them from my spotify account (among them all my local music playlists) and now it works.

Love the new version, I just miss the compatibility with the Json API, I can t acces my spotify albums through the web interface neither with the iPhone remotes app.


- abandonow - 2011-08-11

I have a lot of playlists (around 80-90), and some with nordic characters (ie. æøå), but I don't want to delete any of them.


- neoflex - 2011-08-11

if you set some of your playlists public and give me their spotify uri, I can test if I get a pb with them too.


- abandonow - 2011-08-11

Thanks for offering, but as you now know I have alot of playlists, so I dont really think that it is the best way. It's faster and easier to do that myself. But that will take alot of time, and time I dont have atm, so I'm hoping for an easier solution. Smile

It's possible to create another premium spotify user, but I dont think I want to pay double quite yet either.

My best bet is that akezeke figures out something from my log files.


- akezeke - 2011-08-12

abandonow Wrote:I have a lot of playlists (around 80-90), and some with nordic characters (ie. æøå), but I don't want to delete any of them.

The nordic chars is not a problem, I have them in my lists to,

I think that the amount of laylists might be the problem, After looking at your logs it seems that you where to quick to give up, start it up and when the terminal is quiet, wait a couple of minutes more Smile...

How long does it take before it seems to be loaded? I guess I should add an option to disable playlist preloading Smile


- abandonow - 2011-08-12

Maybe ~1 min.

I have let it sit for over an hour, but still nothing.

I have had some issues with xbmc freezing if left over night. But as you say, maybe it is the amount of playlists. But the weird thing is that it works sometimes – and I dont have to wait for a long time before it shows up.


- akezeke - 2011-08-12

abandonow Wrote:Maybe ~1 min.

I have let it sit for over an hour, but still nothing.

I have had some issues with xbmc freezing if left over night. But as you say, maybe it is the amount of playlists. But the weird thing is that it works sometimes – and I dont have to wait for a long time before it shows up.

Then the amount of playlists is not the problem, after looking at your logs I found this:

17:34:55.819 E [ap:3900] ChannelError(933, 1, get-image)

So it is some kind of connection error, as it seems when a channelError occurs the object that is waiting for a callback never receives it so the thumbnail in this case is sitting and waiting for the callback and will always say that it is not loaded, and then the entire spotify solution is "not ready" and nothing will show up anywhere.

One way you can try if this is the problem is to change the thumb isLoaded function to always return true, then there will be some thumbs not showing if you are to fast hitting the menus but try to see if the playlists loads as they should.

I will investigate how I can do something about this, maybe add a timer that stops waiting after a curtain amount of time or something...

I tried to add a lot of more playlists and I don't see this problem anyway... hm

Edit:
I will redo the checks for readynes to allow interaction with spotify elements even if not everything is loaded, so in your case there might one or two playlists that never loads but you can use all the others anyway... I dont have much time now but I will look in to it soon.

/David


- abandonow - 2011-08-12

Ah, okay. I guess thats good. One step closer.

Do you have any idea why there is a connection problem, afaik I have no problems with the box. I use blockcontrol/moblock, but have opened up for spotify servers (93.182.8.0/24 and 78.31.8.0/2) and port (4070). I have also tested turning off blockcontrol, but it makes no difference (so the bug lies elsewhere). The box is also used as seedbox (torrent).

I launched xbmc today, and spotyxbmc worked. I went through comparing playlists with the spotify client (os x) and spotyxbmc. Every playlist was there. Restarted xbmc, and it was gone again.

How do I set "thumb isLoaded" to true? I've been poking around in your code, but I dont have the programming skills to do it without help. Smile

Btw. here is all my installed packages, if that is helping:
https://gist.github.com/1142670

Thanks again. Smile


- [Ad0] - 2011-08-13

Is it possible to use the addon binaries in a PVR build at approximately the same date (merged from same commit)? Saw on the commits that spotifyxbmc has been separated completely into addons now?


- akezeke - 2011-08-13

abandonow Wrote:Ah, okay. I guess thats good. One step closer.

Do you have any idea why there is a connection problem, afaik I have no problems with the box. I use blockcontrol/moblock, but have opened up for spotify servers (93.182.8.0/24 and 78.31.8.0/2) and port (4070). I have also tested turning off blockcontrol, but it makes no difference (so the bug lies elsewhere). The box is also used as seedbox (torrent).

I launched xbmc today, and spotyxbmc worked. I went through comparing playlists with the spotify client (os x) and spotyxbmc. Every playlist was there. Restarted xbmc, and it was gone again.

How do I set "thumb isLoaded" to true? I've been poking around in your code, but I dont have the programming skills to do it without help. Smile

Btw. here is all my installed packages, if that is helping:
https://gist.github.com/1142670

Thanks again. Smile

I pushed some fixes, please try if it works better now, still works here Smile


- akezeke - 2011-08-13

[Ad0];861340 Wrote:Is it possible to use the addon binaries in a PVR build at approximately the same date (merged from same commit)? Saw on the commits that spotifyxbmc has been separated completely into addons now?

No spotyxbmc has not been seperated to an addon... yet. The code is better encapsulated to make way for the remake into an addon that will begin soon.

But if you want to use spotyxbmc with the pvr-branch its not that hard, download the pvr branch and the spotyxbmc branch. Create a diff between spotyxbmc and original xbmc master. Apply the diff to the pvr-branch (manually is safest)

There might even be a clever git trick to do it automatically since both branches has the same origin but I don't now how to do it. Someone else perhaps?

Edit:
Tried with this from inside the spotyxbmc2 dir

git remote add pvr git://github.com/opdenkamp/xbmc.git
git fetch pvr
git merge pvr/master

I'v got only one merge conflict and that is in the settings.cpp, the video and music extensions, edit it manually and make sure that .spotify is still in the music part and .pvr is in the video.

Then just mark the confict as solved and build it. worked for me.


/David


- abandonow - 2011-08-14

@akezeke
I tested your new build now, and it works everytime. A little loading time entering toplists, playlists, radio etc., but no more than ~1min.

Let me know if you want log-files, etc.

It still get "Segmentation fault" when exiting, but that you allready know.

Great work! Smile


- dallasnights - 2011-08-14

Hi all is there a version for ATV yet that works

Thanks all