L4T Ubuntu - A fully featured linux on your switch

switchroot.png

L4T Ubuntu 3.4.0
Intro
L4T Ubuntu is a version of Linux based on nvidia's linux for tegra project. It uses a different kernel compared to previous releases which allows it to use features not yet in mainline. Such as audio, docking support and vulkan.

Beware, using high clocks in handheld mode will degrade your batteries capacity a lot faster than at stock clocks

If you can't install an application check this thread, and ask all questions there
https://gbatemp.net/threads/l4t-ubuntu-applcation-install-guides.537579/

https://discord.gg/N9PPYXjWMY

We have a wiki !
To facilitate our work we will only update our wiki from now on in order to avoid multiple outdated references, please refer to the following link instead of this page

https://wiki.switchroot.org/en/Linux/Ubuntu-Install-Guide

3.4.0 update file listed below With the 3.0+ updates. If doing fresh install, install 3.4.0 image.


Big Thanks to CTCaer for 3.4.0, for fixing the final issues in Ubuntu/Linux kernel and all the testers that helped him.

Features

  • Full USB PD/OTG/OTG Docks
  • Bluetooth (both controllers and audio)
  • Full Joycon Support(Excluding NFC, and IRcamera)
  • Nvidia GPU drivers - Vulkan and OpenGL
  • Audio - Headphones, speakers and over HDMI when docked.
  • Touchscreen(more fixes)
  • Display
  • WiFi(sleep fixes/stability fixes)
  • CPU frequency scaling - The CPU scales from 200mhz to 1.7ghz (what switch is binned for) depending on the load its under. Fans are adjusted to account for this
  • Full sdcard speed
  • Hardware video acceleration when using the built in videos app (means you can watch videos without battery draining massively)
  • Overclocking
  • LP0 Sleep mode
  • IMU/Ambiant Light sensor support
  • reboot2payload
  • Minerva Memory Training
  • Support for Moonlight-QT
  • Initramfs updates(fix partition resize, add boot logo, and error screens)
Prerequisites
  • Minimum of 8 GB.
Downloads
Torrent Links can be found here:
https://torrents.switchroot.org/ubuntu/

Updates for previous 3.0+ installs. 3.4.0 link below.

https://download.switchroot.org/ubuntu/switchroot-ubuntu-3.4.0-update_only-2021-07-23.7z
1. Remove l4t-ubuntu folder and bootloader\ini\01-ubuntu.ini from fat32 partition on sdcard.
2. Extract zip to fat32 partition on sdcard.(if you have no space, try removing all ubuntu related files from fat32 partition on sdcard, and try again.)
3. Dump joycon pairing info in hekate.(Only needs to be done if you havnt already done this)
4. Boot.

How to install:
  1. Download the image (standard non cuda is probably what you want) you want from the downloads section.
  2. Partition with hekate, make sure to leave enough room on fat32 to extract chosen image.
  3. Extract 7z to fat32 partition, now labeled SWITCHSD
  4. Flash image in partition manager in hekate to linux partition.
  5. Go to NYX tools, and dump joycon pairing data, with joycons connected to console, after being paired in hos.
  6. Launch ubuntu through hekate.
  7. Wait for around 2-4 minutes while it initially loads.
  8. Enjoy, you now have fully featured Ubuntu on your switch!
Notes:
  • Pair procons by opening the bluetooth menu in settings and pressing the + button in the bottom left corner. Then press the sync button on the controller and select its name in the pairing window.
  • To update the system run "sudo apt update", "sudo apt upgrade". This will apply all switch and ubuntu updates aside from kernel updates, they will be posted here if ever needed.
  • CPU/GPU/Fan profiles and Overclocking are now handles in NVPmodel.
  • Disabled sandboxing in Chromium in order to enable GPU acceleration
    Night and day difference. Existing users can add --no-sandbox to their desktop shortcut.
