L4T Ubuntu - A fully featured linux on your switch

switchroot.png

L4T Ubuntu
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.

Join our discord: https://discord.gg/53mtKYt

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

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,

Mouser X

Well-Known Member
Member
Joined
Aug 26, 2009
Messages
101
Trophies
0
XP
546
Country
United States
Is there any way to dock a switch on the official dock without the official charger in linux?
Probably, but on HOS, it seems to be determined by how much power is supplied. In HOS, I tried to use the dock while plugged into a portable battery (I forgot my charger), but the Switch refused. That was when I realised my battery wasn't supplying the same output the Switch's wall adapter did (it's obvious to anyone who pays attention, or knows about batteries, but I never thought about it before). So if you can match, or possibly even exceed the power supplied by official wall adapter, it should work.

Now with Linux, I don't know what it's looking for, or how it determines if it's connected to the dock. It might be as simple as supplying power to the dock (even if it doesn't match the output of the official adapter). Considering that's how it appeaers to work in HOS, it wouldn't surprise me if it's something similar. Unfortunately, I obviously don't know. Sorry.
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
34
XP
581
Country
United States
Wait so is usb otg a thing now? Last time i tried hooking up an adapter in portable mode i had no luck. This is my main need can this be done now?
It is and it isnt. There is no support for power out from the switch, and the switch to host mode is done by the dock negotiations. When it is unplugged, it is supposed to switch back to device mode, but for some reason that doesnt work properly. I managed to get around that a bit by reloading the modules. I plan on testing this further, once I get my new build finished.

YOU are THE MVP, i usually dont have the patience to explain to people why having linux on switch is like the apex of "console freedom". Its different than PS4's linux distros, although it is very cool either.

Im stalking this thread for some time now and you seem to like helping a lot, thats great :D.

Mainly, because I am sitting here building Gentoo for the switch, which is more work than I would like to admit, considering I came across some new info, that suggest using a different gcc version if you want the libraries with the video card to work with your apps, so I have had to rebuild the whole thing, but that isnt a big deal, as the configs are already setup, for the most part. Then I just have to figure out X, as you need a specific version, and it was removed from the gentoo repos. I think I found a copy, so not a big deal. Then there is patching in the drivers, and enabling them.

Is there any way to dock a switch on the official dock without the official charger in linux?

Probably, but on HOS, it seems to be determined by how much power is supplied. In HOS, I tried to use the dock while plugged into a portable battery (I forgot my charger), but the Switch refused. That was when I realised my battery wasn't supplying the same output the Switch's wall adapter did (it's obvious to anyone who pays attention, or knows about batteries, but I never thought about it before). So if you can match, or possibly even exceed the power supplied by official wall adapter, it should work.

Now with Linux, I don't know what it's looking for, or how it determines if it's connected to the dock. It might be as simple as supplying power to the dock (even if it doesn't match the output of the official adapter). Considering that's how it appeaers to work in HOS, it wouldn't surprise me if it's something similar. Unfortunately, I obviously don't know. Sorry.
The dock status is negotiated by the power delivery chip. So, if the chip has enough power to communicate with the switch, then it will. Basically, you need a charger that supports usb-pd standard, and matches or betters the switch charger. Then it should work, but there have been reports about the switch power delivery being off standard, so I dont know.
 

bylaws

Well-Known Member
OP
Member
Joined
Dec 11, 2018
Messages
129
Trophies
0
XP
1,655
Country
United Kingdom
The only copy of l4t 32.1 was for tegra tx2, and when I tried to install it, it was missing libglx.so If you have a link to the bsp for that, I would appreciate it.
Its the nano one you want.
Try using the kernel from Lakka, they applied the patch that slows down the SDcard reader, that fixed the issue with SD cards on linux mainline. When I release my build, which I realized I screwed up on when I found this: https://github.com/madisongh/meta-tegra because in order to use all of the drivers, the system needs to be linked against gcc 7.x, and I was using default gentoo compiler 9.x. :( It is cool, I have the system rebuilding now, to fix this issue, but it is going to push back what I have been working on for a bit. I plan on releasing mine with a couple of different kernel builds, one of which will be patched for this, with argon-nx for choosing the kernel build you need.
This won't work, booting issue is different with l4t, I think its probably caused by memory training that should be fixed soon.
It is and it isnt. There is no support for power out from the switch, and the switch to host mode is done by the dock negotiations. When it is unplugged, it is supposed to switch back to device mode, but for some reason that doesnt work properly. I managed to get around that a bit by reloading the modules. I plan on testing this further, once I get my new build finished.



