yashsingh1/xdaforums huggingface dataset:
[Shield Android TV General] urisma:
One small correction: You should really only do 'make -j<N>' where N is the amount of threads your computer has +1, so If I have a 4 core computer without hyperthreading then 'make -j5' is best. Running without a parameter given to '-j' is probably a bad idea, as this lets make spawn as many jobs as it wants, which is silly, since much more than the number of hardware threads you have will only increase memory usage but not increase compilation speed.
[Shield Android TV General] yahoo2016:
You are correct, when I tried "-j901", memory usage quickly approaches 16 GB before I killed it.
[Shield Android TV General] yahoo2016:
I received my replacement Shield TV today, just like the other owner posted:

https://forums.geforce.com/default/topic/893616/bootloader-issues/?offset=5

recovery mode does not work anymore after forced update to 2.1.

Update:

After many more tries today including fast tapping power button after power up, I was able to get to recovery mode. I flashed my SATV (Shield Android TV) with Nvidia ROM 1.3 using "fastboot". Now recovery mode is working again reliably every time. Now I have a fully working SATV for development with ROM 1.3.
[Shield Android TV General] yahoo2016:
Has anyone tried Bluetooth with any combination of kernel and Linux rootfs? I can see bluetooth device using "rfkill list" and unblock it using "rfkill unblock 0", but bluetooth still shows as "disabled" in "system settings".
[Shield Android TV General] CableBurner:
Hi,

on my system i am not able to start the xserver with HDMI plugged in at boot.

startx hangs on 'Loading extension GLX'

cat /var/log/Xorg.0.log hangs at:

[ 415.077] (II) NVIDIA(0): Setting mode "DFP-0:nvidia-auto-select"

If i boot and then plug in HDMI later, it works:

Loading extension GLX

Loading extension NV-GLX

Loading extension NV-CONTROL

Loading extension XINERAMA

...

cat /var/log/Xorg.0.log:

[ 67.382] (II) NVIDIA(0): Setting mode "DFP-0:nvidia-auto-select"

[ 67.751] Loading extension NV-GLX

[ 67.765] (==) NVIDIA(0): Disabling shared memory pixmaps

[ 67.766] (==) NVIDIA(0): Backing store enabled

[ 67.766] (==) NVIDIA(0): Silken mouse enabled

[ 67.771] (==) NVIDIA(0): DPMS enabled

Nothing special from dmesg.

Is there any possibility to reset the whole HDMI controller somewhere in sysfs? This could be packed into a startup script and then launch X/lightdm...

Best Regards,

Udo
[Shield Android TV General] yahoo2016:
Which kernel/rootfs were you using? Have you tried different HDMI TV/monitors?

Update:

I was able to duplicate your case for one of Dell monitors (DELL 2408WFP) using L4T rootfs.
[Shield Android TV General] CableBurner:
Hi, i followed this one, which should be based on yours: http://www.tatsch.it/linux-4-tegra-with-cuda-on-nvidia-shield-tv/

I tried different devices: Dell U2412M, Samsung LE23C450, and this Touch Panel.

I think it has to do with the hot plug detect. I cut the hot plug signal on my hdmi cable and booted with HDMI plugged in. Than i connect the hp signal with a switch and can start X/lightdm. But this is quite messy ;)

Best Regards,

Udo
[Shield Android TV General] demotomohiro:
Thank you very much for sharing how to install L4T on Shield TV!

I found this post and I'm using this boot.img, because I am lazy.

http://xdaforums.com/showpost.php?p=64589752&postcount=53

It worked very well and I can run CUDA samples and develop my CUDA program on it.

I'm using my Shield TVwith lastest update 2.1.

I flashed linux boot.img to boot partition and boot.img in NVIDIA SHIELD ANDROID TV Recovery OS Image 2.1.0 to recovery partition.

So I can boot both Ubuntu and Android.

When I use ubuntu, just turn on Shield TV or reboot.

