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,

parkerlreed

Active Member
Newcomer
Joined
Sep 6, 2018
Messages
26
Trophies
0
Age
29
XP
90
Country
United States
What is the l4tbr0 for?

Code:
9: l4tbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether be:32:f0:a9:ec:19 brd ff:ff:ff:ff:ff:ff
    inet 192.168.55.1/24 brd 192.168.55.255 scope global l4tbr0
       valid_lft forever preferred_lft forever
    inet6 fe80::1/128 scope link
       valid_lft forever preferred_lft forever
    inet6 fe80::708f:ffff:fe4a:1bd2/64 scope link
       valid_lft forever preferred_lft forever
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
What is the l4tbr0 for?

Code:
9: l4tbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether be:32:f0:a9:ec:19 brd ff:ff:ff:ff:ff:ff
    inet 192.168.55.1/24 brd 192.168.55.255 scope global l4tbr0
       valid_lft forever preferred_lft forever
    inet6 fe80::1/128 scope link
       valid_lft forever preferred_lft forever
    inet6 fe80::708f:ffff:fe4a:1bd2/64 scope link
       valid_lft forever preferred_lft forever

There is an xbox emulator someone was testing and it wanted a bridge device to connect to, so the module was included in the kernel to bridge the emulator to the wifi. It was added as a request in this thread.
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
Has anybody figured out exFAT mounting yet?
exfat is handled in userspace using fuse driver. There is a kernel driver as well, but you will need to add that patch yourself, and then compile a kernel that includes the driver. If you do this, then you dont need the userspace fuse driver. either way it will work to mount the exfat partition.
 

BryBread

Member
Newcomer
Joined
Aug 15, 2014
Messages
9
Trophies
0
Age
27
XP
39
Country
United States
Dunno if anyone has mentioned this yet, but using ulatencyd seems to have improved responsiveness pretty dramatically on my install of L4T.

Ulatencyd is (somewhat recently) abandoned and it does throw a "system error has been detected" dialog box on startup, but it seems to work fine and doesn't need anything special to configure it.

With ulatencyd installed, I was able to build a large project with make -j4 in the background while continuing to use the browser in the foreground. The browser loaded stuff slower obviously, but it remained responsive to my input. Although, I did end up running out of memory and my chrome extensions crashed :D

Sorry that I don't have any firm numbers but I highly recommend you all give ulatencyd a try.
 
  • Like
Reactions: Liv2MsTrb8T

bitteorca

Member
Newcomer
Joined
Jul 12, 2018
Messages
21
Trophies
0
Age
27
XP
90
Country
United States
Can I resize the initial 500mb partition to something higher? It always makes the SD card unreadable to my Switch when I resize it.

I keep all my CFW files on the first partition so I need it to be at least 1.5gb. I try to take it away from the 2nd partition (the 8gb Linux partition) while adding the space back at the end of the SD card but it always says the the card is corrupt and must be formatted when I put it back in the switch. I need some assistance, is this possible? I want an SD card with enough space for retroarch games, maybe OpenMW or OpenRTC2, L4T Ubuntu, and a 29.1gb emunand. I should be good on all of this if I could just resize the first partition without it breaking.
 
Last edited by bitteorca,

Kirby567fan

Well-Known Member
Member
Joined
Jan 6, 2018
Messages
401
Trophies
0
Age
22
XP
2,398
Country
Morocco
In other news, got Citra building & running on L4T. Performance is predictably terrible but not as bad as I thought it would be; runs at about half speed (on the OoT intro anyway) using the performance profile (not 2ghz mode).

1lkLSAx.jpg
Nice. Can you try a 2D game please while also enabling 2ghz?
 

Mouser X

Well-Known Member
Member
Joined
Aug 26, 2009
Messages
101
Trophies
0
XP
546
Country
United States
Can I resize the initial 500mb partition to something higher? It always makes the SD card unreadable to my Switch when I resize it.

I keep all my CFW files on the first partition so I need it to be at least 1.5gb. I try to take it away from the 2nd partition (the 8gb Linux partition) while adding the space back at the end of the SD card but it always says the the card is corrupt and must be formatted when I put it back in the switch. I need some assistance, is this possible? I want an SD card with enough space for retroarch games, maybe OpenMW or OpenRTC2, L4T Ubuntu, and a 29.1gb emunand. I should be good on all of this if I could just resize the first partition without it breaking.
The Linux partition has to be resized by a partition manager that can understand Linux partitions. There is one for Windows (search this thread), but I used gparted in Linux to repartition my SD card. Or you can download a "gparted boot disk" to boot your PC into a Linux distro specifically made for repartitioning systems.

