[Tutorial] Compiling and Installing Moonlight-embedded on L4T Ubuntu

Discussion in 'Switch - Tutorials' started by ZeroFX, Apr 30, 2019.

  1. ZeroFX
    OP

    ZeroFX Advanced Member

    Newcomer
    3
    Jun 18, 2018
    United Kingdom
    Hi, 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 wonders 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, May 5, 2019
  2. lordelan

    lordelan GBAtemp Psycho!

    Member
    11
    Jan 4, 2015
    Germany
    Nice thanks. I guess this runs smoother and with audio compared to In-Home-Switching?
     
    ZeroFX likes this.
  3. ZeroFX
    OP

    ZeroFX Advanced Member

    Newcomer
    3
    Jun 18, 2018
    United Kingdom
    Yes, the only thing is that you have to configure the joycons.
     
    lordelan likes this.
  4. OverkillLabs

    OverkillLabs Newbie

    Newcomer
    1
    Jan 26, 2019
    Bulgaria
    I get an error when I type cmake ../ it goes fine but at the end gives an error "No video output available"
     
  5. Taorn

    Taorn GBAtemp Regular

    Member
    4
    May 27, 2017
    United States
    You're probably missing libavcodec. Try:
    Code:
    sudo apt-get install libavcodec-dev
     
    ZeroFX and javilobo8 like this.
  6. OverkillLabs

    OverkillLabs Newbie

    Newcomer
    1
    Jan 26, 2019
    Bulgaria
    Yes that was the problem thanks a lot! Now it installed correctly.
     
  7. javilobo8

    javilobo8 Advanced Member

    Newcomer
    4
    May 10, 2018
    Spain
    I'm getting the same error after instaling libavcodec-dev :/
     
  8. specterx12

    specterx12 Newbie

    Newcomer
    1
    May 1, 2019
    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!
     
  9. Jethozo

    Jethozo Newbie

    Newcomer
    1
    Apr 11, 2018
    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.
     
  10. Taorn

    Taorn GBAtemp Regular

    Member
    4
    May 27, 2017
    United States
    Could you execute
    Code:
    cmake ../ >> output.txt
    and attach the file here?
     
  11. javilobo8

    javilobo8 Advanced Member

    Newcomer
    4
    May 10, 2018
    Spain
     

    Attached Files:

  12. tansoftware

    tansoftware Member

    Newcomer
    1
    Apr 15, 2019
    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
     
  13. Taorn

    Taorn GBAtemp Regular

    Member
    4
    May 27, 2017
    United States
    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, May 1, 2019
    javilobo8 likes this.
  14. javilobo8

    javilobo8 Advanced Member

    Newcomer
    4
    May 10, 2018
    Spain
    Working, thank you so much
     
  15. Jethozo

    Jethozo Newbie

    Newcomer
    1
    Apr 11, 2018
    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!
     
  16. ZeroFX
    OP

    ZeroFX Advanced Member

    Newcomer
    3
    Jun 18, 2018
    United Kingdom
    Ill add those other dependencies to the op, before moonlight i had built other things so this will definitely help people with clean installations.
     
  17. burt111

    burt111 Member

    Newcomer
    1
    Oct 30, 2016
    United States
    I get a failed to initialize vaapi connection -1 unknown libva error
     
  18. Jethozo

    Jethozo Newbie

    Newcomer
    1
    Apr 11, 2018
    United Kingdom
    I get that too. Doesn’t appear to stop it working though.
     
  19. ZeroFX
    OP

    ZeroFX Advanced Member

    Newcomer
    3
    Jun 18, 2018
    United Kingdom
    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, May 2, 2019
  20. burt111

    burt111 Member

    Newcomer
    1
    Oct 30, 2016
    United States
    Didn’t work no display pops up and no sign from pc
     
Loading...