Mainly, because I am sitting here building Gentoo for the switch, which is more work than I would like to admit, considering I came across some new info, that suggest using a different gcc version if you want the libraries with the video card to work with your apps, so I have had to rebuild the whole thing, but that isnt a big deal, as the configs are already setup, for the most part. Then I just have to figure out X, as you need a specific version, and it was removed from the gentoo repos. I think I found a copy, so not a big deal. Then there is patching in the drivers, and enabling them.




The dock status is negotiated by the power delivery chip. So, if the chip has enough power to communicate with the switch, then it will. Basically, you need a charger that supports usb-pd standard, and matches or betters the switch charger. Then it should work, but there have been reports about the switch power delivery being off standard, so I dont know.
This should be the case but I doubt it, the driver in l4t will only work with the official charger/dock because all init is hard coded
 
  • Like
Reactions: Watermelonz

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
34
XP
581
Country
United States
Its the nano one you want.

This won't work, booting issue is different with l4t, I think its probably caused by memory training that should be fixed soon.

This should be the case but I doubt it, the driver in l4t will only work with the official charger/dock because all init is hard coded

I came across that link for building, when looking for the bsp. lol. The information about the compiler was good to know, but it downloads everything from behind the nvidia dev wall, but I dont have a dev account. lol. Good to know about the nano bsp. as for the power delivery chip, that sucks, but I guess that is nintendo. lol.
 

spotanjo3

Well-Known Member
Member
Joined
Nov 6, 2002
Messages
11,145
Trophies
3
XP
6,206
Country
United States
Mainly, because I am sitting here building Gentoo for the switch, which is more work than I would like to admit, considering I came across some new info, that suggest using a different gcc version if you want the libraries with the video card to work with your apps, so I have had to rebuild the whole thing, but that isnt a big deal, as the configs are already setup, for the most part. Then I just have to figure out X, as you need a specific version, and it was removed from the gentoo repos. I think I found a copy, so not a big deal. Then there is patching in the drivers, and enabling them.

I am very curious about Gentoo for the Switch. I will wait for your linux instead because I am going to use Gentoo soon for PS4 because of positive about it and was told that it is an amazing and powerful tool and a way better than Psxitarch version 2.0.
 
Last edited by spotanjo3,

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
34
XP
581
Country
United States
I am very curious about Gentoo for the Switch. I will wait for your linux instead because I am going to use Gentoo soon for PS4 because of positive about it and was told that it is an amazing and powerful tool and a way better than Psxitarch version 2.0.

I dont know if any one version of linux is better than another. Gentoo is super configurable, and is easy to patch, and portage(Package manager) which I like. Because of those 3 reasons, it makes a good base for a project like the OG Xbox, or Nintendo Switch, and PS4. That being said, if you are new to linux, you are better off with ubuntu, or downloading the version I release after I build, configure, and test everything. As it sits, half of the support for hardware wont be in my build, just opengl, gles, and cuda. I will get the rest in there, but the ebuild I modified for the TX1 didnt include these sections of the bsp, so I am going to have to write them in, eventually. Right now I am trying to get a base build going, that boots to a desktop using nvidia's drivers. Once that is done, I will configure alsa, and udev for the dock, and usb switching. I plan on writing an eselect module for the dock, so you can easily change what the default behavior for the dock is, etc. There is a lot to come with this build, and the final version might be a ways out. On top of that, while I will set up an ebuild repository for all of this eventually, updates are going to be difficult for the average user, as any rolling distro with a package manager that compiles everything can be time consuming, and confusing if you dont know why the compiler crashed. lol.
 

spotanjo3

Well-Known Member
Member
Joined
Nov 6, 2002
Messages
11,145
Trophies
3
XP
6,206
Country
United States
I dont know if any one version of linux is better than another. Gentoo is super configurable, and is easy to patch, and portage(Package manager) which I like. Because of those 3 reasons, it makes a good base for a project like the OG Xbox, or Nintendo Switch, and PS4. That being said, if you are new to linux, you are better off with ubuntu, or downloading the version I release after I build, configure, and test everything. As it sits, half of the support for hardware wont be in my build, just opengl, gles, and cuda. I will get the rest in there, but the ebuild I modified for the TX1 didnt include these sections of the bsp, so I am going to have to write them in, eventually. Right now I am trying to get a base build going, that boots to a desktop using nvidia's drivers. Once that is done, I will configure alsa, and udev for the dock, and usb switching. I plan on writing an eselect module for the dock, so you can easily change what the default behavior for the dock is, etc. There is a lot to come with this build, and the final version might be a ways out. On top of that, while I will set up an ebuild repository for all of this eventually, updates are going to be difficult for the average user, as any rolling distro with a package manager that compiles everything can be time consuming, and confusing if you dont know why the compiler crashed. lol.

