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,

Bober791

Active Member
Newcomer
Joined
Aug 8, 2019
Messages
40
Trophies
0
Age
24
XP
78
Country
Poland
I waited 2-4(even up to 10) minutes and nothing.

I don't know what I'm doing wrong. BTW screen all of the time is on.
My sd card files:
boot - coreboot.rom; Image; intiramfs; tegra210...
bootloader - ini playloads sysl hekate_ipl.ini
boot.scr
BTW On the second card I have an android and everything works fine.
 
Last edited by Bober791,

MK73DS

Non-commutative algebra
Member
Joined
Feb 23, 2015
Messages
572
Trophies
0
Age
23
Location
France
Website
www.youtube.com
XP
1,357
Country
France
I waited 2-4(even up to 10) minutes and nothing.

I don't know what I'm doing wrong. BTW screen all of the time is on.
My sd card files:
boot - coreboot.rom; Image; intiramfs; tegra210...
bootloader - ini playloads sysl hekate_ipl.ini
boot.scr
BTW On the second card I have an android and everything works fine.

Same here
 

NoNAND

Give me back my legions!
Member
Joined
Aug 22, 2015
Messages
2,279
Trophies
1
Location
Somewhere
XP
4,887
Country
Albania
Could any mod sticky this?
It's sad to see it buried and lost among other threads

Is the sound still heard low?
I use this docked most of time and hadn't any breaking audio issues, not that I know of.
are you using the 1.3.1 update?
 
Last edited by NoNAND,

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
32
XP
561
Country
United States
I fixed the sound issue, replace the ucm stuff with the updated version on switchroot. The volumes maximums were set at a little less than half. I pushed those changes about the time android came out. ;) Just replace the HiFi file in /usr/share/alsa/ucm/tegra210ref-<iforget>/HiFi with the one on gitlab, then restart the console. Both headphone, and speaker audio will be much louder.

Sorry I forgot to mention this here, I have been on discord latly with the devs. In other news I have working reboot 2 payload for linux. ;) Will be pushing updates for that soon enough,.. for l4t-ubuntu, but there is still some work being done there, and the reboot stub needs to be taken out of ATF, and included in coreboot. But as it sits, it will reboot to hekate, or really whatever firmware you include in the kernel. lol.
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
32
XP
561
Country
United States
Sorry to get every one so excited for reboot2payload. Current implementation works, but we need to move the rebootstub out of Arm-trusted-firmware, and into coreboot, so it can be loaded by ATF, instead of built in. It makes updates easier, if it changes on atmospheres end. Also, fo some weird reason it is trying to autoboot the first entry on reboot, which I found ends at a black screen. I think I might still push an update today, as I have a version that takes the payload out of the kernel, which was the big issue, as it is dirty to include stuff in the kernel, if it isnt absolutly needed there. ;) Also, it creates a legal problem to release it with the binary blob included, depending on the payload(Ctc made a point to bring that up, when I said I had put hekate, and also wanted to put sxos payload in the kernel, so people had options) New patches let you define custom payload via configfs, and default payload via dts. It all still needs some work, but I think I might have a version to release early, but it is now monday, and I have to work all day. I also might have a way to keep joycon pairing between android/linux/and hos. I am not sure I can implement it easily though, as I need to get the pairing keys from HOS, and cant access the nand in linux. I will see what I can do with that when I get a minute, and get reboot2payload out for linux.
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
32
XP
561
Country
United States
As promised..... I give you Reboot2Payload update for l4t-ubuntu. This update comes with a little more hassle than the previous updates, but it is worth it.

1. Download and extract this to boot(fat32) partition, should overwrite all ubuntu files there: https://www.dropbox.com/s/6mchw2491c1ek36/l4t-ubuntu-reboot2payload.zip?dl=0

2. boot console.
3. Do everything after this as root
3A. If you are overclocking on boot using /etc/rc.local:
change script to
Code:
#!/bin/bash
echo 1 > /sys/kernel/tegra_cpufreq/overclock
echo  2091000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
echo 1 > /sys/bus/platform/drivers/tegra-reboot2payload/r2p/default_payload
exit 0
3B. If not overclocking:
1. Create /etc/rc.local eg. touch /etc/rc.local
2. make rc.local executable eg. chmod +x /etc/rc.local
3. edit /etc/rc.local to add
Code:
#!/bin/bash
echo 1 > /sys/bus/platform/drivers/tegra-reboot2payload/r2p/default_payload
exit 0
4. copy payload of your choice to /lib/firmware and rename it to reboot_payload.fw

5. if doing this on l4t-ubuntu, run in your root terminal: echo 1 > /sys/bus/platform/drivers/tegra-reboot2payload/r2p/default_payload

6. Now reboot to your payload. There is a custom_payload option, that you can echo the name of another payload also in /lib/firmware into and it will reboot to that payload as well.

Credit goes to:
@Stary#0632 for porting reboot2payload from Atmosphere into Coreboot/ATF/U-boot/Kernel :)
@Gavin_Darkglider for testing, and building update for you guys, and writing this awesome guide.
@Switchroot for the awesome work they are doing in the scene, for both linux and android development

