Steam Link

Steam Link

Steamlink SDK build environment setup
I'm coming off a windows environment and Xubuntu has a similar layout, so that's my choice here. You can do the same with any *buntu. Other distros have different packages, so no guarentees on compatability.
Note: VirtualBox sometimes has issues with displaying newer versions without workarounds.

Getting started (plan a few hours, largely dictated by internet and drive speed)
Expectation is that you can find your way around directories with a terminal and able to install software. Alternative expectation is a place for build questions on various software for Steamlink.

Grab Oracle VirtualBox and install
https://www.virtualbox.org/

Grab Xubuntu 14.04.5 64 bit
Note: We can upgrade later but it works better if we start with this lower version as far as VirtualBox compatability.
http://cdimage.ubuntu.com/xubuntu/releases/trusty/release/xubuntu-14.04.5-desktop-amd64.iso

If at all possible do this with an SSD as compile times gets much faster.
Many many hours faster if you try to compile something like Chromium for QT.

Fire up VirtualBox
Click the New icon in the top left.
Name it 'Xubuntu' type 'Linux' version 'Ubuntu (64-bit)'
Memory, set to 4096 if you have more than 4 gigs of ram.
Follow the defaults
Note: dynamic does not mean that it grows beyond what you pick here, just that it takes less space until reaching this limit.
You may be able to get away with 30 gigs, but I've had to resize already, so I recommend around 50 gigs. (resizing is a pain)

You should now have a powered off Xubuntu machine. Double click it.
It should ask you for the CD. Click the folder icon and browse to the Xbuntu ISO that you downloaded. Follow the prompts.
Download the updates and NOT use 3rd party drivers.
I just use the username steamer and pick a super simple password and log in automatically. You will need your password a lot, so I just pick something simple I can type with one hand.
Note: We aren't running a file server or anything critical, and it's stuck in virtual space away from our main OS, but harden as much as you would like.

If it hangs on reboot (should only take about 10-20 seconds) go to Machine up top and Reset it. When it comes up declune the updates and upgrade prompts. We won't need it.

Luxury Item: I like the "start bar" on the bottom. Right click the bar, Panel->Panel Preferences and unlock. You get a little tab on the left side of the bar you can drag it to the bottom with. Relock and done.

Luxury Item: Click start and drag terminal and web browser to the desktop. The first time you run them select mark executable and it won't bug you again.

Luxury Item: Go to start->settings->litelocker and turn it off so it doesn't keep logging out and blanking screen.

We are are going to want the guest additions to improve performance of the VM (by a lot).
Click Devices and 'Insert Guest Additions CD-ROM'.
It should open the folder. Right click on whitespace in the box and 'Open Terminal Here'

Then run the following for the guest additions.
Note: Linux is case sensitive. Use capital letters where capital
sudo apt-get update sudo apt-get install build-essential sudo ./VBoxLinuxAdditions.run sudo reboot

Once it's done go to Devices and Optical Drive and eject the guest additons.
After that shut it back down.
Right click Xubuntu and go back to settings.
I like to have General->Advanced shared clipboard and drag and drop as bidirectional. (This lets you move files and paste from the Windows clipboard)
Note. I don't know what sort of security risks this poses if any, but I like the convenience. Do your own research on it.
System->Processor I like to use all 4 of my cores.
Display->Enable 3D acceleration

Luxury Item: Go into start->settings->display and bump the resolution up. If it doesn't look right in the window and has scrollbars, press RightCtrl+L then again and it should sort itself out. You can look at the different views in VirtualBox with View on the top menu.

Alright, that should give us a base to start thinking about building something for steamlink.
Go into the terminal either from the desktop shortcut or through the start menu. This starts in your /home/<name> folder.
If you enabled bidirectional clipboard you should be able to start copying commands from here and pasting them into terminal.
We will need git to pull from Github before grabbing the SDK
Note: SDK is over 2gig and it needs to index after, so it'll be awhile.
sudo apt-get install git git clone https://github.com/ValveSoftware/steamlink-sdk.git

