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,

specterx12

Member
Newcomer
Joined
May 1, 2019
Messages
5
Trophies
0
Age
33
XP
69
Country
Vietnam
Hey folks to get joycons working properly you have to:

Code:
sudo gedit /usr/local/share/moonlight/gamecontroller.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.
after doing everything correctly and working the first time. When I try to start the stream again I get this.
Can't map (dpdown:+a1)
Can't map (dpleft:-a0)
Can't map (dpright:+a0)
Can't map (dpup:-a1)
Can't map (dpdown:+a1)
Can't map (dpleft:-a0)
Can't map (dpright:+a0)
Can't map (dpup:-a1)
Can't map (dpdown:+a1)
Can't map (dpleft:-a0)
Can't map (dpright:+a0)
Can't map (dpup:-a1)
Can't map (dpdown:+a1)
Can't map (dpleft:-a0)
Can't map (dpright:+a0)
Can't map (dpup:-a1)
Can't map (lefttrigger:+a3)
Can't map (righttrigger:-a3)
Can't map (dpdown:+a1)
Can't map (dpleft:-a0)
Can't map (dpright:+a0)
Can't map (dpup:-a1)
Can't map (dpdown:+a1)
Can't map (dpleft:-a0)
Can't map (dpright:+a0)
Can't map (dpup:-a1)
Failed to open device /dev/input/event0
Failed to open device /dev/input/event1
Failed to open device /dev/input/event4
Failed to open device /dev/input/event5
Failed to open device /dev/input/event6
Failed to open device /dev/input/event7
Failed to open device /dev/input/event3
Failed to open device /dev/input/event2

Initializing platform...done
Resolving host name...done
Starting RTSP handshake...RTSP OPTIONS request failed: 552
failed: 552
Cleaning up platform...done

Do you know how to fix this?
 

ZeroFX

why?
OP
Member
Joined
Jun 18, 2018
Messages
1,101
Trophies
1
Location
napaJ
XP
2,983
Country
Japan
after doing everything correctly and working the first time. When I try to start the stream again I get this.
Can't map (dpdown:+a1)
Can't map (dpleft:-a0)
Can't map (dpright:+a0)
Can't map (dpup:-a1)
Can't map (dpdown:+a1)
Can't map (dpleft:-a0)
Can't map (dpright:+a0)
Can't map (dpup:-a1)
Can't map (dpdown:+a1)
Can't map (dpleft:-a0)
Can't map (dpright:+a0)
Can't map (dpup:-a1)
Can't map (dpdown:+a1)
Can't map (dpleft:-a0)
Can't map (dpright:+a0)
Can't map (dpup:-a1)
Can't map (lefttrigger:+a3)
Can't map (righttrigger:-a3)
Can't map (dpdown:+a1)
Can't map (dpleft:-a0)
Can't map (dpright:+a0)
Can't map (dpup:-a1)
Can't map (dpdown:+a1)
Can't map (dpleft:-a0)
Can't map (dpright:+a0)
Can't map (dpup:-a1)
Failed to open device /dev/input/event0
Failed to open device /dev/input/event1
Failed to open device /dev/input/event4
Failed to open device /dev/input/event5
Failed to open device /dev/input/event6
Failed to open device /dev/input/event7
Failed to open device /dev/input/event3
Failed to open device /dev/input/event2

Initializing platform...done
Resolving host name...done
Starting RTSP handshake...RTSP OPTIONS request failed: 552
failed: 552
Cleaning up platform...done

Do you know how to fix this?
I get RTSP handshake failed every time a steam game is already open, or i leave big picture opened. Weird, RTSP handshake is usually related to UDP so its an error that i usually see when remote playing out of home.
 
  • Like
Reactions: burt111

specterx12

Member
Newcomer
Joined
May 1, 2019
Messages
5
Trophies
0
Age
33
XP
69
Country
Vietnam
I get RTSP handshake failed every time a steam game is already open, or i leave big picture opened. Weird, RTSP handshake is usually related to UDP so its an error that i usually see when remote playing out of home.
strange I dont have any steam game already open. I have league of legend open only. Can it be that, that is causing the problem? Cause I cant get it to stream at all.
 

specterx12

Member
Newcomer
Joined
May 1, 2019
Messages
5
Trophies
0
Age
33
XP
69
Country
Vietnam
I get RTSP handshake failed every time a steam game is already open, or i leave big picture opened. Weird, RTSP handshake is usually related to UDP so its an error that i usually see when remote playing out of home.
just got it to work, but for my joy con on steam. the dpad does not work at all. I try to configure it on steam but it like the dpad is dead. I try to press multiple time but still won't work. Is there a work around for it?
 