When I use android, I boot fastboot and select "boot recovery kernel".

This is how to get fastboot menu with update 2.1.

1. Turn off shield

Touch and hold about 10s in android or "sudo shutdown -h now" in ubuntu.

2. Tap power button once to turn on. Don't keep touching.

3. Wait for about 1 second.

4. Touch and hold power button until you see fastboot menu.

Shield TV need to be connect to PC with use-otg cable.

I can get fastboot menu without unpluging power supply.

It works in 1 or 2 tries.
[Shield Android TV General] yahoo2016:
Thanks for the feedback and trick to boot to recovery mode with update 2.1.
[Shield Android TV General] rxg846zebra:
Thank you very much for posting this guide.

I was able to follow along and boot ubuntu on my Shield TV. But I do have a few questions in mind:

1) I have experienced lags as I was navigating around, is that an side effect of booting the OS off the SD card, using a modified Android kernel, or booting from recovery mode (my boot.img is flashed to recovery).

2) Guess this is related to the first question, but I saw some comments about booting off an USB, has anyone tried that yet? If so, is that faster?

3) What advantage does booting the L4T kernel have over the CM one?

Thanks In advance!
[Shield Android TV General] yahoo2016:
(1). It should not be related to Android kernel or which partition of internal emmc to boot. What is speed of your SD card?

(2). USB3 HD should be much faster than most SD cards, but if you use class 10 or U1 SD, you may not notice much difference when navigating around.

(3). As posted on the other thread, L4T kernel is less stable than older CM kernel. dtb partition needs to be replaced to use L4T kernel, which may brick shield with wrong dtb and later ROM versions. When dtb is replaced, Android will not run. I'd only use L4T kernel when dual boot (multirom or u-boot) is working.
[Shield Android TV General] rxg846zebra:
Thank you for the quick reply! The READ speed of my SD card says UP to 45 MB/s, so yea, I guess I would have to go with USB3 if I really want some speed up.

I was curious about booting the L4T kernel because it seems like a number of you are trying to get that to boot despite the fact that the old CM kernel is working.

Anyhow, thank you for clearing my doubts!
[Shield Android TV General] demotomohiro:
I read first post in this thread, built my boot.img and flashed it to my shield TV.

I could connect to my shield using ssh, but it couldn’t display a desktop.

And “sudo shutdown -h now” didn’t work.

The boot.img built by yahoo2016 can display desktop and shutdown/reboot worked fine.

My display is “SEIKI SE39UY04” and it supports 3840x2160@30Hz mode.

I compared shieldTv_defconfig and cyanogenmod_foster_defconfig, and I found that some framebuffer options are set in shieldTv_defconfig.

CONFIG_FB_NVIDIA=y

CONFIG_FB_NVIDIA_BACKLIGHT=y

CONFIG_FB_SIMPLE=y

They are set yes in shieldTV_defconfig, but they are not set in cyanogenmod_foster_defconfig.

They are also not set in Jetson TK1, but it displays console message to my display before desktop screen comes.

I remember that Gentoo wiki for x86/64 says in-kernel nvidia framebuffer driver conflicts with the nvidia binary driver.

I don’t know wether it also true or not in arm64 CPU or Shield TV, I removed these options and rebuilt the kernel.

But I still didn’t see desktop and shutdown deosn’t work.

Then, I removed “CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y”, but no change.

Then, I removed following options:

CONFIG_DUMMY_CONSOLE=y

CONFIG_FRAMEBUFFER_CONSOLE=y

CONFIG_FONT_8x8=y

CONFIG_FONT_8x16=y

They are enabled in Jetson TK1 but I disabled them.

It worked! I got desktop and shutdown/reboot worked from a ssh client.

But I found a problem. When I connect display to my shield TV but don’t connect mouse and keyboard, my shield TV displays NVIDIA logo forever and I cannot connect to my shield TV from a ssh client.