Once that's done, let's try the Retroarch example.
Note: it no longer has slowdown after 5-10 minutes
We are going to want to do a couple changes.
Go into the home folder on the desktop, steamlink-sdk/examples/retroarch/ and right click on build_steamlink.sh and open with mousepad.
The line we are looking for is ./configure after # Build it
At the end add --disable-qt --disable-discord and then save and quit.
cd steamlink-sdk/examples/retroarch ./build_steamlink.sh
Note: before each new build of retroarch you will want to got into steamlink-sdk/examples/retroarch/retroarch-src and run 'make clean' from the terminal.

That should be it. If it's successful you now have a steamlink folder in your retroarch folder.
Just copy the whole folder to a usb, plug it in and reboot the steamlink hardware.
Note: To use a USB with VirtualBox go to Devices->usb-> and look for your drive (Mine is a SanDisk Cruzer Edge)
Note2: Otherwise you should be able to just drag it to a folder on your windows machine and do it from there if you enabled bidirectional earlier.

After install take the steamlink/apps/retroarch.tgz and move it to another folder on the USB after install. If you don't it reinstalls and overwrites everytime.

Going to make a step 2 for a more detailed setup including cores, roms, more aggresive optimizations in a following comment.
< >
Showing 1-14 of 14 comments
Once we get a build installed on Steamlink we can just replace the Retroarch executable of new builds without losing our config.

We will want to enable SSH and FTP to the Steamlink. To do this we just need an empty file with the correct name on the USB.
steamlink\config\system
Create a text file called enable_ssh.txt in this folder on the USB. Just leave the file blank and create any folders that don't exist.

When you reboot with the USB in the Steamlink it should be enabled. You can get the device IP from Settings->Network with the Steamlink menu.
Just leave this file where it is on the USB and we don't have to move it like the applications.

I strongly recommend changing the default login from the terminal.
ssh -l root 192.168.xxx.xxx (replace the number with your device IP address.
Login: root
Password: steamlink123
Change the password with passwd

From here I usually use Filezilla with sFTP to connect to the Steamlink and transfer files.
You can get it from the Ubuntu Software Center in your start menu.

------------------------------------------------

If looking to build a core for Retroarch, it's pretty straight forward.

copy build_steamlink.sh from examples/retroarch to examples/snes9x2005
(or whatever core you want to build)


One thing you may to add is a make clean. This will start the compile stage over from the beginning each time you run the script and is useful if you have errors or want to change how it is built. Just place it above the make line.
make clean
make $MAKE_J || exit 2

We want to change the folder name.
change
SRC="${PWD}/retroarch-src"
to
SRC="${PWD}/snes9x2005-src"
(or whatever core you want to build)

We want to change where we get files from.
change
git clone https://github.com/libretro/RetroArch.git "${SRC}"
to
git clone https://github.com/libretro/snes9x2005.git "${SRC}"
(or whatever core you want to build)

We want to remove how it copys and packages the files and won't need an icon.
Remove everything through
#
# Install it
#

through

# All done!

Optional: Change your Build completed message.

Now when you run ./build_steamlink.sh from the folder examples/snes9x2005 it will try to build the core. Because we removed the copy lines it's just going to place the snes9x2005_libretro.so in the snes9x2005-src folder. I usually just copy it from there to the retroarch cores folder with FTP. Not all cores will go easy and some require additional changes to complete. For example not all of them use configure and some use cmake which needs a lot more changes to how the libraries and includes are defined. Most are handled on a case by case basis, but I'll try to answer any questions about a specific core.

I think everyone interested in bulding with that should be able to know this.

Anyway, thanks for taking the time to put it all together, great job.

Regards.
Originally posted by ラウル:
I think everyone interested in bulding with that should be able to know this.

Anyway, thanks for taking the time to put it all together, great job.

Regards.

I put it together because there were issues with trying to build with other distros and versions. Most of it should be pretty familiar for most, but if someone just wants to play around with examples or try to port something over, it should skip some headache of just grabbing the latest distro and then having to start over.
good tutorial!!, part2? compile cores, etc...
I added "If looking to build a core for Retroarch, it's pretty straight forward" to the second post. Let me know if you need further help with it or if I missed any steps.

Also, were you able to build Retroarch okay?
From what I've observed, I think this tutorial is pretty well explained, thank you very much.
what a pity I can not help, although if emulationstation were reality if I can help with the theme and others.

You have watched this

https://steamcommunity.com/app/353380/discussions/1/1488866180609872872/

Seeing the possibility with retroarch, it would be great
Unfortunately no. I'm not familiar with Emulationstation, but may take a look when I get time.
or thanks, it would be something big this would be a good goal
Hi Garbalen, thanks for the guide. I'm experienced when it comes to builds. I even learned to build a whole distro from source.

I was also able to build smaller applications like sdl for steamlink with the help of the steamlink sdk.

However I'm unlucky building the current retroarch git version. When I try to compile it with neon enabled, the compiler gives a error.

"Build assumed that __ARM_NEON__ is defined, but it's not. Exiting"

So I was thinker around for a few hours now. None solution the internet provides worked for me.

I like to know, how to define __ARM_NEON__ so retroarch can get builded with steamsdk?

Please help :)
Try this build script. https://drive.google.com/open?id=1QZJ_HIk8kFoCCEMv-cDSBSK484a-LiLC

