Tutorial  Updated

Installing Moonlight-QT on L4T Ubuntu

GuideOptional


  1. Before continuing forth, know that now you can use moonlight-qt on the latest Ubuntu L4T 3.0.0, you should DEFINITELY check it out, since it uses HARDWARE ACCELERATION meaning it's lightyears faster than embedded, that can't work with it now due to lack of support.

    If you had followed this guide before, uninstall the old package by doing 'sudo apt remove moonlight'.

    Here's how get moonlight-qt, also, definitely check the optional tab later, contains some quality of life that you should see:

    • First you need to download and flash UL4T 3.0.0, and boot it, after that you're going to run the following commands to install Moonlight Qt to your UL4T:
    Code:
    curl -1sLf 'https://dl.cloudsmith.io/public/moonlight-game-streaming/moonlight-l4t/setup.deb.sh' | sudo -E bash
    • And finally install your moonlight:
    Code:
    sudo apt install moonlight-qt
    • You can then launch Moonlight from your desktop or via the moonlight-qt command in the terminal.
    • To update Moonlight Qt after you've installed it, run:
    Code:
    sudo apt update
    sudo apt upgrade


    And have fun with hw accelerated moonlight-qt!! Updated the repo on the guide for the new official release.
    You can also refer to the official wiki on how to install: https://github.com/moonlight-stream...ling-Moonlight-Qt-on-Linux4Tegra-(L4T)-Ubuntu

  2. This one by FeranthurReturn can improve QoL by a lot, specially when away from dock and keyboard.

    • You'll need to install xorg joystick:
    Code:
    sudo apt install xserver-xorg-input-joystick

    • Download the config file and move to usr/share/X11/xorg.conf.d
    Code:
    wget https://cdn.discordapp.com/attachments/604648722491768883/684926248505704484/50-joystick.conf && sudo mv 50-joystick.conf /usr/share/X11/xorg.conf.d

    • Reboot or log-out and log back in.

    These are the default mappings, you can change them by editing 50-joystick.conf:
    ButtonsMappings and key code
    ARight Mouse Button(button=3)
    BLeft Mouse Button(button=1)
    L and RVolume up(key=123) and Volume down(key=122)
    ZL and ZRBrightness up(key=233) and Brightness down(key=232)
    ScreenshotEnables/Disable mouse mode (when you want to play games)
    HomeEsc(Key=9)
    Plus (+)Enter(key=36)
    Minus (-)Back(key=22)


    If you want to edit, these are the joycon's button codes:
    ButtonButton Codes
    BMapButton 5
    AMapButton 6
    XMapButton 7
    YMapButton 8
    ScreenshotMapButton 9
    LMapButton 10
    RMapButton 11
    ZLMapButton 12
    ZRMapButton 13
    Minus (-)MapButton 14
    Plus (+)MapButton 15
    HomeMapButton 16
    LStickMapButton 17
    RStickMapButton 18


    After editing save and reboot/relog.
    This one is a nice indicator that will stay on your taskbar's tray, you can use it to change CPU frequency on the go, for moonlight 1.02GHz is perfectly fine.

    • Just install it and reboot:
    Code:
    sudo apt install indicator-cpufreq

    • Change frequency by right clicking it's icon.


Any errors or tips? Point them.
Build this only if you have a specific goal in mind, end users AVOID, use moonlight-qt because this one doesn't have hwdecoding, won't be fast.

Now, this is how i made moonlight-embedded work with l4t, no magic, basic compiling and running.

Preparing.
  • First do the good old update, before that you have to apply the 1.1 update available on the ubuntu lt4 thread!