Should also thank the atmosphere developers for creating what was ported as well. ;)
 
Last edited by Gavin_Darkglider,

stick267

Well-Known Member
Member
Joined
Dec 17, 2018
Messages
598
Trophies
0
Age
30
XP
1,135
Country
United States
As promised..... I give you Reboot2Payload update for l4t-ubuntu. This update comes with a little more hassle than the previous updates, but it is worth it.

1. Download and extract this to boot(fat32) partition, should overwrite all ubuntu files there: https://www.dropbox.com/s/6mchw2491c1ek36/l4t-ubuntu-reboot2payload.zip?dl=0

2. boot console.
3. Do everything after this as root
3A. If you are overclocking on boot using /etc/rc.local:
change script to
Code:
#!/bin/bash
echo 1 > /sys/kernel/tegra_cpufreq/overclock
echo  2091000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
echo 1 > /sys/bus/platform/drivers/tegra-reboot2payload/r2p/default_payload
exit 0
3B. If not overclocking:
1. Create /etc/rc.local eg. touch /etc/rc.local
2. make rc.local executable eg. chmod +x /etc/rc.local
3. edit /etc/rc.local to add
Code:
#!/bin/bash
echo 1 > /sys/bus/platform/drivers/tegra-reboot2payload/r2p/default_payload
exit 0
4. copy payload of your choice to /lib/firmware and rename it to reboot_payload.fw

5. if doing this on l4t-ubuntu, run in your root terminal: echo 1 > /sys/bus/platform/drivers/tegra-reboot2payload/r2p/default_payload

6. Now reboot to your payload. There is a custom_payload option, that you can echo the name of another payload also in /lib/firmware into and it will reboot to that payload as well.

Credit goes to:
@Stary#0632 for porting reboot2payload from Atmosphere into Coreboot/ATF/U-boot/Kernel :)
@Gavin_Darkglider for testing, and building update for you guys, and writing this awesome guide.
@Switchroot for the awesome work they are doing in the scene, for both linux and android development
This is awesome. Thanks a ton.
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
32
XP
561
Country
United States
L4T-Ubuntu Update 1.5.0

This update includes Minerva, and Minerva Mini(Kernel side companion to retrain as needed). It also includes the touchscreen fixes from the android kernel.

Simple install on this one, just overwrite the files on the fat32 partition.

https://www.dropbox.com/s/54ibwj3id4vj2cc/l4t-ubuntu-1.5.0.zip?dl=0

Credit goes to:
CTCaer For Minerva and Minerva Mini
Gavin_Darkglider For Compiling and packaging this release.
Switchroot team for the awesome work they are doing in the scene.
 

SleepyDomino

Well-Known Member
Member
Joined
Sep 21, 2009
Messages
273
Trophies
0
Age
39
XP
1,611
Country
United States
Touchscreen fixes? Sweet, seems like it got much better then.

I wanted to know a couple of things regarding Firefox. First, is Flash supported? (There's a site I want to use.) Second, does Twitch run well on it?
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
32
XP
561
Country
United States
The touchscreen still isnt great, there are better fixes coming, but the devs are hard at work getting android pie built, and getting lp0 sleep support working properly. There are a few ideas on fixes floating around at the memont, so hopefully sooner rather than later. ;) As for flash, I use it in Kodi on gentoo, so see no reason it wouldnt work on ubuntu. as for twitch, I dont know.
 
  • Like
Reactions: SleepyDomino

Conan179

Well-Known Member
Member
Joined
Mar 21, 2015
Messages
140
Trophies
0
Age
33
XP
744
Country
Germany
L4T-Ubuntu Update 1.5.0

This update includes Minerva, and Minerva Mini(Kernel side companion to retrain as needed). It also includes the touchscreen fixes from the android kernel.

Simple install on this one, just overwrite the files on the fat32 partition.

https://www.dropbox.com/s/54ibwj3id4vj2cc/l4t-ubuntu-1.5.0.zip?dl=0

Credit goes to:
CTCaer For Minerva and Minerva Mini
Gavin_Darkglider For Compiling and packaging this release.
Switchroot team for the awesome work they are doing in the scene.
What i canche, when l4t not mmcblk0p2 on my disk? (mmcblk0p8 on my card)
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
32
XP
561
Country
United States
What i canche, when l4t not mmcblk0p2 on my disk? (mmcblk0p8 on my card)

Then you need to create a new boot.scr, or reboot2payload wont work, as the default payload, hekate id, and what to do on reboot are defined there, as the built into the dts options are for android. It is also hard to get this perfect for everyone, as I dont know what your partition layout is, we create a default template, if you deviate from that it is on you.
 
Last edited by Gavin_Darkglider,

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
32
XP
561
Country
United States
Just make sure to use the latest boot.scr, as it is needed for reboot2payload, or else it will try to autoboot android, which you wont have, and hekate doesnt support yet. I think the eta on that feature is tuesday, but dont quote me on that.
 
General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: I still sucked at it though since it's been a few years since I played it lol