No, I am not new to Linux. Been used it before on my PC a long time ago. It was and is better than Windows, lol! And for updates, I know what you mean. And you have to type sudo and etc. It might be a difficult but be thankful that there are many tutorial out there on google if that what you re looking for. :D

Yes, there are an experts out there that said Gentoo is better than Psxitarch Linux version 2 to run on PS4. I m hoping the same for Switch. I am watching you. Keep up! ^_^:bow:
 
Last edited by spotanjo3,

Worldblender

Well-Known Member
Member
Joined
May 27, 2019
Messages
326
Trophies
0
Age
27
XP
2,236
Country
United States
Has someone tried to use this with kde or xfce or something else yet?
Only XFCE4 I tried, but not yet KDE. GTK2 programs don't seem to work well with the touchscreen, so the former was nearly unusable without on on-screen keyboard. I need to allocate more time for installation of larger desktop environments, and I may come back here when I have installed GNOME3 and KDE5.
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
34
XP
581
Country
United States
Only XFCE4 I tried, but not yet KDE. GTK2 programs don't seem to work well with the touchscreen, so the former was nearly unusable without on on-screen keyboard. I need to allocate more time for installation of larger desktop environments, and I may come back here when I have installed GNOME3 and KDE5.

I havnt, but I am fairly certain the original failOverfl0w arch build was running gnome3.
This is great! Is there any way to run Android apps on this? (just asking I literally have no idea)

possibly in an android emulator. It might actually work really well, if the emulator can interface with the arm hardware directly, instead of emulating it.
 

BlastedGuy9905

where's the updated autopsy report
Member
Joined
Apr 13, 2017
Messages
2,334
Trophies
1
Age
33
Location
under your desk
XP
4,043
Country
United States
possibly in an android emulator. It might actually work really well, if the emulator can interface with the arm hardware directly, instead of emulating it.
Yeah, but that wouldn't count as an emulator, would it. That would just be an interpreter afaik

--------------------- MERGED ---------------------------

And I've been looking for one, without luck.
 

Kirby567fan

Well-Known Member
Member
Joined
Jan 6, 2018
Messages
402
Trophies
0
Age
23
XP
2,642
Country
Morocco
Yeah, but that wouldn't count as an emulator, would it. That would just be an interpreter afaik

--------------------- MERGED ---------------------------

And I've been looking for one, without luck.
There is an android emulator called anbox. It actually has a fork for arm64 but it doesnt work on the switch for some reason.

--------------------- MERGED ---------------------------
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
34
XP
581
Country
United States
Yeah, but that wouldn't count as an emulator, would it. That would just be an interpreter afaik

--------------------- MERGED ---------------------------

And I've been looking for one, without luck.

Just after some quick googling, I would try Shashlik. It uses qemu to emulate the hardware, and qemu uses binfmt_misc, which is built in to the kernel for enterpreting code from other archectectures. In this case, it would be "emulating" arm64/arm on an arm64 processor. It is worth a try. lol.
 

BlastedGuy9905

where's the updated autopsy report
Member
Joined
Apr 13, 2017
Messages
2,334
Trophies
1
Age
33
Location
under your desk
XP
4,043
Country
United States
Just after some quick googling, I would try Shashlik. It uses qemu to emulate the hardware, and qemu uses binfmt_misc, which is built in to the kernel for enterpreting code from other archectectures. In this case, it would be "emulating" arm64/arm on an arm64 processor. It is worth a try. lol.
I don't even have a spare SD for L4T. I was just theorizing and hoping someone had tried my idea.
 

GibboHull

Active Member
Newcomer
Joined
Apr 4, 2019
Messages
25
Trophies
0
Age
31
XP
176
Country
United Kingdom
Yeah I'm very much waiting for Android! L4T and Lakka are both really cool but from a purely selfish point of view android would be ideal.

My Nvidia shield tablet died a couple of months ago and I really miss a lot of its features, using my switch as one as well as well, a switch, would be the best of both worlds for me.
 
  • Like
Reactions: BlastedGuy9905

nicoboss

Well-Known Member
Member
Joined
Feb 1, 2019
Messages
132
Trophies
0
Age
26
XP
1,196
Country
Switzerland
How do you install software? are there repos, or do you have to compile from source?
L4T contains all standard Ubuntu 18.04 repos and allows you to add as many you like. However not every software can be obtained from a repo or comes with a precompiled arm64 version which you then have to compile by your own. Sometimes software in the default repos is outdated so if you need the latest futures and there isn’t and development repo to add you have to build it from source too. Honestly building from source is often quite easy. Just follow the compiling guide of the software you want to compile which often is Install dependancies, cmake . && make && sudo make install.
 
Last edited by nicoboss,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: https://gbatemp.net/profile-posts/163064/