Ubuntu Bionic 3.4.0 Short Changelog:
- Better performances in many scenarios (As always that should affect apps/games/emus/etc)
- Significant better deep sleep. (Measured at 582 hours. 440% better).
- Faster wake up from sleep.
- Saved 240MB ram (fb and active file page pool, aka always used pool)
- Memory remapping 800%-2000% speed up. Mostly used by emulators and VMs (and lot in android).
- Some other memory optimizations, plus enabled huge ram pages
- Faster kernel and OS boot.
- Fixed tearing issues for NVDEC/NVENC. (video hw accel)
- Lower latency for frame end calcs for builtin display
- Fixed Hori pads for joycond
- Fixed an issue where it would make railed jc to disconnect on rumble
- Joycon/Procon rumble was improved and intensity tuned for better user experience
- Kernel now uses the proper display panel init/deinit by checking panel id
- Improved dock/undock script
- Touch stays enabled now in dock mode. Users that use docks that do not cover the screen can use it as alternative input.
- Added low ram protection. Now instead of hanging for minutes it will only stutter for seconds until oom occurs and recovers ram
- Better seamless display on boot
- uenv.txt changed, read uenv_readme.txt. It's simple to transfer over custom settings.
- Reboot action can now be defined in new uenv.txt. Reboot back into Linux by changing `reboot_action=` from `bootloader` to `via-payload`.

Apps Changes:
- Full video HW decoding via new SMPV Player app (also supports youtube links)
- Full video HW encoding via ffmpeg-l4t
- Added L4T-Megascript app
You can get or build various essential stuff, apps or emulators with a single click. All configured and optimized for Switch.
- Nvpmodel was updated to include Battery charging protection limits options
Useful when you are constantly docked and want to protect battery's life.
Limit gets saved and applied on boot.
Reminder that discharging can't happen when plugged in. Even when charging is off, usb power is used to supplement system.
So you need to discharge first if you want the battery % to go inside the limit.
That also disables charging in sleep in order for the feature to work.
If you reboot/shutdown, it gets disabled and re-enabled at the next L4T boot.
As always the source is public and all L4T based projects for Switch will benefit (L4T linux distros/Lakka/Android)



Sources
They can all be found at https://gitlab.com/switchroot with the other kernel repos on http://nv-tegra.nvidia.com

Use these scripts if you want to build your own kernel: https://gitlab.com/switchroot/kernel/l4t-kernel-build-scripts/tree/test


Credits
Bylaws,
Langerhans,
Ave,
Natinusala,
CTCaer(most of the hard stuff),
Gavin_Darkglider,
DanielOgorchock(Joycon drivers/joycond),
stary2001 (reboot2payload),
NVIDIA,
Azkali
Everyone else in switchroot - more info on that in the future.
 
Last edited by azkali,

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
I didn't ask question about updates, it is ok to use apt upgrade any way. I mean that original image could be smaller if no office installed.
So why you haven't reformat boot partition to make it work in all OSs? Is there any possible issues if I did that?

PS1: Touch screen dies at random time as before, so it is not fixed.
PS2: TV mode sometimes stops working and only internal screen enabled, so "dock handler fixes" also not complete.
PS3: Thanks for keeping this project alive. And it is shame that Nvidia is lazy to make new kernels release for L4T.
1. Touchscreen is iffy between consoles. It is becoming more appearant since I didnt really have issues, but some are having issues with it after waking from sleep, and when removing from dock.So it is a known issue on discord, where all of the interesting stuff happens with this.
2 Not sure what you mean by tv mode sometimes stops working need more detail before I can look into it.
3. No problem, I wasnt trying to, as my main focus has been my gentoo port, and the arch port.

I do not understand why both with Lakka and L4T do not see me the wifi card I am wrong or one of those switches that does not digest these things I state that everything works in normal and mod mode so I would exclude the broken wifi since in normal and mod it sees me quietly everything and retroarch on the mod works help me I'm going crazy I changed microsd as well but from the exact same problem formatted in fat32
Not sure what the issue is there, hit me up on discord, and I will help you build a kernel with the driver they are using in pie for you to test.

...which has an x86-based processor, not ARM like what's on the Switch.

