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,

vojut

Member
Newcomer
Joined
Jun 5, 2021
Messages
9
Trophies
0
XP
40
Country
Poland
My friend ran into a problem with Ubuntu. After copying movies from external sd card reader through OTG cable to the desktop, something went wrong - files could not be played. After restart, boot screen started flashing in unusual way and did not get into desktop but started looping between dark and gray screen. This is Switch with multiboot, with Atmosphere, Ubuntu and Android 10/Q. Problem is only with Ubuntu. Do anyone of you encountered something like this? I don't have direct access to this Switch - is there any way to instruct my friend to enable some logging, fallback/safe mode, or maybe somehow "reset" it? He does not have access to computer, so this will need to be done on Switch itself.
 

LowScore

Active Member
Newcomer
Joined
Nov 4, 2018
Messages
31
Trophies
0
Age
40
XP
102
Country
Italy
I fiddled a bit with xev and jstest and created this config to fix it:

Code:
Section "InputClass"
    Identifier "joystick catchall"
    MatchIsJoystick "on"
    MatchDevicePath "/dev/input/event*"
    Driver "joystick"
    Option "MapButton5" "disable-all"
    Option "MapButton6"     "key=122"
    Option "MapButton7"     "key=123"
    Option "MapButton8"     "key=232"
    Option "MapButton9"     "key=233"
    Option "MapButton12"     "key=9"
    Option "MapButton11"     "key=36"
    Option "MapButton10"     "key=22"
EndSection

It's slightly different - B for left mouse button, A for middle button and X for right button.
What should I do? Copy your confi into the file? Or I have to search for live updates?
 

DocBo

Well-Known Member
Member
Joined
Apr 11, 2018
Messages
237
Trophies
0
XP
499
Country
Germany
Hi, when i use the Dock for my UHD Philips TV, the resolution is only 640x480 and cannot be changed.
Is there a fix?!
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
32
XP
560
Country
United States
Hi, when i use the Dock for my UHD Philips TV, the resolution is only 640x480 and cannot be changed.
Is there a fix?!
You can force a resolution for dock, by doing as root,
Code:
echo 1920x1080 > /etc/dock-hotplug.conf

obviously, 1920x1280 is 1080p, but you can put any resolution here.

That doesnt mean that every monitor will support any resolution you place in this file, but if this file exists, the dock handler will use the resolution you set in it, even if the monitor doesnt support it.
 
Last edited by Gavin_Darkglider,
  • Like
Reactions: DocBo

DocBo

Well-Known Member
Member
Joined
Apr 11, 2018
Messages
237
Trophies
0
XP
499
Country
Germany
You can force a resolution for dock, by doing as root,
Code:
echo 1920x1080 > /etc/dock-hotplug.conf

obviously, 1920x1280 is 1080p, but you can put any resolution here.

That doesnt mean that every monitor will support any resolution you place in this file, but if this file exists, the dock handler will use the resolution you set in it, even if the monitor doesnt support it.

I added the code in terminal but nothing happens, in setting are still 640x480 :/
 

pharredd22

Member
Newcomer
Joined
Jul 14, 2020
Messages
15
Trophies
0
Age
32
XP
44
Country
Canada
is there a way to downgrade from L4T Ubuntu 3.40 to 3.30 without having to start from scratch (ie partion the SD card through hekate)?
 

evil_santa

Well-Known Member
Newcomer
Joined
Jan 15, 2020
Messages
75
Trophies
0
Age
36
XP
578
Country
Germany
Yes you can do this.
Or you buy an bigger emmc and install all together to the emmc (Horizon, Ubuntu and Android)
You can also install Ubuntu to an external drive, USB key or SSD.
 
  • Like
Reactions: TR_mahmutpek

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
32
XP
560
Country
United States
How can I do that? Can you explain a bit?
Do what exactly? Use external usb, or install a larger emmc, they are 2 different things. One requires you dump your old emmc, then replace the removable chip on the motherboard with one that has a larger emmc chip soldered to it, then flash back your dump, and you will have the remainder of the size to create the needed partitions for ubuntu, and/or android. Then there is some checksum magic that needs to be done on the gpt, or else the console wont boot normally, and you will always need to boot with a payload. As for linux/android, it will still need an sdcard to boot coreboot from. You do gain some speed advantages if using emmc in linux/android. As for USB, all you need to do is edit the boot txt, and flash the l4t.img file to a partition on the external drive. This option has issues as well, considering you will always need to have the external drive attached, so it isnt great for portability.
 
  • Like
Reactions: TR_mahmutpek

TR_mahmutpek

medic
Member
Joined
Jul 28, 2015
Messages
1,419
Trophies
0
Age
22
XP
1,934
Country
Turkey
Do what exactly? Use external usb, or install a larger emmc, they are 2 different things. One requires you dump your old emmc, then replace the removable chip on the motherboard with one that has a larger emmc chip soldered to it, then flash back your dump, and you will have the remainder of the size to create the needed partitions for ubuntu, and/or android. Then there is some checksum magic that needs to be done on the gpt, or else the console wont boot normally, and you will always need to boot with a payload. As for linux/android, it will still need an sdcard to boot coreboot from. You do gain some speed advantages if using emmc in linux/android. As for USB, all you need to do is edit the boot txt, and flash the l4t.img file to a partition on the external drive. This option has issues as well, considering you will always need to have the external drive attached, so it isnt great for portability.
No, I was just talking about install linux to nand, not upgrading bigger nand nor installing to a sd card.
 

Thorhax

Well-Known Member
Member
Joined
Apr 15, 2020
Messages
139
Trophies
0
Age
40
XP
367
Country
Canada
Well I updated to 2.4.0 and gave dolphin another go. Still no improvements in that area. I guess the switch just isn't powerful enough.
MGS runs horribly, Wind Waker is almost playable but a lit of stutters here and there which are a pet peeve of mine.
 

Chrisssj2

Well-Known Member
Member
Joined
Feb 12, 2008
Messages
2,361
Trophies
0
XP
3,239
Country
Netherlands
Im in partition manager but idk what to do
How much space do I give linux EXT4?
And won't it fk up my existing emunand?(atmosphere emunand)
I got 1TB micro SD. Don't want to give unneccessary space to Ubuntu though.
 

Jeromy22

Active Member
Newcomer
Joined
Sep 15, 2021
Messages
34
Trophies
0
Age
24
XP
56
Country
Australia
Noticed recently that the sudo command to install openmw no longer works. I used the command & ppa from page 8 of the app tutorial page.
Returns something along the lines of
Failed dependancy libopenthreads21 cannot be installed? Any help would be amazing if someone has a solution.
 
Last edited by Jeromy22,

Jeromy22

Active Member
Newcomer
Joined
Sep 15, 2021
Messages
34
Trophies
0
Age
24
XP
56
Country
Australia
I managed to get the above working.
Is their some way of getting the switch Axis mapped as windows Key configurations. For example so that the left joystick can be mapped to the four arrow keys??
Ive got the xorg joycon file, just have no idea on mapping the axis.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
    kenenthk @ kenenthk: MacMiller was better