Code:
sudo apt-get update

  • Then install the dependencies, some of them will already be installed on Ubuntu L4T but run it either way (some aren't), if other distro pops out without them here's how you get them:
Code:
sudo apt-get install libopus0 libexpat1 libasound2 libudev1 libavahi-client3 libcurl3 libevdev2 libenet7 -y && sudo apt-get install libssl-dev libopus-dev libasound2-dev libudev-dev libavahi-client-dev libcurl4-openssl-dev libevdev-dev libexpat1-dev libpulse-dev uuid-dev libenet-dev cmake gcc g++ fakeroot debhelper libavcodec-dev libsdl2-dev -y

Now for the actual cloning and compiling part (fun begins).
  • Clone the repository with this command:
Code:
git clone https://github.com/irtimmer/moonlight-embedded.git

  • Then compile it following this:
Code:
cd moonlight-embedded
git submodule update --init
mkdir build
cd build/
cmake ../
make
sudo make install
sudo ldconfig

Restart and you should be ready (fun deepens).
  • Here a basic connection setup:
Code:
moonlight pair <pc local ip>
moonlight stream <pc local ip>

That's it! Works somewhat well with my router: TP-Link C3200.

But now we have to config our Joy-Cons to work with moonlight, since it cant detect and map it accordingly.
  • Got ya covered, to do that you have to just:
Code:
sudo gedit /usr/local/share/moonlight/gamecontrollerdb.txt

  • Scroll to the end and add this line if you want ninty's layout:
Code:
050000007e0500000620000001000000,Nintendo Switch Joy-Cons,a:b1,b:b0,back:b9,dpdown:b15,dpleft:b16,dpright:b17,dpup:b14,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b2,y:b3,

  • If you want M$'s layout (invert a and b, x and y):
Code:
050000007e0500000620000001000000,Nintendo Switch Joy-Cons,a:b0,b:b1,back:b9,dpdown:b15,dpleft:b16,dpright:b17,dpup:b14,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,

Look up for the moonlight command to see the available variables for you to tweak your connection (bitrate, resolution, input device and etc.).

Any errors or things i should add, point them :).
 
Last edited by ZeroFX,

OverkillLabs

Well-Known Member
Newcomer
Joined
Jan 26, 2019
Messages
45
Trophies
0
Age
34
XP
301
Country
Bulgaria
I get an error when I type cmake ../ it goes fine but at the end gives an error "No video output available"
 

specterx12

Member
Newcomer
Joined
May 1, 2019
Messages
5
Trophies
0
Age
33
XP
69
Country
Vietnam
Hey thank you for the tutorial. I have a few questions. When I press the command to stream it, it took me straight to steam. but my joycon button didn't move the controller at all on steam. Is there a way to fix this? and is there a way to make it stream my computer screen instead of going straight to steam. Thank YOU!
 

Jethozo

Member
Newcomer
Joined
Apr 11, 2018
Messages
11
Trophies
0
Age
42
XP
266
Country
United Kingdom
Can’t fix your controller issues, but if you want to go straight to desktop you need to add “mstsc” (found in system32 folder) in GeForce experience, then specify it with “-app mstsc” when loading moonlight.
 

tansoftware

Active Member
Newcomer
Joined
Apr 15, 2019
Messages
36
Trophies
0
Age
42
XP
344
Country
Canada

I got the same error... Figured there are several other missing dependencies that are still needed:

-- Checking for module 'sdl2>=2.0.4' -- No package 'sdl2' found
-- Checking for module 'vdpau' -- No package 'vdpau' found
-- Checking for module 'libva' -- No package 'libva' found
-- Checking for module 'libva-x11' -- No package 'libva-x11' found
-- Checking for module 'libcec>=4' -- No package 'libcec' found
-- Checking for module 'egl' -- No package 'egl' found
-- Checking for module 'glesv2' -- No package 'glesv2' found
 

Taorn

Well-Known Member
Member
Joined
May 27, 2017
Messages
257
Trophies
0
Age
53
XP
1,823
Country
United States

I got the same error... Figured there are several other missing dependencies that are still needed:

-- Checking for module 'sdl2>=2.0.4' -- No package 'sdl2' found
-- Checking for module 'vdpau' -- No package 'vdpau' found
-- Checking for module 'libva' -- No package 'libva' found
-- Checking for module 'libva-x11' -- No package 'libva-x11' found
-- Checking for module 'libcec>=4' -- No package 'libcec' found
-- Checking for module 'egl' -- No package 'egl' found
-- Checking for module 'glesv2' -- No package 'glesv2' found

You both are missing sdl2. Try to install the package:
Code:
sudo apt install libsdl2-dev

If this fails, you can still compile it yourself. But try the package installation first.
How to compile it yourself:
Code:
wget https://www.libsdl.org/release/SDL2-2.0.9.tar.gz
tar xf SDL2-2.0.9.tar.gz
cd SDL2-2.0.9
mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig
 
Last edited by Taorn,
  • Like
Reactions: javilobo8

javilobo8