When I connect display, mouse and keyboard, I can get the desktop.

When I disconnect both display, mouse and keyboard, I can use shield from ssh client and my console CUDA program works.

No matter if framebuffer related options are set yes or not, I don’t see console message from my display.

I should try more combinations of kernel options to find out which options do wrong.

But I will do it later.

I'm going to talk about L4T on Shield TV on Jetson meet up event in Japan next week.

I have to make the slide which compare shield TV and jetson TX1, explains why installing linux on shield tv, and how to do it in Japanese.

I will put link to this topic on my slide.

I think there are many people who are interested in shield TV as linux machine in my country.
[Shield Android TV General] yahoo2016:
Thanks for the feedbacks. Those feedbacks make Linux for SATV works better. I had to try many combinations of kernel configuration to have it work for my HDMI monitor, I believe the latest "sieldTV_defconfig" includes changes to make boot to console working, but those changes seem caused issues for some monitors (e.g. 4K monitors), (e.g., requiring disconnect some HDMI monitor to boot to desktop). I'll try disconnect mouse/keyboard on my SATV.

I have noticed issue of no console message on HDMI since day one I had my SATV and posted in the other thread multiple times and got some suggestions to try, but have not been able to figure out how to get console message.

SATV is low cost alternative for Jetson TX1, when more users get involved, Linux on SATV will work better. Some of the top issues are:

(1). No dual boot, DTB in DTB partition is used for both Anroid and Linux kernel. Replacing DTB disables Android and may brick SATV.

(2). No serial console for u-boot and debug.

(3). No console massage.

(4). Bugs in bootloaders later than ROM version 1.3 cause recovery mode unreliable (there are some suggestions to work around the bugs may work) and cause SATV to brick.

Update:

I removed

CONFIG_DUMMY_CONSOLE=y

CONFIG_FRAMEBUFFER_CONSOLE=y

CONFIG_FONT_8x8=y

CONFIG_FONT_8x16=y

and noticed NVIDIA log stayed on screen longer than before, but was able to boot to Ubuntu desktop without KB/mouse connected.

Have you done "sudo apt-mark hold xserver-xorg-core"? it was mentioned in several forums to avoid NVIDIA driver issues.
[Shield Android TV General] demotomohiro:
(2), (3) are serious problem when it failed to boot.

I did "sudo apt-mark hold xserver-xorg-core" after installing L4T.

"sha1sum -c /etc/nv_tegra_release" is all OK now.

How about to add about that command and "sha1sum -c /etc/nv_tegra_release" in the first post?

I think it is needed in all Linux for Tegra to prevent "apt-get upgrade" overwriting nvidia drivers.
[Shield Android TV General] yahoo2016:
Thanks. I updated the 1st post.
[Shield Android TV General] CableBurner:
Hi Yahoo,

with these config changes, can you reproduce the hdmi-connected-on-boot bug with your dell monitor?

Thanks in advance!

Btw, i will try to get the rootfs installed on eMMC these days and compare performance :)

Best Regards,

Udo
[Shield Android TV General] yahoo2016:
Hi CableBurner,

Unfortunately that Dell monitor is at work. A different Dell HDMI monitor and other HDMI TVs at my home do not have the same issue.

I'm not sure I can go to work Monday due to heavy snow over the weekends.

Will you be able to build kernel using the updated "shieldTV_defconfig" I added to the 1st post? I believe it should solve the HDMI issue. I have added link to "boot.img" using the latest "shieldTV_defconfig" to the 1st post.

Do you mean you want to try flashing rootfs to internal emmc? I tried to flash Ubuntu rootfs to partition 19 of internal emmc, it worked and seemed booting faster, but Android failed to work after that.
[Shield Android TV General] CableBurner:
Hi Yahoo,

i will build the Kernel with your defconfig after return from work :)

Btw, do you change the Kernel config manually or with make xconfig? This doesn't work well for me because xconfig tries to mix in stuff from my host systems's config located at /boot. Maybe i have to change some environment variables...