Jethozo

Member
Newcomer
Joined
Apr 11, 2018
Messages
11
Trophies
0
Age
42
XP
266
Country
United Kingdom
Only issue I'm having with the joycons is when I press up with the Left joystick Ubuntu says down. When I press down with the left joystick Ubuntu sees up.

Any idea where I would change this setting in Ubuntu?
You need to update your Ubuntu installation with the files provided in the main Linux thread. That’ll fix the joycon issues.
 
  • Like
Reactions: Leonidas87

Leonidas87

Well-Known Member
Member
Joined
Jul 15, 2014
Messages
651
Trophies
0
Location
Toronto, Ontario
Website
www.youtube.com
XP
960
Country
Canada
I've notice once I start stream there is some flickering of the steam menu that pops in and out over the entire screen. Maybe 1 to 5 frames every few seconds. So far so good tho, very interesting.

Anyone else had some video flickering of say the menu cutting in/store or library?
 

ZeroFX

why?
OP
Member
Joined
Jun 18, 2018
Messages
1,101
Trophies
1
Location
napaJ
XP
2,983
Country
Japan
just got it to work, but for my joy con on steam. the dpad does not work at all. I try to configure it on steam but it like the dpad is dead. I try to press multiple time but still won't work. Is there a work around for it?

You checked the tutorial again for the joy con configuration? I added yesterday :).
 

Jethozo

Member
Newcomer
Joined
Apr 11, 2018
Messages
11
Trophies
0
Age
42
XP
266
Country
United Kingdom
You checked the tutorial again for the joy con configuration? I added yesterday :).
I think maybe
sudo gedit /usr/local/share/moonlight/gamecontroller.txt

Should be
sudo gedit /usr/local/share/moonlight/gamecontrollerdb.txt

Perhaps why people’s bindings aren’t sticking!
 
  • Like
Reactions: ZeroFX

knopex

Member
Newcomer
Joined
Jun 12, 2012
Messages
21
Trophies
0
XP
418
Country
United States
Thank you for this Tutorial. I followed every step and i got working game streaming.

However the performance is very poor, to me it seems moonlight doesn't use hardware acceleration, because the cooling Fan turns on and gets really loud. The stream is very choppy and laggy. Games are unplayable.

I have also an old netbook with arch linux, moonlight works there like a charm without any lag.

How can i find out if moonlight uses Hardware acceleration on my switch?
 

ZeroFX

why?
OP
Member
Joined
Jun 18, 2018
Messages
1,101
Trophies
1
Location
napaJ
XP
2,983
Country
Japan
Thank you for this Tutorial. I followed every step and i got working game streaming.

However the performance is very poor, to me it seems moonlight doesn't use hardware acceleration, because the cooling Fan turns on and gets really loud. The stream is very choppy and laggy. Games are unplayable.

I have also an old netbook with arch linux, moonlight works there like a charm without any lag.

How can i find out if moonlight uses Hardware acceleration on my switch?
I think it's not a Hardware acceleration problem, i mean it can be this too, but i get a lot of "Network dropped an entire frame" and "Unrecoverable frame XXXXX" or Invalidate reference frame request sent (XXXXX to XXXXX)"", those are network problems (and i have a beefy router :P, perfect gameplay on other devices like psvita or galaxy s8).

So, my guess? maybe wireless network drivers, not the wifi module, but the drivers on ubuntu (in home switching on horizon also works fine)... This could also explain things like 900KB/s to 1MB/s speed when downloading (under 5GHz), i have a 50mbps network, it should be 5-6MB/s like on horizon.

What kills my theory is that i don't have a USB Ethernet adapter, so i have no way to test moonlight wired and confirm my theory, because i think wired could be faster (https://github.community/t5/Project...d-Frames-Multiple-Errors-Crash/m-p/7518#M1519).

You can read this too if you want: https://github.com/irtimmer/moonlight-embedded/issues/292
 

knopex

Member
Newcomer
Joined
Jun 12, 2012
Messages
21
Trophies
0
XP
418
Country
United States
I have an official Nintendo Wii USB Ethernet Adapter. Works fine on Horizon with my otg usb c Kabel.
But on Ubuntu it gets only detected in docked mode and the Kernel module for the ax8872 chipset is missing.
So I need to recompile the kernel just to test if moonlight works better. But idk how.
 
  • Like
Reactions: ZeroFX

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    I @ idonthave: :)