yashsingh1/xdaforums huggingface dataset:
[Shield Android TV General] chapas:
[MENTION=2310389]lexyan77[/MENTION], I was still hoping for someone to get compiling steps (I was not lucky with the original post), but i guess it's not easy and no one wants to pour its time on it... no one is tending for this thread anymore.

So yes, other kernel, please! This is my setup, PCTV 461e and Shield 2017 16G with shield experience 7.2.3. I know you won't be able to test it.

If you please could you update the tutorial so I build my own image as well, in the future?

If you build the kernel only, will it not work because you are not getting the same build as the official?

Thanks in advance
[Shield Android TV General] ikarus.nc:
If you can I need 2017 16gb version, I would be glad to test it. In every case thank you!
[Shield Android TV General] chapas:
Thanks for dumping your build effort on the thread, i will try to follow these steps, already installed Ubuntu 14.04.6 LTS.

Which line corresponds to the PCTV 461e?

What changes for building to Shield 2017 16g instead?

*edit:

OK, just got lost.....

step 2) second line (link: https://source.android.com/setup/build/downloading)

Do i have to follow until the end? This downloads the full Android repo? Doesen't the nvidia shield sources contains this already?
[Shield Android TV General] lexyan77:
Hello Chapas,

You're right, you just need the repo binary, just follow until step 2 of "Initializing a Repo client " then you continue with Nvidia instructions

With Ubuntu 14.04.6 you need to install "openjdk 8" wich is not in the official repository.

To install it you must run these command to add it:

sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt install openjdk-8-jdk
[Shield Android TV General] locki:
it is just follow instructions: https://bitbucket.org/nopnop9090/shieldtv-kernel/wiki/Home and have prepared it all from google instruction ... it need just have basic knowledge about linux ... and i just google these errors, there is little bit different folder structure, they changed from kernel to kernel/kernel-4.9 i will put it there together ... i have notes on computer at home ... so later

[MENTION=2310389]lexyan77[/MENTION] how to add support for xbox tuner and root to tshoot it via dmesg? i didn't found that i kernel menu for tick it
[Shield Android TV General] locki:
Please if you have enought free time to try it to flash my kernel, but without warantly ... because i compiled kernel first time :D

licence ... I didnt skipped that, I ACCEPTED :)