Yes i want to install it on partition 19 or 29 (i think 29 was the 12GB one) . I thinks its enough coping all files and change the inird to the correct partition/device?

I don't need android and bought the shield specific for CUDA development ob my robots :)
[Shield Android TV General] yahoo2016:
Hi CableBurner,

I change the Kernel config manually. I did use the last partition, i.e., the 12 GB partition 29 for user data.

Example "init.c" is shown below for mounting rootfs on user data or external USB:

#include <sys/mount.h>
#include <unistd.h>
#include <linux/reboot.h>
#include <fcntl.h>

extern char **environ;

int main(int argc, char **unused) {
mount("/dev", "/dev", "devtmpfs", 0, NULL);
// mount rootfs to first partition of external sd card
//	mount("/dev/mmcblk1p1", "/dest", "ext4", 0, NULL);
// mount rootfs to user data partition of internel emmc
mount("/dev/mmcblk0p29", "/dest", "ext4", 0, NULL);
// mount rootfs to first partition of USB
//	mount("/dev/sda1", "/dest", "ext4", 0, NULL);
mount("/dev", "/dest/dev", NULL, MS_BIND, NULL);
chroot("/dest"); // make /dest the new root
chdir("/"); // change to new root

char * const argv[] = { "/sbin/init", NULL }; // make command for execve

execve(argv[0], argv, environ); // excute "/sbin/init"
}

or mount to USB by commenting and uncommenting lines in "init.c" .
[Shield Android TV General] chago123:
Hello everyone, first of all, I want to congratulate everyone on the amazing work. I have been reading throughout the Nvidia devtalk forum and xda but still seem to be confused because I have not been active on the android nor Linux world. I don't mean to disrupt the development but I wanted to ask if someone can please make a short video tutorial on how to get ubuntu running. I'm willing to contribute back once I'm up and running. My biggest fear is bricking the device since it has happened to me before (on other devices of course). Thank you and keep up the great work!
[Shield Android TV General] CableBurner:
Hi Yahoo,

I can confirm that HDMI works now plugged in at boot time with the prebuilt boot.img and a self compiled one with the updated shieldTV_defconfig! Nice!

Something else i wanted to mention: you should no edit the defconfig by hand because you can break dependencies! After setting environment from your first.sh scipt, you should run in the kernelsource root folder:

Now click file -> load and select shieldTv_defconfig in arch/arm64/configs. The console output will now show something like invalid/unknown data format, which shows that manually editing data is bad :) Also the xconfig gui is very comfortable to tweak the kernel!

After you are done, click safe and exit. xconfig saves the new config as .confing, so:

and build :)

The new shieldTv_deconfig is now also at a conform format, so when loading a second time by xconfig, it doesn't complain anymore :)

Best regards,

Udo
[Shield Android TV General] Thanks_Meter:
I wonder if anyone was able to get the L4T kernel running (instead of cm kernel). I tried it with different rootfs but Linux always crashes after some seconds.
[Shield Android TV General] yahoo2016:
Hi Udo,

That's very helpful hint. I loaded "shieldTv_deconfig" in "xconfig", got a warning:

/home/ubuntu/Downloads/shieldTv_defconfig:2607:warning: unexpected data

and found an unintended leading space.
[Shield Android TV General] yahoo2016:
DTB for Jetson TX1 may not match hardware of SATV. E.g., TX1 has 4GB SDRAM while SATV has only 3GB.

L4T kernel has better chance for the next SATV ROM update with newer Android kernel and newer DTB which may be shared by Android and L4T
[Shield Android TV General] CableBurner:
Hi Yahoo,

do you have already any clue? If not, i will look into this during weekend.

Udo
[Shield Android TV General] yahoo2016:
Hi Udo,

