-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
RPi Steamlink Support #4029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RPi Steamlink Support #4029
Conversation
b0feb26
to
60f3045
Compare
Converted to a Kodi addon. The addon is responsible for downloading, verifying and extracting the steamlink tarball. It then launches a preparation script to copy libs into steamlink's lib dir, and 'installs' a systemd script to control launching steamlink. The systemd script is used to survive kodi being shutdown, which would otherwise kill the addon's process and, in turn, steamlink. When prep is complete, the addon triggers the systemd script, which in turns launches steamlink. Steamlink then launches kodi again on exit. Pending issues: Addon is written using python3 features, so don't test on LE9.2. |
60f3045
to
179e2c1
Compare
Update pushed. Changes:
The remaining issue is the system.d unit file. I don't know if there is a better way to handle it. The other addons I looked at didn't have one. Right now, if the addon is uninstalled, the symlink hangs around (harmless but present). The addon notification might be improvable for the steps it's completing. I mostly just wanted it reporting something to the user as otherwise it could be up to 1-2 minutes of wondering if you clicked the addon at all. Not having written a Kodi addon before, that will be for someone else. Tested on RPi3. Wired connection strongly recommended. RPi4 may have issues; no idea. |
from urllib.request import urlretrieve | ||
|
||
|
||
STEAMLINK_VERSION = "1.1.45.105" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is quite ugly to have the version/hash at an unusual place, could we proxy in some not hacky way the version/hash to the package.mk ?
or are there a "latest.zip" somewhere ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://media.steampowered.com/steamlink/rpi/public_build.txt holds the URL of the current build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a sed command to post_install_addon() to have package.mk store steamlink's version and hash.
I believe this is done. I'm unlikely to be able to shepherd it further if there are other changes. |
I wanted to test this on a RPi 4, but it seems I'm having trouble building on master: |
I managed to get a build compiled. Specifically, I couldn't use the merge of @antonlacon 's branch with the current master. It wouldn't complete the build for either the image or the addon. Using @antonlacon 's branch directly, however, got me a build. I fired it up on a spare SD card, and things seem to partially work. The addon downloads the steamlink binaries and is capable of launching things, but it gets stuck for a second before kodi restarts. Running directly, I see the following as output:
I'm not sure the significance of the first line, but some googling seems to indicate that the second one is steamlink failing to activate due to not being able to grab a graphics context. Some input I've found says to make sure a minimal X11 environment is running.. but I have no idea how to go about troubleshooting that here. You mention in the first post that you added a STEAMLINK_SUPPORT flag.. How exactly is that enabled for building the image? I was compiling things like this:
(I'm kind of unfamiliar with the LibreELEC's custom toolchain.. so I was sort of fiddling around and canvasing the codebase to try and guess how flags are set. I'm not sure if the VERBOSE or STEAMLINK_SUPPORT flags actually did anything, however..) So.. yea.. any ideas? |
Master has changes to the buildsystem that will keep this from building. You can read PR 4088 to see what it did. If the chrome add-on changes are in there, that should be hint what needs to change, but it might have been a follow up PR. The QStandardPath message is Qt being unhappy. QT_DEBUG_PLUGINS=1 may show something interesting when starting. It may need a custom build of Qt-5.12.0. STEAMLINK_SUPPORT is no longer relevant. It was in an earlier version of this PR that built the necessary support libs into the image. Everything is an addon now, so it's unnecessary. VERBOSE, to my knowledge, doesn't do anything. You can find many, but not all, of the flags in various "options" files found in distributions, project, and device directories. Some are undocumented in scripts/image. I'm away from any dev hardware for another month-ish, so won't be digging deeper myself for awhile. |
Got it compiling, see https://github.com/cwildfoerster/LibreELEC.tv/commit/1ccc61470502cf74aec1a760329861f6a0045151 |
Okay, just tested it successfully on my rpi3, clean install, only finished the wizard and copied the First start of the steamlink addon took a little while, like 60 seconds after downloading, but steamlink started as expected, connected to my pc and played 2 minutes (limited time). Used the steam controller for testing.
|
I struggle building the addon, are there any precompiled "binaries" to test? |
FYI support is provided via the forum - but just out of interest what problem did you have? What command line did you use to build the add-on, and post details of the error.
No, not until this PR merges, and then only for master nightly builds. |
@antonlacon hope you don't mind, I've pushed a couple of commits that address the outstanding issues with this PR:
|
07d1881
to
60370aa
Compare
Commits look fine. My expectation is the RPi4 addon will fail at runtime for incomplete lib support, or needing Qt replaced with one not looking for said libs. |
Hm, maybe i will order myself a RPi4 to test this, my RPi2/3 run this addon just fine. |
I should note, I'm having trouble just getting libreelec to compile for the latest master or cwildfoerster@1ccc614 Kodi fails to build for some reason. That being said, when I built @antonlacon 's branch, both Kodi and the plugin compiled just fine. The plugin just failed to launch steamlink when ran. |
@CorneliaXaos LibreELEC master 9f00cd2 is currently building OK - our Jenkins is green. I also built this PR on top of LE master earlier today (for both RPi2 and RPi4 devices). If you continue to have problems, post your build log (build master + #4029). |
@MilhouseVH I'm currently running off of a merge of master and this PR and it's failing on compiling Kodi, specifically something to do with dvdcss. I didn't know which part of the build log to post here.. so here's the "threads" file for Kodi: |
@CorneliaXaos hmm yeah, the dvdcss autoreconf step is failing - can you describe your build host (distro, version, etc.) And what command line you used? |
Ubuntu 18.04.4 LTS I should note, this is the command that is failing (specifically, the bold part):
If the command is altered as follows, it executes just fine:
The quotes seem to cause the shell to interpret the quoted section as being a command to run, not as a variable to set. |
|
I'm not sure why you are having this issue - it's not typical. I also don't see how this can be avoided as the command appears to be generated by |
One more thing - can you tell if this error occurred with the previous version of Kodi? There have been some recent cmake changes. |
60370aa
to
c9e0421
Compare
Rebased on master and updated steamlink to 1.1.60.143. Tested on RPi3; RPi4 expected to still be borked. |
I've bought a RPI4 in the meanwhile, will test it some time this week hopefully. |
Just quick info, have tested the build a created on 06.04.2019, installs fine, crashes on start. can't debug right now, do not have my laptop. kodi debug log shows nothing... well of course, kodi gets stopped in order to start steamlink. can't find any logs using samba access only. |
If memory serves, steamlink's log is |
okay, steamlink doesn't even start, uses Im no libreelec dev, i don't know how to include or start a xserver. Funny enough, calling
EDIT okay, currently building a rpi4 image with x11 by changing the options... lets see how that goes. EDIT2 well, would have been way too easy |
@cwildfoerster: I've run into the same error ( |
Slightly modified files from LibreELEC/LibreELEC.tv#4029
c9e0421
to
aea0650
Compare
Rebased and squashed some patches. Updated to 1.1.64. Added necessary code to addon to handle updating steamlink when addon wants a newer version than what is installed. Merged steamlink-prep.sh's tasks into addon proper. Tested desktop/mouse emulation is working and CEC support in steamlink shell (not remote play). Known issue is audio requires dtparam=audio=on in /flash/distroconfig.txt if not using an addon soundcard. I'll look deeper later. I'm currently half expecting to move to KMS to render all this moot, so it's mostly in a holding pattern. |
Signed-off-by: Ian Leonard <[email protected]>
Signed-off-by: Ian Leonard <[email protected]>
Signed-off-by: Ian Leonard <[email protected]>
Signed-off-by: Ian Leonard <[email protected]>
Icon artwork provided by chewitt. Signed-off-by: Ian Leonard <[email protected]>
Signed-off-by: Ian Leonard <[email protected]>
Signed-off-by: Ian Leonard <[email protected]>
aea0650
to
58f789a
Compare
Closing as I don't believe this will be mergeable anytime soon. steamlink's launcher script (the one supplied by Valve) has a handy note that says something along the lines of "don't use KMS, it won't work." That note has been there since shortly after steamlink was released. I've pushed my latest changes to the branch, and it will hang around if someone else wants to do their own builds using the firmware graphics stack. Note that such builds are probably on borrowed time with regards to Kodi 19 support. |
Too bad, been using the 9.2er modified version of yours the last months. Works good for me. Thank you anyways. |
@antonlacon: Quick question to better understand why you closed this: Does standalone LibreELEC 19 "Matrix" not come with a window manager by default and therefore Steam Link would require DRM/KMS support, which it doesn't offer? |
That's exactly it. |
This is a WIP that currently does the foundation work, and includes a launcher script to get started. Tested on an RPi3; should work, but untested, on an RPi4.
Main changes are to build libpng and libjpeg-turbo as shared libs. Libjpeg-turbo also gets its jpeg8 eumlation turned off (I don't know why it was turned on as I don't think anything uses its features in the real world). This also adds a STEAMLINK_SUPPORT feature flag that, at the moment, just adds libXext and its depends to the image for RPi2 and RPi4 in order to make the bundled Qt libraries happy. The "fix indent" commits are cosmetics.
The steamlink-launcher script fetches the steamlink program from Valve, and takes over the cpucheck and udev rule updating from the steamlink program. (@slouken, if the ping works and you check this, you may want to use the cpucheck in this wrapper script: vcgencmd will get you the revision on both 64bit and 32bit kernels, and the substring extraction will work on bash + busybox's shell.)
The script will shutdown kodi (because otherwise input goes to both steamlink and kodi at once) & pulseaudio (or no audio) and then launch steamlink proper. On steamlink exit, pulseaudio and kodi are restored.
To use, login to the LE box with ssh and then run steamlink-launcher.sh. First run involves downloading the program and unpacking it, so it may take a little while to get started.
I have not attempted to package steamlink proper on purpose. Its license is the Steam Subscriber agreement, and from my skimming of it, nothing about it would authorizes hosting and redistribution from a party other than Valve. Raspbian does a similar approach with a launcher script that goes off and fetches steamlink proper from Valve. If someone has a different interpretation on this, they can assume that risk.
Draft because it needs:
Move the udev overlay to a systemd script
Proper integration to get it started form Kodi
Probably more