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/9d66FYg

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,

Gigaboy

Active Member
Newcomer
Joined
May 12, 2019
Messages
31
Trophies
0
Age
20
Website
www.gigaboy.dev
XP
156
Country
United States
Also, is there a way to detect if the Switch is docked? I wanna write a bash script that enables overclocks when docked, but returns to normal when undocked. I assume there's some way to detect when a display is added/remove, but I don't do much bash programming so I wasn't sure.
 

sergio_prado

Well-Known Member
Newcomer
Joined
Feb 26, 2014
Messages
70
Trophies
0
Age
39
Location
Barueri, Brazil
XP
531
Country
Brazil
If someone could upload their '/etc/nv_boot_control.conf' file here that would be great. I seem to have deleted my copy? Idk, I have 3 broken packages that say they need it. (nvidia-l4t-xusb-firmware, nvidia-l4t-initrd, and nvidia-l4t-apt-source)

There's no such file in that folder or any other folder.(I searched for it everywhere).
 

Gigaboy

Active Member
Newcomer
Joined
May 12, 2019
Messages
31
Trophies
0
Age
20
Website
www.gigaboy.dev
XP
156
Country
United States
There's no such file in that folder or any other folder.(I searched for it everywhere).
That's odd. It was saying that it couldn't read that file when trying to update those 3 packages. I thought it must've been deleted by accident, but I guess not. I guess I'll just try a fresh install of L4T since I haven't done anything important on it yet
 

GuillermoTell15

Member
Newcomer
Joined
Jan 26, 2018
Messages
8
Trophies
0
Age
27
XP
46
Country
Spain
Is there KVM support? It'd be interesting to test if a Windows 10 ARM VM works. I'm aware of Imbushuo's attempt to boot it, but as it's incomplete and I have no idea about implementing Tianocore EDKII it looks impossible for now.
 

Gigaboy

Active Member
Newcomer
Joined
May 12, 2019
Messages
31
Trophies
0
Age
20
Website
www.gigaboy.dev
XP
156
Country
United States
Hey, it's me again. Has anyone tried using a pro controller to play dolphin emu? Mine says it's connected and paired under bluetooth settings, but dolphin says device not found when choosing input method for emulated wiimote
 

bailli

Well-Known Member
Member
Joined
Oct 16, 2006
Messages
219
Trophies
0
Website
Visit site
XP
1,654
Country
Gambia, The
Very different topic:
I am trying to build a game which uses Haxe and Lime. For Haxe itself there exists a ppa which includes arm64 packages, and I guess I managed to compile Lime correctly (was a bit tricky as hxcpp does not really expect a Linux arm64 target). At least a few sample applications work.

However the application I actually want to compile crashes at startup with sigbus and running it through gdb suggests it crashes somewhere in the pthreads library.

Has anybody expierenced something similar? It might actually be a bug in pthreads as googling showed that this happens on non x86 platforms...
 
Last edited by bailli,

dbrown1986

Member
Newcomer
Joined
Nov 25, 2020
Messages
7
Trophies
0
Age
35
XP
70
Country
United States
Hekate just tells me that it can't find the install files when I put them on the FAT32 partition I created in Hekate. What am I missing?

EDIT: Nevermind. Copied the files over to the SD again and now it's behaving as it should.

Now I just have to figure out if there is any way to resize the 7GB install partition that Hekate created, back into the Ubuntu Ext4 partition. You'd think it would be easy, but since the partition is first on the partition table; before the Ubuntu partition, there are some limitations to creating, removing or resizing partitions to the left of another partition without causing errors or data loss.
 
Last edited by dbrown1986,

Eggman54

Active Member
Newcomer
Joined
Sep 26, 2020
Messages
28
Trophies
0
Age
28
XP
99
Country
United States
I can't update anything or install anything using sudo apt says i got an error in source.list this is after a fresh install.
 
Last edited by Eggman54,

Eggman54

Active Member
Newcomer
Joined
Sep 26, 2020
Messages
28
Trophies
0
Age
28
XP
99
Country
United States
trying to map joycons dpad buttons to arrows on keyboard just need help locating button index in this file
Section "InputClass"
Identifier "joystick catchall"
MatchIsJoystick "on"
MatchDevicePath "/dev/input/event*"
Driver "joystick"
Option "MapButton1" ""
Option "MapButton2" ""
Option "MapButton3" "button=2"
Option "MapButton4" ""
Option "MapButton5" "button=1"
Option "MapButton6" "button=3"
Option "MapButton7" ""
Option "MapButton8" ""
Option "MapButton9" "disable-all"
Option "MapButton10" "key=122"
Option "MapButton11" "key=123"
Option "MapButton12" "key=232"
Option "MapButton13" "key=233"
Option "MapButton14" "key=22"
Option "MapButton15" "key=36"
Option "MapButton16" "key=9"
Option "MapButton17" ""
Option "MapButton18" ""
EndSection
 

Quattro74

Member
Newcomer
Joined
Dec 1, 2020
Messages
15
Trophies
0
Age
47
XP
52
Country
United States
Hello, I just tried to update from 3.02 to 3.20 L4T and after following the 4 step instructions, on the 1st post, launching Ubuntu kicks right back to Hekate. Happens pretty fast, right after showing the switchroot logo. I was able to reverse the procedure and get back to 3.02 just fine. Wondering what I did wrong? Thanks in advance.
 

Quattro74

Member
Newcomer
Joined
Dec 1, 2020
Messages
15
Trophies
0
Age
47
XP
52
Country
United States
I just needed to make one change in one config file, uenv.txt, and I was able to get to the desktop. I am using the premade multiboot image from psxtools.de
 

Quattro74

Member
Newcomer
Joined
Dec 1, 2020
Messages
15
Trophies
0
Age
47
XP
52
Country
United States
It seems the special order of the partitions on the psxtools.de image is breaking my reboot2payload out of Ubuntu. It wasn't working b4 the upgrade to 3.20 either, they ship the same boot.scr with their sd files for ubuntu as come with the update to 3.20. I just get to RCM mode when I reboot. Soo I should be looking at editing my boot.scr ?? Anyone have a newb guide for that? Thanks!
 

bakedbeans

Member
Newcomer
Joined
Jan 13, 2018
Messages
24
Trophies
0
Age
41
XP
128
Country
Algeria
How much of the switch special treatment has been submitted and hopefully merged in the upstream mainline kernel?
Various other console linux ports never made it there
 

evil_santa

Well-Known Member
Newcomer
Joined
Jan 15, 2020
Messages
87
Trophies
0
Age
36
XP
671
Country
Germany
It seems the special order of the partitions on the psxtools.de image is breaking my reboot2payload out of Ubuntu. It wasn't working b4 the upgrade to 3.20 either, they ship the same boot.scr with their sd files for ubuntu as come with the update to 3.20. I just get to RCM mode when I reboot. Soo I should be looking at editing my boot.scr ?? Anyone have a newb guide for that? Thanks!

I made the image files.
The psxtools image is made for ArgonNx.
I add another reboot to payload file inside Ubuntu.
Add the 3.2 updatec And change the uenv.txt
Change the rootdev to emmcblk0p8

Or pull the update file from ams plus and pick the Ubuntu folder from the zip and copy it to your SD card.

https://mega.nz/folder/7BQDxApC#a7G-vdiz9PV62VtuhV6_WQ
 
Last edited by evil_santa,
General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: Lol that sucks