I have not had chance to investigate the issue. BT is enabled in kernel config, may be some drivers need to be installed. I thought the same BCM chip was used for both WiFi and BT, I'm not sure why Wifi is working but BT is not.
[Shield Android TV General] CableBurner:
I think that the BCM4354 just supports BT 4.0/BTLE. This requires the new Bluez 5 stack which is not included in Ubuntu Trusty. Maybe this PPA works:

https://launchpad.net/~vidplace7/+archive/ubuntu/bluez5

I also use this on my notebook, to use my Logitech MX Master via Bluetooth.

I will try it on the Shield after returning from work.

Regards,

Udo

Edit: this is not enough, more has to be done:

I assume the bcm4354 uses a uart interface for bluetooth wich is independent from the wifi stuff which works over SDIO 3.0. I think when using android the bluetooth module is directly accessed from userspace. For Ubuntu we need platform driver, that communicates to the bluetooth module. Maybe i found something. I will try to integrate it into the kernel.

Udo
[Shield Android TV General] yahoo2016:
"rfkill list" showed "bluedroid bluetooth".

"rfkill unblock bluetooth" works, but bluetooth still shows as disabled in "settings".

I'm not sure if the following link helps:

https://github.com/CyanogenMod/android_external_bluetooth_bluedroid
[Shield Android TV General] CableBurner:
Please correct me if i am wrong, but AFAIK:

Bluedroid is the bluetooth stuff from Android. We ned bluez 5 for Ubuntu :)

I assume that rfkill (which is just for enabling the module) just sees the bluedroid stack enabled in the kernel, but not the underlying drivers hardware. I also assume, that in android there is no kernel driver for these BT modules. Android just uses the rfkill kernel interface to enable. But the communications is done by the Android Hardware Abstraction Layer which communicates directly to the serial uart interface of the module. What we need is a kernel driver, that is inbetween bluez and the uart interface of the Tegra. So that the Ubuntu systems "sees" a bluetooth device provided by this driver.

I have some ideas, but i think i cant afford enough time during the next few days and weeks. But i think this task is not impossible :)

Udo
[Shield Android TV General] yahoo2016:
That makes sense. TX1 L4T kernel source may have BT driver. Do you have idea if u-boot can to ported to SATV? With u-boot, we can use L4T kernel/DTB and rootfs.
[Shield Android TV General] CableBurner:
Hi,

i think porting u-boot is hard as we dont have any JTAG or UART acess to debug.

So due to the dtb stuff. We can't use the dtb from the Jeton, as all the pin muxing and platform drivers are defined here. From 3.10 on the kernel is the same for different devices, and the dtb is platform specific.

We must boot the L4T Kernel with the Android dtb (as the dtb belongs to the Shield). You said, that this does not work. I wonder why :) The bootloader loads the dtb from the correct partition into RAM and passes this offset to the kernel, so IMHO it should work?
[Shield Android TV General] yahoo2016:
There is a dtb for SATV (foster) under L4T r23.1, several SATV owners had used it and L4T 23.1 kernel.

http://xdaforums.com/showpost.php?p=64722818&postcount=84
[Shield Android TV General] CableBurner:
Hi,

i looked into L4T Kernelsource, but there is also no bluez driver for BCM4354. But i think it was integrated with Kernel 4.x. Maybe i can backport it :)

Together with this i want to get rid of the cm-kernel, that we have a good base to start development. I think the original L4T and Shield Android kernel are identical from source, just dtb and configs are different. I will investigate this to be sure.

My plan is follows:

1. Diff L4T and Shield kernel

2. Build both from the original nvidia gits and test them with the dtb which is already flashed on the shield.

3. If this doesn't work, build the dtb from source and integrate it into the built zImage. zImage is a normal Image, but compressed. It should be built along with the normal image. Here you could support me: please create a boot.img which contains a zImage und check if the shield can boot it. Maybe the initrd builder has to be tweaked for that purpose :)

If we habe dtb integrated into the boot.img we cant safely play ;)

