• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[KERNEL][FireTV Stick 4K] Custom Kernel For AFTV 4k - 6.2.7.7

Search This thread

tokoam

Senior Member
Jun 24, 2007
927
167
Plantation
Thanks for this . . I do have a general questions if I wanted to transfer files/movies to the my usb stick remotely from my computer what would be the easiest way to accomplish this ? Edit * I see stickmount does create /mnt /storage links but I cannot write to the drive . In FX when I try to copy it wants root access . When I try to grant it permission I get " This device does not appear to support the Andriod Storage Access Framework " . In ES File explorer when I try to copy anything it force quits the app . The drive is Mounted just can't write to it its formatted in ExFat . I also get an error upon a clean reboot saying appstore error this never happened until I installed the modules . Can your CIFS module be used in a windows machine if I share a folder ? I tried creating one and ES explorer can now see my share with files . But the CIFS folder does not show any mounted files .
 
Last edited:

tokoam

Senior Member
Jun 24, 2007
927
167
Plantation
I have no idea! Like i said, i'm still on 6.2.8.0 and i don't see a good reason to update.
Thanks I will stick to 8.0 any reason why I cannot get access to write to disk ? I have 2 tested drives both Extfat and Fat32 but unable to write to them . I can view them just fine however . Also gave up on CIFS I setup a simple windows share edited the services.sh file and In main unable to see files in CIFS folder also gave them permissions to everyone so there wouldnt be any issues .
 

Pretoriano80

Senior Member
Jun 9, 2010
3,244
2,917
Thanks I will stick to 8.0 any reason why I cannot get access to write to disk ? I have 2 tested drives both Extfat and Fat32 but unable to write to them . I can view them just fine however . Also gave up on CIFS I setup a simple windows share edited the services.sh file and In main unable to see files in CIFS folder also gave them permissions to everyone so there wouldnt be any issues .
You are using my latest OTG mount module? Which Magisk version you have installed?