Ass i understand that, in kernel are enabled and compiled modules which nvidia need for working shield, you just enable some funkcionality which you need, problem is i dont know where i can enable root access via adb to tbshoot and how to add support for devicech wchi arent supported in kernel 4.9 ... :(

I edited: to change kernel config (to add modules etc) I followed this better clener way ...

cd shield-open-source/kernel/kernel-4.9
make tegra21_android_defconfig ARCH=arm64 # get current kernel config
make menuconfig ARCH=arm64 # edit config to your needs (enable modules etc)
cp .config arch/arm64/configs/tegra21_android_defconfig # overwrite old config with the edited one
make mrproper # clean up temporary files

#now you can do *mp buildimage -j9* etc

a a much better (cleaner) defconfig change is possible aswell - it needs some patience and dedication tho:

# **note: you need to do this on a clean checkout**

cd shield-open-source

# backup the original kernel config file to a safe place:

cp kernel/kernel-4.9/arch/arm64/configs/tegra_android_defconfig ~/tegra_android_defconfig.original

# build a bootimage without changing anything beforehand:

mp bootimage -j2

# overwrite the defconfig with the full kernel config file that was created during compile

cp out/target/product/t210/obj/KERNEL/kernel-4.9/.config kernel/kernel-4.9/arch/arm64/configs/tegra_android_defconfig

# rebuild the bootimage again without changes:

mp bootimage -j2

cp out/target/product/t210/obj/KERNEL/kernel-4.9/.config kernel/kernel-4.9/.config
cd kernel/kernel-4.9
make menuconfig ARCH=arm64

# *make your changes ..*

# now, find out what CONFIG_... values were added(removed/etc by using the diffconfig script:

scripts/diffconfig /shield-open-source/out/target/product/t210/obj/KERNEL/kernel-4.9/.config .config > CONFIGDIFF.TXT

# copy back the original defconfig

cp ~/tegra_android_defconfig.original arch/arm64/configs/tegra_android_defconfig

# cleanup kernel temp files created by menuconfig

make mrproper

# manually edit arch/arm64/configs/tegra21_android_defconfig and carefully apply the smallest set of

# changes needed that were recorded (in the CONFIGDIFF.TXT file)

joe arch/arm64/configs/tegra_android_defconfig CONFIGDIFF.txt

# finally, make sure the applied changes really work:

mp bootimage -j9

# dont forget to remove the CONFIGDIFF.TXT to keep it all clean

rm CONFIGDIFF.TXT
[Shield Android TV General] chapas:
I believe I can't flash the image you compiled (TARGET_PRODUCT=foster_e) because i own a Shield 2017 16GB and this would brick my shield or something.

I understand that by configuring the kernel we will be adding/removing functionality to the shield. I don't know wich kernel switch's I need to turn on to have my USB PCTV 461e device working.

ATM I'm still stuck on my build, looking for answers to make this work, i feel i might not be that far from the objective but i don't know enough to finish this.
[Shield Android TV General] locki:
you should just enable it: https://www.linuxtv.org/wiki/index.php/Pinnacle_PCTV_DVB-S2_Stick_(461e) it is in kernel since 3.14, and 7.2.3 use 4.9 kernel ...
[Shield Android TV General] locki:
maybe some rights? i did all under root ... in folder /root/shield-open-source/

and i cant see any: joe arch/arm64/configs/tegra_android_defconfig CONFIGDIFF.txt

you must install joe it need some packages apt-get install joe something something
[Shield Android TV General] chapas:
Indeed, I didn't use root to do it. I used my own user. Don't really know if this is an issue.

Meanwhile, I have edited the file in question and made some change to that particular line. Rebuild and it got finished, so I think the next step is to flash and brick :)

I only know how to use 'nano', I tried 'joe' but I'm simply to dumb to know how to use (in a small time) one more tool that does probably the same when all i needed is to append what was modified to one file . I copied all .configs over FTP to windows, diff them and edite the file there and uploaded them again to the VM.

Did you build tvheadend for the shield?

ps: I have all this setup running on my RPI (PCTV416e + tvheadend + oscam ouputing on kodi) , only that it doesn't have enough CPU to process HD channels, hence all this effort to move this setup to the shield.
[Shield Android TV General] lexyan77:
Hi Chapas and Locki,

You don't need to be root to compile, root user must be use only for maintenance task.

Nvidia has made some change in the kernel source code, it's more an hybrid between kernel 3.14 and kernel 4.9 on some part.

Some part of code are kept from kernel 3.14 to keep compatibility with prebuilt binaries they use.

You must disable "VIDEO_EM28XX_ALSA" to compile without modification (Alsa is only used for analog TV).

Nano and Joe are identical text editor but Joe allow to open 2 or more files at a time so its more efficient to compare files.
[Shield Android TV General] chapas:
Lexyan,

thanks for stepping in and clearing some doubts.

Do you know any more kernel options that i may need to add for my setup (PCTV416e + tvheadend + oscam ouputing on kodi)?

Whats the easiest way to add Magisk to boot.img?

Regards,

chapas
[Shield Android TV General] chapas:
Ended up with a boot loop. I have to find out how to roll this crap back.

So much wasted time.
[Shield Android TV General] chapas:
Beaten but not dead.

I've tried ALL 'boot.img' that I compiled along the way and all of them are stuck on a boot loop (even the clean and kernel untouched one; WTF).

I ended up by installing the boot.img from "NVIDIA SHIELD TV 2017 Developer Only OS Image / 7.2.3 / 2019/03/14", and that brought it back to life again.