The closest you're getting to MUGEN on Switch is via streaming.
Might be possible..... if hwdecoder is still working on the switch. Moonlight-qt now has support for jetson nano decoders, which is what the switch is using, using the jetson-ffmpeg project. :)
https://github.com/jocover/jetson-ffmpeg/pull/22
https://github.com/moonlight-stream/moonlight-qt/commit/f0119b1231131f0f84966ef7ab029f909eca5903

just one of the many things I helped get done. real funny thing is I have never used moonlight. lol.
 

Silent_Gunner

Crazy Cool Cyclops
Banned
Joined
Feb 16, 2017
Messages
2,696
Trophies
0
Age
28
XP
4,646
Country
United States
Retroarch opens for 10 seconds and closes immediately after. The window never opens up, and this is after yours truly tried to set the Video plugin to Vulkan, uninstalled RetroArch, deleted the .cfg file in the /etc folder, and then re-installed RetroArch. And then I remember this being a problem with this homebrew solution when I tried the Noob-Ffiendly L4T-Ubuntu build months ago.

What's the definitive way to uninstall RetroArch and then reinstall it to where it'll at least boot up properly?
 

ZachyCatGames

Well-Known Member
Member
Joined
Jun 19, 2018
Messages
3,406
Trophies
1
Location
Hell
XP
4,163
Country
United States
Retroarch opens for 10 seconds and closes immediately after. The window never opens up, and this is after yours truly tried to set the Video plugin to Vulkan, uninstalled RetroArch, deleted the .cfg file in the /etc folder, and then re-installed RetroArch. And then I remember this being a problem with this homebrew solution when I tried the Noob-Ffiendly L4T-Ubuntu build months ago.

What's the definitive way to uninstall RetroArch and then reinstall it to where it'll at least boot up properly?
apt remove all the retroarch and libretro packages, and delete ~/.config/retroarch.
Then compile retroarch from source (compiling it yourself fixes some issues such as vulkan not working), then you can grab all the cores by either doing “sudo apt install libretro-*” (note: some of the cores on apt are super outdated, but is fast and easy) or using libretro super to compile them all (note: this takes half an eternity and a few cores will fail to build, but you’ll have up to date versions of the cores)
 
Last edited by ZachyCatGames,
  • Like
Reactions: Silent_Gunner

Worldblender

Well-Known Member
Member
Joined
May 27, 2019
Messages
307
Trophies
0
Age
26
XP
1,868
Country
United States
I've been hearing repeated mentions of how USB OTG is not working, most likely due to a missing driver that isn't provided. Could I help out with this, such as trying to find similar devices that could contain that missing driver (including other single-board computers and portable devices using similar chipsets), or is that something that has to be provided from Nvidia (in which case if such drivers are private, nothing can be done)?
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
There are 2 reasons it doesnt work.... number 1, we dont know how to turn the charger into power out mode, and we dont know how to detect otg adapters with the usb-c implementation on the switch. Assuming someone could figure out how Hos does it, we can probably implement support. It just isnt a huge deal, as it works on dock.
 

rockraven500

Well-Known Member
Newcomer
Joined
Nov 12, 2009
Messages
86
Trophies
0
Age
30
Location
British Columbia
Website
Visit site
XP
305
Country
Canada
@Worldblender I was actually just about to ask about this. I am trying to plug something usbc/usbc into my switch, but I'm not sure if that's covered under the OTG umbrella. It's a QMK powered keyboard https://olkb.com/planck that I want to flash with new software. If any information could be offered on this, that would be great. I'm explicitly trying to do this as a portable solution, so docking is not an option.
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
yes that is covered under the otg umbrella as you say. otg pulls down power delivery through resistors to ground. This triggers an interrupt, that changes xusb to host mode, and turns on power output. We know how to switch, as we do that on the dock already.
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
Probably not. it isnt a huge priority to us. it is on the list of things to do, but it is somewhere after release fully working android pie. And I am still trying to get ubuntu fully updated.
 
Last edited by Gavin_Darkglider,

rockraven500