If you have 2 SD cards, you can do what I did. Install L4T to both SD cards. For the card you WANT L4T on, set it aside, and boot your Switch with the other L4T card. Install gparted, and insert your Switch into the Dock. Use a SD card reader attached to the dock to read/mount the card you set aside. Use gparted to resize the 2nd SD card (the one in the reader). It's worked great the 4 or so times I've done this.
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
Or the easier option would be to create the partitions yourself, and then extract partition2 img from the full img, so everything after 500mb or so. You can use fdisk on the image file, once it is extracted, and get the correct information, then write that partition image to the p2 partition. as for p1, that isnt needed, as everything you need is in the latest kernel update package.
 
  • Like
Reactions: globalc

MK73DS

Non-commutative algebra
Member
Joined
Feb 23, 2015
Messages
575
Trophies
0
Age
24
Location
France
Website
www.youtube.com
XP
1,516
Country
France
Hi all. I can't get L4T to boot, I don't know what I'm doing wrong, but when I select L4T on Hekate it freezes on a black screen (backlight is on).

Here is everything I did :
  • Download the img file from OP
  • Use dd to write it to my microSD
  • Copy hekate bootloader folder on the microSD (while keeping L4T.ini)
  • Safely remove my microSD
  • Launch Hekate
  • Select "more configs" and click on "L4T"
My microSD is a 16GB Sandisk Extreme Plus. I also tried with a 128GB Sandisk Ultra with no success. And I also tried to apply the updates (removing boot and boot.scr and copying the update files on the microSD).

Thank you for your help
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
Well, if the backlight is coming on, it is booting, but there might be an issue with the sd card reader driver and your sd card. It could also be an issue with memory training. I have had some success if I rebooted to horizon before booting into linux, but that was with an sd card I know works.
 

MK73DS

Non-commutative algebra
Member
Joined
Feb 23, 2015
Messages
575
Trophies
0
Age
24
Location
France
Website
www.youtube.com
XP
1,516
Country
France
Well, if the backlight is coming on, it is booting, but there might be an issue with the sd card reader driver and your sd card. It could also be an issue with memory training. I have had some success if I rebooted to horizon before booting into linux, but that was with an sd card I know works.

Thanks for your help.
I tried booting to Horizon and then boot into L4T but I'm still stuck on a black screen. The microSD card works fine with Horizon though, I was using it before changing to a 128GB one.
Do you know what microSD card is known to work with L4T ?
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
Thanks for your help.
I tried booting to Horizon and then boot into L4T but I'm still stuck on a black screen. The microSD card works fine with Horizon though, I was using it before changing to a 128GB one.
Do you know what microSD card is known to work with L4T ?

I have been using a 128gb samsung evo card, but a cheap 16gb sandisk card worked for me as well. I am not sure what the issue is here, as I dont have a way to debug it.
 

bitteorca

Member
Newcomer
Joined
Jul 12, 2018
Messages
21
Trophies
0
Age
27
XP
90
Country
United States
Another question. I'm trying to install i386 packages from apt-get update as I enabled 32bit architecture. none of it will download. I'm doing so because I'm going to use qemu x86 linux chroot with wine to launch x86 applications. the issue is that all the packages apt-get update tries to get spits back Ign: (which I assume stands for ignore) and a bunch of links to i386 packages from http://turul.canonical.com

I need them though for qemu-static-i386, what do?

my sources file in /etc/apt/sources.list.d/99-switchroot.list only lists
"deb http://repo.switchroot.org unstable/"
what do I have to add to get these i386 packages for QEMU+Wine?
 

zarkon

Member
Newcomer
Joined
Dec 16, 2018
Messages
14
Trophies
0
Age
37
XP
328
Country
Italy
Another question. I'm trying to install i386 packages from apt-get update as I enabled 32bit architecture. none of it will download. I'm doing so because I'm going to use qemu x86 linux chroot with wine to launch x86 applications. the issue is that all the packages apt-get update tries to get spits back Ign: (which I assume stands for ignore) and a bunch of links to i386 packages from http://turul.canonical.com

I need them though for qemu-static-i386, what do?

my sources file in /etc/apt/sources.list.d/99-switchroot.list only lists
"deb http://repo.switchroot.org unstable/"
what do I have to add to get these i386 packages for QEMU+Wine?
maybe it's incompatible because switch is a arm device?

Inviato dal mio SM-N9600 utilizzando Tapatalk
 

Liv2MsTrb8T

Well-Known Member
Newcomer
Joined
Aug 18, 2009
Messages
68
Trophies
0
Location
Columbus Ohio
Website
grevsev.artstation.com
XP
334
Country
United States
@bylaws. Sorry if these are useless now. I've made bandaid tier macros to deal with the annoyances and forgot to upload.

One bug I can't avoid is the sleepy gpu (I think) After a few hours uptime only the display will die.

Also thank you! I've learned a lot from this.
 

Attachments

  • Syslogs.zip
    4.5 MB · Views: 124
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*