Don't know what to do next. Any explanation for this or any similar results?
[Shield Android TV General] chapas:
Basically, this is just me talking to myself out loud in the hope that someone (@locki or [MENTION=2310389]lexyan77[/MENTION]) ears me and decides to help;

So now I have different problems:

Did

fastboot flash staging blob
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash vendor vendor.img
fastboot reboot

Worked and went back to life, everything seemed OK after playing around with it for a while

Re-flashed my compiled "boot.img" file and to my surprise it started up, then came the problem:

- No wifi (only ethernet) and no USB ports.

Ideas?

Regards,

chapas
[Shield Android TV General] lexyan77:
Hi chapas,

Glad your Shield is no more bricked.

To avoid problem, next time you want to test a kernel don't flash it, instead you can make the Shield boot on it with "fastboot boot boot.img", if something goes wrong you can reboot the Shield to retrieve original kernel.

I have recompiled the kernel for my Shield with almost all DVB devices included.

I have tested only the 2015 16G version (foster) with:

R820

R820/T2

Hauppauge WinTV-dualHD

PCTV Systems tripleStick T2 (292e)

If you want to test it you can find the 2017 version (darcy) in my dropbox Shield 7.2.3

I can probably provide support for the next week if you need it.

If all is working, I'll post a patch containing my modifications.

As usual you flash it at your own risk and i m not responsible for any damage that can occurred
[Shield Android TV General] ikarus.nc:
Unfortunately Darcy version lead to a bootloop :(
[Shield Android TV General] locki:
for testing dont use:

fastboot flash boot boot.img

instead you can make the Shield boot on it with

fastboot boot boot.img

I hope I will try boot 2015/16GB version today with my tuner :)
[Shield Android TV General] ikarus.nc:
What I meant was that booting with that img will reset the Nvidia shield, I tried with "fastboot boot" ?
[Shield Android TV General] chapas:
Thanks for your help lexyan,

you image didn't enter on bootloop like ikarus.nc mentioned on his post, but it has exactly the same problem as mine, no Wi-Fi device available. In turn i did connect a ethernet cable just to try out the rest.

Did

adb root
adb shell
darcy:/lib/firmware $ sudo cp /storage/emulated/0/Download/dvb-demod-m88ds3103.fw /lib/firmware/dvb-demod-m88ds3103.fw
[B]cp: /lib/firmware/dvb-demod-m88ds3103.fw: Read-only file system[/B]

how can i copy the firmware file there?

$ sudo dmesg | grep PCTV
$ sudo dmesg | grep dvb

yield nothing...
[Shield Android TV General] locki:
you must run adb as root :

adb root shell
then just adb shell

and you have root access

and i have every time problem that remote control stop working with custom kernel with dvb-t support .... weird
[Shield Android TV General] chapas:
I did! Check my post again.

That almost seems that the original boot.img is not compiled from the same source. I don't understand...
[Shield Android TV General] lexyan77:
Hi chapas,

You can't copy file to "/lib/firmware" as this directory is on "system" partition, any modification on this partition prevent the Shield from booting.

My modification allow loading firmware files from "/data/dvb/firmware" and "/data/firmware" and you don't need to be root to copy files in it but you must reboot the Shield after copying files to have proper permissions on the files.

Locki, you need firmware files "dvb-tuner-si2158-a20-01.fw" placed in "/data/firmware" or "/data/dvb/firmware" for your dongle to work.
[Shield Android TV General] ikarus.nc:
Anyone, besides me, tried the 16gb 2017 version boot image?
[Shield Android TV General] chapas:
I did, it booted, but no Wi-Fi for me.

---------- Post added at 06:21 PM ---------- Previous post was at 06:15 PM ----------

Thank's lexyan,