I have it in the steamlink-sdk/examples/retroarch folder. Can see if it works for you and make some adjustments from there.

I'm getting "Checking presence of predefined macro __ARM_NEON__ ... yes"

I just deleted my retroarch-src folder and let the script download the git again, and I'm still compiling fine.

Edit: if I remember right it's the -g that does the debug build. I hadn't any luck without it and stripping it afterwards causes issues.

Edit2: can see if this helps
sudo apt-get install libudev1 libudev-dev
Also, make sure you ran "source setenv.sh" in the SDK folder (no quotes).
Hey garbalen. Yes I see you add -g at CFLAGS and CXXFLAGS

It founds NEON now, configure passed without issues. Amazing.
Thanks for the libudev hint, too. I read that udev input is needed for good controller support.
For Arch the udev libs named: libudev0-shim lib32-libudev0-shim


Also we don't have to source setenv.sh. The build script takes care of it :)

if [ "${MARVELL_SDK_PATH}" = "" ]; then
MARVELL_SDK_PATH="$(cd "${TOP}/../.." && pwd)"
fi
if [ "${MARVELL_ROOTFS}" = "" ]; then
source "${MARVELL_SDK_PATH}/setenv.sh" || exit 1
fi

Following happens there:

../../ go two dirs above current retroarch dir.
Execute pwd there to get folder path.
Set pwd output folder path as MARVELL_SDK_PATH
Based on MARVELL_SDK_PATH it now sources setenv.sh two dirs above.


Now after retroarch compiled I like to do some cores. I tried to build pcsx_rearmed.

It tells me I have to configure the build. However when I try it I get a error "libpicofe" is missing. "git submodule init && git submodule update" doesn't solve the issue.
Next I tried is building it with libretro-super. However it does fail, too. Beside missing build scripts for linux-arm target. The libretro guide just cover basic compiling, nobody even mention cross-compiling.
Thus makes it really hard for me to get anything going.
After a few hours I found out that "ARCH=arm" can trigger builds for arm. however it does fail at gte_arm. "to many memory references" , "no such instruction". I assume it still uses x86_64 compiler.
Awesome. Glad to hear you're making progress.

I usually just throw my face at this stuff until it works, but it's going to be nice having someone who knows what they're doing. Kind of a pain digging up info on this as it's pretty sparse.

https://drive.google.com/open?id=1erEQQOCQiIWDSUHWbT8OmY8umRavsN9y

That's my build script for PCSX Rearmed. Should be similar to Retroarch. It just plops libretro.so in the build folder when it's done. I just rename it and throw it on steamlink over ftp to the cores folder.

Edit: So if you want to know why I have inconsistencies in the script or why I did something a certain way, I probably don't know other than it worked :D
< >
Showing 1-14 of 14 comments
Per page: 1530 50