Well-Known Member
Newcomer
Joined
May 10, 2018
Messages
90
Trophies
0
Age
30
Website
lobobot.com
XP
502
Country
Spain
You both are missing sdl2. Try to install the package:
Code:
sudo apt install libsdl2-dev

If this fails, you can still compile it yourself. But try the package installation first.
How to compile it yourself:
Code:
wget https://www.libsdl.org/release/SDL2-2.0.9.tar.gz
tar xf SDL2-2.0.9.tar.gz
cd SDL2-2.0.9
mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig
Working, thank you so much
 

Jethozo

Member
Newcomer
Joined
Apr 11, 2018
Messages
11
Trophies
0
Age
42
XP
266
Country
United Kingdom
Anyone managed to configure controls? Steam won’t let me, it instantly assigns button 0 to any binding I attempt. Moonlight recommends the sdl2 gamepad configurable, but I don’t think there’s an ARM version.
That aside, it’s working really well! Tried it 20 miles away and the lag isn’t bad!
 
  • Like
Reactions: falcorr

ZeroFX

why?
OP
Member
Joined
Jun 18, 2018
Messages
1,078
Trophies
1
Location
napaJ
XP
2,930
Country
Japan
Ill add those other dependencies to the op, before moonlight i had built other things so this will definitely help people with clean installations.
 

ZeroFX

why?
OP
Member
Joined
Jun 18, 2018
Messages
1,078
Trophies
1
Location
napaJ
XP
2,930
Country
Japan
Hey folks to get joycons working properly you have to:

Code:
sudo gedit /usr/local/share/moonlight/gamecontrollerdb.txt

Scroll to the end and add this line if you want ninty's layout:

Code:
050000007e0500000620000001000000,Nintendo Switch Joy-Cons,a:b1,b:b0,back:b9,dpdown:b15,dpleft:b16,dpright:b17,dpup:b14,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b2,y:b3,

If you want M$'s layout (invert a and b, x and y):
Code:
050000007e0500000620000001000000,Nintendo Switch Joy-Cons,a:b0,b:b1,back:b9,dpdown:b15,dpleft:b16,dpright:b17,dpup:b14,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,

That's it.
 
Last edited by ZeroFX,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • Sicklyboy @ Sicklyboy:
    maaaaan that's so awesome but I also don't want to fork over a hundo for it
  • Veho @ Veho:
    The fuuuuu---
  • Veho @ Veho:
    I thought it was an actual xBox at that price.
  • Sicklyboy @ Sicklyboy:
    I wanna grab a 360 Slim and a 360 E one of these days. Missed the boat of getting them at their lowest though, once they were discontinued. Could've got them for cheap back when I was a broke 20 something working at Target, but then again, I was a broke 20 something working at Target
  • Veho @ Veho:
    Being broke is no fun.
  • K3Nv2 @ K3Nv2:
    @Sicklyboy, $150 isn't that bad for a jtag slim on ebay
  • Veho @ Veho:
    I only wish it was actually playable.
  • Veho @ Veho:
    There's a guy on the Tube of You that makes playable mechanical arcade games out of Lego. This could work on the same principle.
  • Veho @ Veho:
    Just a couple of guys taking their manatee out for some fresh air, why you have to molest them?
  • Veho @ Veho:
    Stupid Chinese shop switched their shipping company and this one is slooooooow.
  • LeoTCK @ LeoTCK:
    STOP BUYING CHINESE CRAP THEN
  • LeoTCK @ LeoTCK:
    SUPPORT LOCAL PRODUCTS, MAKE REVOLUTION
  • LeoTCK @ LeoTCK:
    THEY KEEP REMOVING LOCAL SHIt AND REPLACING WItH INFERIOR CHINESE CRAP
  • LeoTCK @ LeoTCK:
    THATS WHY MY PARTNER CANT GET A GOOTWEAR HIS SIZE ANYMORE
  • LeoTCK @ LeoTCK:
    HE HAS BIG FOOT AND BIG DUCK
  • LeoTCK @ LeoTCK:
    d*ck i mean*
  • LeoTCK @ LeoTCK:
    lol
  • Veho @ Veho:
    Mkay.
  • Veho @ Veho:
    I just ordered another package from China just to spite you.
  • SylverReZ @ SylverReZ:
    Leo could not withstand communism.
  • SylverReZ @ SylverReZ:
    Its OUR products to begin with lol.
    SylverReZ @ SylverReZ: Its OUR products to begin with lol.