Well-Known Member
Newcomer
Joined
Nov 12, 2009
Messages
86
Trophies
0
Age
30
Location
British Columbia
Website
Visit site
XP
305
Country
Canada
Well that's a shame as it's the only reason for me setting this up on my switch. Thank you for the information though. Might you have any idea how I might be able to circumvent this? A pocket size portable dock or bluetooth/usb adapter maybe?

Edit: Providing a dock doesn't actually require an external display, which I believe is the case, would something like the genki dock provide me with the connectivity I'm looking for?
 
Last edited by rockraven500,

rockraven500

Well-Known Member
Newcomer
Joined
Nov 12, 2009
Messages
86
Trophies
0
Age
30
Location
British Columbia
Website
Visit site
XP
305
Country
Canada
If it's the official dock hardware that will mean it needs the original switch charger plugged into it, so I'd have to have that with me as well. Will the dock act a hub if it's unpowered? Would enough power be given if I instead plugged it into a power adapter or pc, or is that a power failure?
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
No, and any usb option you might be able to get to work, will require a powersupply of its own, so the switch dock is just useful. Technically, if you dont care about device mode, you can force the port into host mode, and then it provide devices that are powered, and it should theoretically work.
 

rockraven500

Well-Known Member
Newcomer
Joined
Nov 12, 2009
Messages
86
Trophies
0
Age
30
Location
British Columbia
Website
Visit site
XP
305
Country
Canada
So if that's the case that I should be able to force it to work, what I would need is: A usbc/usba cable, a small hub with micro usb power, micro/usba cable, and a way to force host mode? I'm a little unclear on modes here. What I'm looking to do is flash firmware to a device, would this setup be inhibited if I arranged this hardware? Also, for all this, is it a limitation of the software and port itself? If I got a usb hub to connect over bluetooth, would I see the same limitation? Also, why don't thirdparty docks work?
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
I dont think the make a device like that that breaks out a usb hub via bluetooth. and dts stuff means you need to rebuild the kernel, and then device mode wont work.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Skelletonike @ Skelletonike:
    3h left until work finishes, bah
  • Skelletonike @ Skelletonike:
    link doesn't work
    +2
  • Skelletonike @ Skelletonike:
    1H left, such a slow week.
  • Sonic Angel Knight @ Sonic Angel Knight:
    Okay, I had spaghetti :P
  • SylverReZ @ SylverReZ:
    Hope they made lots of spaget
  • K3N1 @ K3N1:
    Chill dog
  • SylverReZ @ SylverReZ:
    Chilli dog
  • Skelletonike @ Skelletonike:
    Damn, I'm loving the new zelda.
  • xtremegamer @ xtremegamer:
    loving the new zelda, i started a game, it was so fucking good, so i
    am waiting on my friend to get home so we can start a new one together
  • Skelletonike @ Skelletonike:
    I just dislike that they don't let me choose the voices before the game starts. Happened with botw as well, had to change to japanese and restart.
  • K3N1 @ K3N1:
    But the important question is can you choose gender
  • Skelletonike @ Skelletonike:
    Same way you can choose Gerald's gender.
  • Skelletonike @ Skelletonike:
    *Geralt, damn autocorrect.
  • Psionic Roshambo @ Psionic Roshambo:
    But can he be trans? Lol
  • K3N1 @ K3N1:
    Zelda transforms into link
  • Psionic Roshambo @ Psionic Roshambo:
    Link I'm not the princess your looking for.... *Pulls a crying game*
  • K3N1 @ K3N1:
    *skirt up* it's exactly what I always wanted
  • Skelletonike @ Skelletonike:
    Just scanned all my zelda amiibos, took a while but didn't get anything that cool, did get the lon lon ranch hylian fabrics though.
  • Skelletonike @ Skelletonike:
    It was pretty funny when I scanned wolf link and got a shit load of meat.
  • K3N1 @ K3N1:
    @Skelletonike, btw I ran that custom for mgs4 on the deck I'm amazed it got that far in game
  • K3N1 @ K3N1:
    Plug in*
    K3N1 @ K3N1: Plug in*