When you say "My modification", can you be more explicit so I can do the same when I compile an image again.
[Shield Android TV General] ikarus.nc:
Did you do something particular? I just did "fastboot boot boot.img" whatever is the name of the image, and the shield reboot with its own kernel, thank you for your help.
[Shield Android TV General] chapas:
Well,

I didn't do anything in particular. Just what you did.

Make sure the file is complete (15MB).

Make sure you are the same version 7.2.3 (if you can).

Read the 3 previous pages on this thread, there is a lot of information there.

If I were in your shoes I would download the version 7.2.3 from:

https://developer.nvidia.com/gameworksdownload#?search=SHIELD%20TV%202017%20Developer&tx=$additional,shield

and do what I've done from:

https://xdaforums.com/showpost.php?p=79363874&postcount=366

and then the "fastboot boot boot.img" again.
[Shield Android TV General] ikarus.nc:
I have 7.2.3, and did all the steps maybe the img I downloaded was corrupted, I'll retry that, thank you
[Shield Android TV General] xd4d3v:
ok, I installed the media kernel.

without doing any insmod.

dmesg doesn't show any complains about the tuner:

-----

<6>[ 7.512936] usb 2-2: new high-speed USB device number 2 using tegra-xhci

<6>[ 7.533843] usb 2-2: New USB device found, idVendor=1415, idProduct=0003

<6>[ 7.533846] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3

<6>[ 7.533848] usb 2-2: Product: SCEH-0036

<6>[ 7.533850] usb 2-2: Manufacturer: SONY

<6>[ 7.533852] usb 2-2: SerialNumber: ALR001MAMB

---------------

however, tvheadend still doesn't display the tuner in the web-config? thanks
[Shield Android TV General] nopnop9090:
download the firmware file at https://github.com/OpenELEC/dvb-firmware/blob/master/firmware/dvb-usb-dib0700-1.20.fw (click on raw) and put it in /system/etc/firmware then reboot.

the media kernel needs some additional work on your side as it does not load any drivers automatically. you would need to find out which modules your particular tuner needs and load them by issuing "insmod somefile.ko" prior starting tvheadend. you will then need the firmware file mentioned above in /system/etc/firmware aswell. so my advise: get back to the other kernel and try it with the firmware file installed first.
[Shield Android TV General] nopnop9090:
okay, seems that i am halfway allowed to post links now (but not on the topic starter as it gets flagged and denied..)

Androidfilehost (prebuilt images): https://www.androidfilehost.com/?w=files&flid=48701

Github repo: https://bitbucket.org/nopnop9090/shieldtv-kernel

Wiki: https://bitbucket.org/nopnop9090/shieldtv-kernel/wiki

Youtube: https://www.youtube.com/watch?v=qo9N6-tbDX8
[Shield Android TV General] xd4d3v:
Thanks nop.

I tried with the previous kernel, and the fw file and got it working!

I'm hoping when we eventually get marshmallow, this can be done too, I might get used to using this.
[Shield Android TV General] nopnop9090:
it will work with marshmallow as long as nvidia stays to its policy to give out the sources - and why should they change it? glad to see its working for you :)
[Shield Android TV General] ErAzOr2k:
Which kernel should I use for technotrend 4400 (DVB-C)?

boot-9839df161c4b-dvbsky.tar.gz or boot-ef357d3ae3b0-default.tar.gz ?
[Shield Android TV General] nopnop9090:
the tt4400 should be almost identical to the dvbsky t330 i am using so the dvbsky kernel should work perfect for you.

get the dvbsky-firmware.tar.gz aswell and extract+copy the .fw files to /system/etc/firmware
[Shield Android TV General] TAM1m:
First of all, great work man!

Is there any chance to get those Sundtek receivers to work? They usually have no kernel driver. You have to download and install a userspace driver. I'm using a Sundtek MediaTV Pro III.