Regarding CIFS, try using the 1.7 version that i attached on the previous page of this thread.
Using CIFS module when OTG mount module is also active might be tricky because a race condition that is caused on boot (so you can play a bit with the "sleep" time after the boot is completed in the CIFS module's "service.sh" file).
Also, CIFS version can be modified, so you can try setting it to 2.1. (but i recommend modifying the "sleep" time delay before modifying CIFS version).

Unfortunately FireTV4k was always been tricky with some Magisk modules, that's why i had to use the "sleep" time on these modules.
 
  • Like
Reactions: Sus_i

tokoam

Senior Member
Jun 24, 2007
927
167
Plantation
You are using my latest OTG mount module? Which Magisk version you have installed?

Regarding CIFS, try using the 1.7 version that i attached on the previous page of this thread.
Using CIFS module when OTG mount module is also active might be tricky because a race condition that is caused on boot (so you can play a bit with the "sleep" time after the boot is completed in the CIFS module's "service.sh" file).
Also, CIFS version can be modified, so you can try setting it to 2.1. (but i recommend modifying the "sleep" time delay before modifying CIFS version).

Unfortunately FireTV4k was always been tricky with some Magisk modules, that's why i had to use the "sleep" time on these modules.


Reguarding the module version there all up todate . V23 from magisk but I have also tried 20.4 ,22,22.1 and now 23 , and 1.4.1 of your OTG module . I will try to set sleep to 2.1 for CIFS module .
 
Last edited:

Languor

Member
Jan 26, 2014
32
11
I loaded wireguard app, added config file. I can’t figure out how you guys get to options to enable the kernel part. All I have is boxes with vpn servers to connect too. I’m on 6.2.7.7 fireos. Rooted as well. Any help greatly appreciated. Without vpn I get 120mb down. And with vpn I only get about 30.
 

yan2xme

Senior Member
Jun 8, 2018
104
16
Can you enable USB Audio Routing on this thing like I want to use USB DAC thru OTG /w bypassing android audio drivers so I can route the audio on 3.5mm jack to Aux? Is that gonna work all on AFTV4k? thanks
 

Pretoriano80

Senior Member
Jun 9, 2010
3,244
2,917
  • Like
Reactions: Sus_i

yan2xme

Senior Member
Jun 8, 2018
104
16
Enabling USB Audio on the kernel side it's not a problem, but it seems that it must be supported on the OS too - > https://source.android.com/devices/audio/usb
I saw a thread here that a user unsuccessfully can work the USB DAC thru an AFTV (2nd gen). He tried it to use UAPP and other audio players and also tried it on streaming but still no luck. I can’t still finally conclude if this does occur on AFTV4k with the latest Fire OS cause my OTG is still on its way to ours…
 

yan2xme

Senior Member
Jun 8, 2018
104
16
Enabling USB Audio on the kernel side it's not a problem, but it seems that it must be supported on the OS too - > https://source.android.com/devices/audio/usb
So okay, USB audio routing on AFTV4k does really work as documented on limited manner as I tested it (finally my otg cable arrived) without needing root. It only needs an app that supports USB audio support like HibyMusic and it detects the DAC but it only does work on that certain app and the not system-wide (doesn't work in system sounds and also yt, etc. yknow what i mean) . The volume control is not accessible as expected as the volume control is only thru IR TV but I saw a thread here on a workaround about that and I should check it out (https://forum.xda-developers.com/t/...from-alexa-remote-in-unsupported-tvs.4366841/) .
Using Lesser AudioSwitch doesn't do its thing too, it doesn't prompt for a usb connection when I click the USB DAC option for Input

And USB audio routing is not automatically turned on when plugging a USB dac as the USB configuration option is unexisting on the settings. I hope you can inspect it if it can be tweaked thru an ADB command or root to toggle it... any ideas sir @Pretoriano80 @Sus_i
Thanks
 
Last edited:

Pretoriano80

Senior Member
Jun 9, 2010
3,244
2,917
So okay, USB audio routing on AFTV4k does really work as documented on limited manner as I tested it (finally my otg cable arrived) without needing root. It only needs an app that supports USB audio support like HibyMusic and it detects the DAC but it only does work on that certain app and the not system-wide (doesn't work in system sounds and also yt, etc. yknow what i mean) . The volume control is not accessible as expected as the volume control is only thru IR TV but I saw a thread here on a workaround about that and I should check it out (https://forum.xda-developers.com/t/...from-alexa-remote-in-unsupported-tvs.4366841/) .
Using Lesser AudioSwitch doesn't do its thing too, it doesn't prompt for a usb connection when I click the USB DAC option for Input

And USB audio routing is not automatically turned on when plugging a USB dac as the USB configuration option is unexisting on the settings. I hope you can inspect it if it can be tweaked thru an ADB command or root to toggle it... any ideas sir @Pretoriano80 @Sus_i
Thanks
Well, root access may help with third party apps (if those require root to route USB audio), but system wide it's more complicated and unfortunately i can't help you with that.
 
  • Like
Reactions: Sus_i and yan2xme

yan2xme

Senior Member
Jun 8, 2018
104
16
Well, root access may help with third party apps (if those require root to route USB audio), but system wide it's more complicated and unfortunately i can't help you with that.
But will you opt out for webcam support soon? I tried using my webcam thru USB Camera and it works but need permission with usb peripheral and it wont work system wide to... it would be cool to have one
Is that possible sir to control UVC cams with Camera2 API support?

thanks again sir @Pretoriano80
 
Last edited:

Pretoriano80

Senior Member
Jun 9, 2010
3,244
2,917
But will you opt out for webcam support soon? I tried using my webcam thru USB Camera and it works but need permission with usb peripheral and it wont work system wide to... it would be cool to have one
Is that possible sir to control UVC cams with Camera2 API support?

thanks again sir @Pretoriano80
I already added UVC and V4L support a while back, but the Magisk Module with the kernel modules was somehow lost (probably when XDA switched platform), so i uploaded the Magisk Module again.
Install the AFTV4K_KERNEL_MODULES with Magisk Manager and reboot, after that the UVC should be enable (use "lsmod" command in terminal to check if the modules were loaded properly).

P. S. I also uploaded kernel 6.2.8.0 R2 and 6.2.8.1 R1, but be aware that both of them were untested.

Personally i had to downgrade to FireOS 6.2.7.6 because i need Dolby ATMOS passthrough, which was disabled by Amazon on 6.2.7.7 + .
That being said, probably there won't be any more kernel updates from me.
 
  • Like
Reactions: yan2xme

Pretoriano80

Senior Member
Jun 9, 2010
3,244
2,917
I loaded wireguard app, added config file. I can’t figure out how you guys get to options to enable the kernel part. All I have is boxes with vpn servers to connect too. I’m on 6.2.7.7 fireos. Rooted as well. Any help greatly appreciated. Without vpn I get 120mb down. And with vpn I only get about 30.
Kernel support should be automatically detected by WireGuard app (on previous versions there was an option for that).
I will check if for some reason the wireguard module is missing from 6.2.7.7 and re-upload it in case it does.

P.S: You can try the new "boot_mantis_6.2.7.7_R3_3033" kernel from OP !
 
Last edited:

bibikalka

Senior Member
May 14, 2015
1,394
1,096
Kernel support should be automatically detected by WireGuard app (on previous versions there was an option for that).
I will check if for some reason the wireguard module is missing from 6.2.7.7 and re-upload it in case it does.

P.S: You can try the new "boot_mantis_6.2.7.7_R3_3033" kernel from OP !

I am on version 6.2.7.7 and need USB with large file support. I was using "USB StickMount" but it seems somewhat flaky (or maybe it's my MX Player?).

I am interested in your kernel and Magisk module to make a bit more painless.

Anyway, is your 6.2.7.7 kernel rock solid? I have 4k stick plugged into a UPS, so it is never is rebooted. It could run for days without issues.
 

Languor

Member
Jan 26, 2014
32
11
Kernel support should be automatically detected by WireGuard app (on previous versions there was an option for that).
I will check if for some reason the wireguard module is missing from 6.2.7.7 and re-upload it in case it does.

P.S: You can try the new "boot_mantis_6.2.7.7_R3_3033" kernel from OP !
thanks so much for all your work, i will try to load it on the next few days. I only had loaded the selinux module before, ill also try loading the other kernel module with it as well. sory to be a pain, any chance you cAN upload a copy of the magisk i can flash with twrp as well that you used? theres different versions around. thanks!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    got around to fixing my firestick, instead of going to get a usb hub, i just shorted the pin out and booted twrp and pushed the new 6.2.7.7_R3 kernel. i flashed it and it rebooted on the bootscreen once (mini heart attack lol) then when it booted again all was fine! thanks again for all your work!
  • 14
    Warning !!! Use this kernel on your own risk !!! I can't be held responsible for any kind of damage or data loss !!!
    Features:
    • SDCARDFS
    • exFAT and F2FS support
    • Wireguard
    • Advanced TCP options
    • CIFS and NFS support
    • Insecure ADB

    v1 -6.2.6.8-Changelog
    v1 -6.2.6.8-Changelog
    • defconfig: Enable SDCARDFS
    • sdcardfs: Fix sdcardfs to stop creating cases-sensitive duplicate entries.
    • ANDROID: sdcardfs: Make WARN_RATELIMIT to pr_debug
    • ANDROID: sdcardfs: Add missing break
    • ANDROID: Sdcardfs: Move gid derivation under flag
    • ANDROID: mnt: Fix freeing of mount data
    • config: Add full mantis config
    • defconfig: Enable Wireguard
    • net: Add Wireguard importer
    • defconfig: Disable Amazon Metrics
    • defconfig: Enable Advanced TCP Congestion
    • defconfig: Enabled IKCONFIG_PROC
    • defconfig: Enable Network Filesystems
    • defconfig: Enable CIFS support
    • fs:Enable NFS support
    • fs: Enable exFAT Filesystem
    • fs: Add exFAT support
    • defconfig: Enable F2FS

    v1 -6.2.7.1-Changelog
    v1 -6.2.7.1-Changelog
    • defconfig: Enable SDCARDFS
    • sdcardfs: Fix sdcardfs to stop creating cases-sensitive duplicate entries.
    • ANDROID: sdcardfs: Make WARN_RATELIMIT to pr_debug
    • ANDROID: sdcardfs: Add missing break
    • ANDROID: Sdcardfs: Move gid derivation under flag
    • ANDROID: mnt: Fix freeing of mount data
    • config: Add full mantis config
    • defconfig: Enable Wireguard
    • net: Add Wireguard importer
    • defconfig: Disable Amazon Metrics
    • defconfig: Enable Advanced TCP Congestion
    • defconfig: Enabled IKCONFIG_PROC
    • defconfig: Enable Network Filesystems
    • defconfig: Enable CIFS support
    • fs:Enable NFS support
    • fs: Enable exFAT Filesystem
    • fs: Add exFAT support
    • defconfig: Enable F2FS


    v2 -6.2.7.1-Changelog
    v2 -6.2.7.1-Changelog
    Enabled XPAD driver (this will enable support for Microsoft XBOX gamepads)


    v3 -6.2.7.1-Changelog
    v3 -6.2.7.1-Changelog
    Wireguard not working issue is now fixed (please install the AFTV4k_Selinux_Magisk_Module.zip after installing the kernel)


    v1 -6.2.7.3-Changelog
    v1 -6.2.7.3-Changelog
    • defconfig: Enable SDCARDFS
    • sdcardfs: Fix sdcardfs to stop creating cases-sensitive duplicate entries.
    • ANDROID: sdcardfs: Make WARN_RATELIMIT to pr_debug
    • ANDROID: sdcardfs: Add missing break
    • ANDROID: Sdcardfs: Move gid derivation under flag
    • ANDROID: mnt: Fix freeing of mount data
    • config: Add full mantis config
    • defconfig: Enable Wireguard
    • net: Add Wireguard importer
    • defconfig: Disable Amazon Metrics
    • defconfig: Enable Advanced TCP Congestion
    • defconfig: Enabled IKCONFIG_PROC
    • defconfig: Enable Network Filesystems
    • defconfig: Enable CIFS support
    • fs:Enable NFS support
    • fs: Enable exFAT Filesystem
    • fs: Add exFAT support
    • defconfig: Enable F2FS
    • Enabled XPAD driver (this will enable support for Microsoft XBOX gamepads)
    • Wireguard fix (please install the AFTV4k_Selinux_Magisk_Module.zip after installing the kernel)


    R1 -6.2.7.6-Changelog
    R1 -6.2.7.6-Changelog
    • defconfig: Enable SDCARDFS
    • sdcardfs: Fix sdcardfs to stop creating cases-sensitive duplicate entries.
    • ANDROID: sdcardfs: Make WARN_RATELIMIT to pr_debug
    • ANDROID: sdcardfs: Add missing break
    • ANDROID: Sdcardfs: Move gid derivation under flag
    • ANDROID: mnt: Fix freeing of mount data
    • config: Add full mantis config
    • defconfig: Enable Wireguard
    • net: Add Wireguard importer
    • defconfig: Disable Amazon Metrics
    • defconfig: Enable Advanced TCP Congestion
    • defconfig: Enabled IKCONFIG_PROC
    • defconfig: Enable Network Filesystems
    • defconfig: Enable CIFS support
    • fs:Enable NFS support
    • fs: Enable exFAT Filesystem
    • fs: Add exFAT support
    • defconfig: Enable F2FS
    • Enabled XPAD driver (this will enable support for Microsoft XBOX gamepads)
    • Wireguard fix (please install the AFTV4k_Selinux_Magisk_Module.zip after installing the kernel)


    R3 -6.2.7.7-Changelog
    R3 -6.2.7.7-Changelog
    • 2f447f82b defconfig: Enable USB Serial FTDi-SIO
    • 8b84c88e9 defconfig: Enable XPAD driver
    • ec89c3cc8 defconfig: Enable UVCVIDEO
    • 67ca709a6 defconfig: Enable SDCARDFS
    • f4f1b3fa0 sdcardfs: Fix sdcardfs to stop creating cases-sensitive duplicate entries.
    • b1eeb0fef ANDROID: sdcardfs: Make WARN_RATELIMIT to pr_debug
    • b6a76bbb2 ANDROID: sdcardfs: Add missing break
    • 962bd1f78 ANDROID: Sdcardfs: Move gid derivation under flag
    • 705999951 ANDROID: mnt: Fix freeing of mount data
    • 9f15be5ad defconfig: Enable Wireguard
    • 883a014a9 net: Add Wireguard importer
    • 68b1bb60b defconfig: Disable Amazon Metrics
    • efd514f93 defconfig: Enable Advanced TCP Congestion
    • ae7306d2d defconfig: Enabled IKCONFIG_PROC
    • 73017ed8e defconfig: Enable Network Filesystems
    • 149dc468c defconfig: Enable CIFS support
    • f0d5ceb5a fs:Enable NFS support
    • 485fce697 fs: Enable exFAT Filesystem
    • a61103c71 fs: Add exFAT support
    • 5a43a9876 defconfig: Enable F2FS
    • 99f0df6ac Initial commit - Amazon FireTV 4K - 6.2.7.7


    Installation:
    • Download and install with TWRP
    • If you are rooted,flash Magisk after flashing the kernel (installing Magisk is mandatory if you want to avoid issues and use all kernel features or my Magisk modules )
    • Install the kernel modules with Magisk (optional - only required if you need uvcvideo and advanced TCP)
    • Install AFTV4k_Selinux_Magisk_Module.zip ( this is mandatory if you want to avoid issues and use all kernel features or my Magisk modules )
    • Reboot
    Kernel Modules and AFTV4K_CIFS_MOUNTING_MODULE :
    • Download and install with Magisk Manager
    • Reboot

    AFTV4K_CIFS_MOUNTING_MODULE:
    • Download AFTV4K_CIFS_MOUNTING_MODULE.zip
    • Unpack the module
    • Open service.sh with a text editor (on Windows i recommend Notepad ++) replace user, pass and path with your own values
    • Repack the module and install with Magisk Manager
    • Reboot
    Source Code -> Github
    3
    Thx! Next step would be to switch the internal storage to F2FS. xD
    3
    New version (6.2.7.7) it's up!!
    This time some extra work was required, thx to Amazon devs, because they "trimmed" the kernel sources, basically removing most of the code required for this custom kernel.
    3
    Here are two 6.2.8.0 kernel builds :

    1) 6.2.8.0_r1
    This build is in sync with Amazon's source + all the features from the previous version

    2)6.2.8.0_no_efuse
    This is experimental and it's the same as R1 but on this one i also disabled the efuse_check script from running on boot. Probably it's useful only for those who didn't updated to 6.2.8.0 yet and it must be installed right after you install 6.2.8.0 with TWRP (so you won't let the new OS to boot and launch the script)
    There are not enough infos about this efuse stuff, so this is a version i made for myself, just to test if there are any issues after disabling efuse_check on boot.

    BTW, i noticed that on 6.2.8.0 it takes longer for FireOS to boot, nut i don't know if it's related to my kernel or not because i never used 6.2.8.0 with the stock kernel.
    2
    Hi Pretoriano!

    Awesome work, mate! LOVE your kernel!

    I tried flashing it under 6.2.7.1, but got bootloop. How can I make this kernel work in the latest OS?

    Thanks again!
    I've just updated my FTV 4k to 6.2
    7.1 and also updated the kernel, will upload it later, after pushing everything to GitHub.

    Edit: OP updated with the new version