4. backport the bluetooth driver to 3.10

Best Regards,

Udo

Edit: I think we can skip testing the original flashed dtb (maybe just for interest) because we need to create our own dtb which calls the bluetooth platform driver and assigns the correct uarts.
[Shield Android TV General] yahoo2016:
Hi Udo,

I believe the major issue is not Linux or Anroid kernel source, but the version of kernel. L4T versions of earlier than 23.1 do not have Tegra X1 support.

The SATV stock dtb only support earlier versions of kernel, several SATV users and I tried L4T kernel R23.1 with stock dtb, but it did not work.

(unmodifed) Kernel and "foster" dtb from L4T 23.1 worked for SATV but unstable, stock dtb was replaced.

I'd try not to replace stock DTB partition since I bricked my SATV once by updating to ROM 2.1.

I'm not sure about "3", i.e., how to integrate dtb with kernel. As I understand, fastboot passes dtbs from dtb partition and SDRAM training to kernel. I'm not sure if "integrated' dtb won't be overwritten by fastboot.
[Shield Android TV General] CableBurner:
Ok, than i assume they merged it in 23.1

Ok, thats good to hear, than start directly with "own" dtb.

What means unstable? Btw: was it flashed with fastboot flash dtb?

If its built into the kernel, it cant be overridden. Normally the bootloader loads dtb into RAM and passes the memory address to the kernel.

If you built it into the kernel, the dtb is simply appended at the end of the zImage and gets loaded by the bootloader together with the kernel. During Kernel compilation the Kernel is told to look for dtb not on the address the bootloader told him, but to look on Kerneloffset + size own size -> end of zImage. So the bootloader will load the original dtb and passes it's address to the kernel, but the kernel won't simply react and does his own thing. A colleague of mine (who does our Linux stuff) told me that a kernel config exists and the dtb can be simply appended with "cat zImage dtb > zImage_combined".

Best Regards,

Udo
[Shield Android TV General] yahoo2016:
There were multiple posts about unstability of L4T kernel R23.1 on SATV, e.g.,

http://xdaforums.com/showpost.php?p=64726392&postcount=211

Yes, L4T foster dtb was flashed to dtb partition using fastboot. At least 2 members bricked their SATV by flashing non-working dtb.
[Shield Android TV General] CableBurner:
I built L4T Kernel 23.1 and dtb from original nvidia git! Flashed dtb with fastboot. Seems good so far. I will clean everything up do some stability testing and will report!

Very exciting :D

Best Regards,

Udo
[Shield Android TV General] yahoo2016:
Did you use "tegra21_defconfig" to build kernel and dtb?

I did the following to build L4T R23.1 kernel:

export ARCH=arm64
export CROSS_COMPILE=/usr/bin/aarch64-linux-gnu-
sudo apt-get install gcc-aarch64-linux-gnu
sudo apt-get install gcc-arm-linux-androideabi

export CROSS32CC=arm-linux-androideabi-gcc

export TEGRA_KERNEL_OUT=../l4tOutDir1

mkdir $TEGRA_KERNEL_OUT

make mrproper
make O=$TEGRA_KERNEL_OUT mrproper

make O=$TEGRA_KERNEL_OUT tegra21_defconfig

make O=$TEGRA_KERNEL_OUT zImage -j9
make O=$TEGRA_KERNEL_OUT dtbs
make O=$TEGRA_KERNEL_OUT modules
make O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=<your_destination>
make O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=~/x1/rootfss/Linux_for_Tegra/rootfs1

But I did not try the kernel and dtb
[Shield Android TV General] anchung.chen:
I am also like to use L4T kernel of TX1 on shield TV.
[Shield Android TV General] Thanks_Meter:
I wonder why there should be any difference between the prebuild and a self-build V23.1 kernel. Which bootloader do you use? The old stable V1.3 or the new buggy one? But trying a L4T V24 beta kernel could be a good idea.