Steam Link

Steam Link

slax57 Jan 22, 2018 @ 3:18pm
Feedback: How to turn your Steam Link into a Spotify Connect device
EDIT: Before you read on all this
I found a better solution (to my opinion) that's way more stable, and doesn't require all the manual steps!
=> See post #7 for more info!

---

Hi there !

I'm starting this thread to share my experience in my attemps to turn my Steam Link into a Spotify Connect play-back server.

Maybe some of you already found a solution, but I couldn't find any on the steam forums so I am sharing mine. Hope this can be of help :).

First of all :
  • my solution only works for Premium spotify users. It won't work if you only have a free account.
  • The later mentioned steps require some experience to be done, especially with UNIX systems. Don't try it if you're not sure about what you're doing.
  • Even if I'm happy with the result, I must say the service is not really stable. Go on your way if you're after something stable and easy to use...

Approach
At first I was trying to build the librespot implementation from plietar[github.com] for the steam link, using the steamlink SDK[github.com]. But I never got it to work.

Then I figured out, the simplest way might be to use the kodi implementation for the steam link (already provided with the SDK), which happens to offer a Spotify add-on[forum.kodi.tv]! (many thanks to @marcelveldt for that!)

The latest version (1.1.46) was indeed completely rewritten in order to use librespot.
It encloses a service that runs when you start kodi, and makes your kodi usable as a target player for spotify connect protocol.

So, here are the steps I followed to get Spotify on my Steam Link:
  1. Build the latest version of kodi using the steam link sdk (or find the binary on the internet, but it's at your own risk + I experienced better results using the latest version of kodi i.e. Kodi Krypton 17.6)
  2. Install it on your steam link following their instructions. While your at it, also enable SSH on your steam link as we're gonna need it later.
  3. Download marcelveldt's repository ZIP[github.com] and install it on kodi, using for example a network protocol (unfortunately, USB sticks plugged directly in the steam link are not recognized by kodi...)
  4. Install the repository.
  5. After a while, you will be able to browse the repository for add-ons. Search for the add-on named Spotify and install it.
  6. At this point I suggest a reboot of the steam link, as it is very short on memory and can freeze easily
  7. Once you're at the steam link home screen, open an SSH terminal and log into it.
  8. Now we will have to create a hosts file (in /etc/hosts) on the steam link, and add the following line in it:
    127.0.0.1 localhost
    . This is really important, because the spotify add-on will refer to localhost all the time, so we need to declare it on the system.
  9. Launch kodi again.
  10. Launch the spotify add-on, and enter your credentials as required.
  11. In the Audio tab of the add-on settings, check the option that says Enable this device as Spotify Connect target (experimental)
  12. Click OK and then restart kodi once more.
  13. Now, you should finally be all set to use kodi to play your spotify songs!

Usage:
  • You don't need to run the Spotify add-on to play music from spotify. If all went correctly, it should already be available as a spotify connect target. The device name should be something like Kodi (steamlink-XXXX)
  • Actually, I don't even recommend running the add-on at all, since it's very memory consuming and the link can get out of memory really quick.
  • Songs take some seconds to load, you have to be patient.

Troubleshoot:
I don't have much to say for this part, since, as I said earlier, the whole system is already quite unstable...
Anyway, if you encounter some troubles, you can still check the kodi log file, which contains much information.
It can be found here :

Conclusion:
I tried to give as many details as possible, but it's still a tricky operation.
Still, I hope this little guide will help some of you.

I can't promise I'll provide much support on this thread, but feel free to add any comment or additionnal info that you find missing.

Good luck to those who try it! ;-)
Last edited by slax57; Apr 12, 2020 @ 8:24am
< >
Showing 1-9 of 9 comments
PsYonIca Feb 17, 2018 @ 6:47am 
Thanks for your guide! Just tried and it works.

Step 5: it took really long to update the repo... so i restarted kodi and it seems to speed up the process.

Overall Performance: there is a delay between the input commands (on smartphone) to the kodi execution. I think this is the result due to the hardwarelimitations. But overall a pretty good addon.
R4XX Mar 19, 2018 @ 8:48am 
@slax57

Thanks for this. Independent from your try, I try it by myself - and of course the solution with kodi is to unstable.

How did you try build librespot with the steam-sdk? I build librespot standalone without steam sdk, but it's not working. So I try to build it with the steam-sdk, but how?!
slax57 Mar 19, 2018 @ 1:54pm 
Hi!

I tried to create a config file for cargo, linking to the steamlink-sdk binaries. But my knowledge of cargo and cross-compilation were not sufficient for me to succeed :/.
I also tried to compile it using the provided cross-compilation environment (with docker). I think the produced binary was compatible with the steam link, but I couldn't start the service because of problems with alsa not recognizing the sound card...

In case you want to try out the first option, here is a link that helped me a lot : https://github.com/japaric/rust-cross/blob/master/README.md

Hope you will have better luck than me! :)
R4XX Apr 7, 2018 @ 3:37am 
Thanks for your reply. I edit the cross compile dockerfile and understand how i must build it. The build was successful, but the steamlink have problems to start librespot because of libc dependency. Steam Link has only libc-2.19 and my librespot build needs GLIBC 2.27...

Do you know how to build it with glibc 2.19? My experience is in (web) development and sys operations, so it's complete new to build something with cargo, rust aso.

I appreciate any help :-)
slax57 Apr 12, 2018 @ 10:49am 
Hi

It's already impressive you got this far.
I have almost the same profile as you (web developer), so unfortunately I can't give you further help =/.

Maybe you should try on specialized forums ?

Hope you'll find some help! :)
slax57 May 12, 2018 @ 5:15pm 
Hi everyone!

In case someone's interested, I've enventually found a way to use librespot on the steamlink, the way I originally intended to!

I've described the procedure and provided some code here[github.com].

Note: This solution consists only in a way to start librespot as a background service, and pipe the audio to the default device. There is no user interface of any kind, the only thing displayed on the TV is a static image!

Hope this will still be of use to some of you! :)
slax57 Apr 12, 2020 @ 8:21am 
Bringing this topic back from the dead!

Here is a new solution to achieve this goal: I worked on a forked version of the Kodi Spotify plugin, to make it compatible with the Steamlink and improve its stability.

You can find it here: https://github.com/slax57/plugin.audio.spotify

Since it's still some kind of experiment I made, you have to install it manually from ZIP file (it cannot be installed from a repo).

At the time of writing, local playback is working, either from a Spotify Connect client or from within the plugin itself (library browsing).

Important note: for it to work on the Steamlink, you will need to disable the two options regarding cache in the Advanced section of the add-on setting.

It's still not perfect, but I felt it would be interesting to share it with you guys :)
Last edited by slax57; Apr 12, 2020 @ 9:49am
Verdian_ Jun 7, 2020 @ 1:16pm 
Which Kodi are you running on the SteamLink, cause mine runs terrible and doubt this plugin will be any useful on it.
slax57 Jul 31, 2020 @ 10:16am 
Originally posted by Verdian_:
Which Kodi are you running on the SteamLink, cause mine runs terrible and doubt this plugin will be any useful on it.

Sorry for late answer.

I'm using Kodi v17.6 (https://github.com/garbear/kodi-steamlink/releases/tag/v17.6-2018-03-10)
I found out Kodi v18.x is not stable enough.

With Kodi 17.6 I still encounter some crashes, but it mostly happens when I'm trying to do too much with it (like switching too fast between audio/video streams or switching between plugins). If you keep it easy for the steamlink (stop playback before changing playlist and restart Kodi before using another plugin) it is mostly stable :)
< >
Showing 1-9 of 9 comments
Per page: 1530 50