I know they are working on their android driver but its not released yet. Would be so nice if I could get this thing working with your solution.
[Shield Android TV General] nopnop9090:
i am sorry but according to https://linuxtv.org/wiki/index.php/Sundtek the drivers are closed source so I cannot tell if its possible to get them working on the shield - I bet it is possible the one way or the other but without having the actual hardware to try the different ways (i.e. installing a minimal linux userspace in chroot, maybe patching the android "linker" application to allow non-PIE-code etc) I cannot really help with these.

I would suggest to either wait for soundtek to "get their **** together" (supply the long promised android drivers) or simply grab one of these cheap dvbsky t330 rebrands like for the edision optimuss sticks - they are sold at about 30 EUR at the moment..
[Shield Android TV General] TAM1m:
Thanks for clarification. One more question. How did you compile the tvheadend backend? Did u just use the official sources from their github or did you have to patch anything to get it to work on android?
[Shield Android TV General] nopnop9090:
compiled on a modified buildroot environment (buildroot.net), the sources were pulled from the official tvheadend github but i had to modify some scripts to get everything statically compiled (thats why the file is 80 megabytes in size). i remember having some libdvbcsa issues aswell but dont know what was up with it exactly right now. sources/buildscripts/howtos will be published onto the bitbucket repo when I got time to write everything down, cross compiling is a messy thing sometimes.

currently there are ffmpeg with hw support and samba server that I am experimenting with, when I got something useable together I will put it on androidfilehost for everyone to try and as soon as everything proved to be stable I plan to wrap the apps and scripts in an apk file that will make the installation a simple sideload.
[Shield Android TV General] xd4d3v:
great news man.

would love a samba server.

Thats what I thought when you first came out with NTFS support, ideal to use the shield as a NAS.
[Shield Android TV General] tf101crasher:
We are going to release the driver part of our app within a few days, the drivers work with a non-rooted android environment and also have direct network support (eg. stream from linux to android etc) and it's not limited to a particular android systems - it will work with most of them (wherever USB access is available).

The drivers should have been released a longer time ago already however we ran into issues with a chip supplier which then had a higher priority back then. This package will support all our models.

Sundtek
[Shield Android TV General] xaudiblex:
Would anyone happen to know if this works with the HDHomeRun Extend ATSC OTA network tuner? If so, would we need any special drivers or would support be built into it already?
[Shield Android TV General] nopnop9090:
the hdhomerun should be usable by kodi without any kernel change - installing the hdhomerun plugin in kodi should be all that is needed to make it work (watch TV). if you want the PVR powers that tvheadend provides, just install the tvheadend package from my androidfilehost area, it should scan for and use the hdhomerun automatically.

you only need a new kernel if you want to use externally attached USB DVB/ATSC tuners or if you want to use NTFS file system on your external media (in that case, you can simply use the boot-ef357d3ae3b0-default.tar.gz kernel which does not include any new drivers, its just the stock kernel with NTFS enabled)

so basically:

extract tvheadend.tar.gz, make a /data/dvb directory on the shield, copy tvheadend file into that dir and make it executable (chmod 0774), copy the bootscript to /data on the shield and make it executable, then connect with adb shell, execute tvheadend once with -C parameter (see a few posts above) to make it start in setup-mode, access its web interface and configure it, then reboot. at the end install tvheadend pvr plugin in kodi.
[Shield Android TV General] nopnop9090:
if you want to watch tv and browse epg / setup tv recording timers from your smartphone I suggest to get this tvhclient app from playstore: https://play.google.com/store/apps/details?id=org.tvheadend.tvhclient - its awesome.
[Shield Android TV General] baggerbodo:
Is there any DVB S2 stick to work with the Shiekd TV? I can´t find any.
[Shield Android TV General] nopnop9090:
check http://linuxtv.org/wiki/index.php/DVB-S2_USB_Devices for a list of devices - i would recommend the technotrend line of sticks because the drivers are usually well matured. if you are short off money check the dvbsky derivates. try to get a stick that is supported in linux kernel version 3.10 so you dont need to use backported drivers. if you are unsure with a particular stick/brand please post the exact name and maybe store url that you are willing to buy before placing an order.
[Shield Android TV General] xaudiblex:
Thanks for the awesome work! I finally got the server installed but I am having problems configuring it. When I am in the setup, I click on:

