mazkolain-zz / spotimc

GNU General Public License v3.0
302 stars 42 forks source link

Support for Apple TV 2 #56

Open derdude opened 12 years ago

derdude commented 12 years ago

The current release does not support the ATV 2. Is there a way to support the device in the next release?

siancu commented 11 years ago

I would like to work on this issue, as I have an ATV2 and Spotify is just what I'm missing from it.

However I have no clue on how to setup the dev environment for this plugin. I see that there is a wiki page about it but it's empty. Any ideas?

mazkolain-zz commented 11 years ago

Hi,

I just added content to the wiki page. Thanks for the reminder! https://github.com/mazkolain/spotimc/wiki/Spotimc-Development

Since I don't own an ATV2 nor have access to Xcode, I'm currently unable to provide support for this platform. I really appreciate your help. Thank you!

One of the issues with ATV2 and iOS in general is that the platform detection Spotimc does is quite unsuccessful: https://github.com/mazkolain/spotimc/blob/06da409bd047e33a06608b10a205641fec5f9431/envutils.py#L32

Since both OSX and iOS get detected as 'darwin', this file will need some patching. Perhaps some combination of sys.platform and platform.machine(). Or even better, make use of some handy boolean tags XBMC provides: System.Platform.ATV2 and System.Platform.IOS: http://wiki.xbmc.org/index.php?title=List_of_Boolean_Conditions

The other issue is that the libspotify version for iOS released by Spotify is static, so it can't be directly loaded on runtime. I've found a guide on how to circumvent this, but since it requires Xcode4, I've not been able to test it. Check out http://stackoverflow.com/a/11558482/28581 and http://stackoverflow.com/a/10509453/28581 for more details on this.

Finally, if you manage to get Spotimc running on the ATV2, I would expect some memory issues as well. Since Spotimc makes heavy use of threads, it may need some tweaks here too (perhaps lowering the number of concurrent threads and so on...)

Also remember to use the latest nightly build of Frodo, since some backwards compatibility issues with python scripts where fixed recently. Spotimc won't run on Eden as it lacks the ctypes python module (which is required to load libspotify).

And again, thank you for your help!

kib commented 11 years ago

Here is some more info on the changes for skins in Frodo with regards to hardware detection.

https://github.com/xbmc/xbmc/pull/970

This changes the behaviour of the condition system.platform.osx.

Before it was true whenever it was one of ios or osx. Now its only true on osx anymore. For getting the old behaviour system.platform.darwin has to be used after this PR.

So basically we have:

system.platform.darwin - true on ios and osx system.platform.osx - true on osx system.platform.ios - true on ios

sepans commented 9 years ago

Hi, I was going to give this a try but since this thread is more than 2 years old I wanted to check if the above discussion is still the case. Thanks

mazkolain-zz commented 9 years ago

Hi,

Yes, it's still the case. On my previous post I put together all the information I could gather regarding on this issue.

Also, keep in mind that the Kodi team has ceased development on ATV2: http://kodi.tv/farewell-to-future-appletv2-development/