1) Configuration

2) TV Adapter

All I see is an empty folder titled "TV adapters" with no plus boxes or drop down boxes. Could this be an issue of a missing driver? Thanks in advance!
[Shield Android TV General] lexyan77:
If you want to check if your download is good :

for file boot_7.2.3_darcy_userdebug.img

SHA256 = DDA1917BAFEB7FE3A8586D0A877E4CE46196B54311D5C119B714E17E482D404E

MD5 = 629A2E78208CC9C4C8141E041B5CF770

for file boot_7.2.3_foster_userdebug.img

SHA256 = 7163B981725549C76A9BAD160B8FB528D2CD6F7FD1113127698834F04EC0B5C4

MD5 = 8CD4588206CEEF07B32A914A90C66BB8
[Shield Android TV General] lexyan77:
You can check if your tuner is visible in "/dev/dvb" with command "ls -lar /dev/dvb", tvheadend scan this folder to find adapter
[Shield Android TV General] locki:
1|foster:/ # ls -lar /dev/dvb

total 0

drwxr-xr-x 2 root root 120 2019-05-07 20:40 adapter0

drwxr-xr-x 19 root root 2600 2019-05-07 21:05 ..

drwxr-xr-x 3 root root 60 2019-05-07 20:37 .

foster:/ #

downloaded probably latest tvheadend.3.14.19.apk from https://androidfilehost.com/?fid=1395089523397917101

and my tuner is recognized there ... scaning and tuned all but problem again ... i try add live chanels in tvheaded on android tv but i every time get wrong user password... i created user same way like there: https://www.youtube.com/watch?v=rDQyHFZ-l9Y tryed hostname like localhost 127.0.0.1 actual shield ip 192.168.101.5 but still wrong password like it cant connect :(
[Shield Android TV General] chapas:
I have to say, there must be something pretty wrong with my ShieldTV, with file: boot_7.2.3_darcy_userdebug.img, i plug a USB mouse and it does not work, next i flash the original boot.img and the mouse is working again; i can even connect the PCTV461e and i have:

darcy:/ $ sudo dmesg | grep dvb
[ 9.316971] em28xx: Registered (Em28xx dvb Extension) extension
[ 69.482895] type=1400 audit(1557267711.723:948):[B] avc: denied { open } for pid=5899 comm="libtvheadend.so" path="/dev/dvb"[/B] dev="tmpfs" ino=34443 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:device:s0 tclass=dir permissive=1
[ 87.167379] em28xx 1-3:1.0: dvb set to isoc mode.

darcy:/ $ sudo dmesg | grep PCTV
[ 86.773156] usb 1-3: Product: PCTV 461
[ 86.773159] usb 1-3: Manufacturer: PCTV
[ 86.774498] em28xx 1-3:1.0: New device PCTV PCTV 461 @ 480 Mbps (2013:0258, interface 0, class 0)
[ 87.167374] em28xx 1-3:1.0: Identified as PCTV DVB-S2 Stick (461e) (card=92)

But i does not show up in TVheadend, the driver is not loaded.

How can i completely wipe my Shield TV 2017 16GB?

Thanks
[Shield Android TV General] locki:
in adroid is somewhere in setting to fastory defaults, try tvhedend from my post ... did you tryed: ls -lar /dev/dvb ???? what it show?
[Shield Android TV General] lexyan77:
If you want to compile the kernel yourself, here is the patch containing my modifications : https://www.dropbox.com/s/vaf2pc3nbci3jec/shield-7.2.3-lexyan-dvb.patch?dl=0