[ROM] [unlocked] [tank] LineageOS 12.1

Search This thread

Sovik.Soni

Member
Dec 8, 2021
9
0
How to get DRM Playback working

I analyzed the binaries in the stock rom and found the missing patch to get secure video playback working. libstagefright needs to set an special gralloc usage flag. For the devs, here is the source patch for frameworks/av:
Code:
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index cdeb161f7..130dc18c4 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -784,6 +784,12 @@ status_t ACodec::configureOutputBuffersFromNativeWindow(
         usage |= GRALLOC_USAGE_PROTECTED;
     }
 
+#define GRALLOC_USAGE_SECURE 0x01000000;
+    if (mFlags & kFlagIsSecure) {
+        usage |= GRALLOC_USAGE_SECURE;
+        ALOGW("ACODEC: use GRALLOC_USAGE_SECURE\n");
+    }
+
     // Make sure to check whether either Stagefright or the video decoder
     // requested protected buffers.
     if (usage & GRALLOC_USAGE_PROTECTED) {
I will attache a patched libstagefright version to the post. Copy it over /system/lib/libstagefright.so and it should work. I tested it with the official prime video app.
@julianwi sir this patch is not working. Is there any other way to make netflix and prime work. I'm using Prime Video - Android TV 5.6.13-armv7a apk and Lineage OS 12.1 latest release
 

BOOTMGR

Senior Member
Aug 3, 2010
728
3,392
anoobdevsdiary.blogspot.in
@julianwi sir this patch is not working. Is there any other way to make netflix and prime work. I'm using Prime Video - Android TV 5.6.13-armv7a apk and Lineage OS 12.1 latest release

The patch is doing its work. The problem is with the Audio HAL. It always reports that DD and DD+ are available, even though the underlying sink (your device) does not support it. On my device, Prime Video always chose EAC3 (DD+) format and crashed as my device couldn't support that.

After analyzing blobs, I noticed that Fire OS passes some Dolby related params to Audio HAL during HDMI device setup, which are currently not sent by Lineage. Below is the build which should fix this issue. Along with that, it sets a few more flags required by Audio/Video decoders.

Download: lineage-12.1-20220120-UNOFFICIAL-tank.zip

Changes:
- Fixes Audio related issues with Amazon Prime and Netflix
- Several compatibility changes for HW blobs
- Latest Lineage sources (not sure what new you will get as 12.1 is almost dead)


A big thanks to @diegocr and other folks who have worked hard on this project.

PS: As usual, not warranties, flash at your own risk. Some apps might require WebView impl. Install Android System from play store.
 
Last edited:

akela1979

Member
May 12, 2018
15
2
The patch is doing its work. The problem is with the Audio HAL. It always reports that DD and DD+ are available, even though the underlying sink (your device) does not support it. On my device, Prime Video always chose EAC3 (DD+) format and crashed as my device couldn't support that.

After analyzing blobs, I noticed that Fire OS passes some Dolby related params to Audio HAL during HDMI device setup, which are currently not sent by Lineage. Below is the build which should fix this issue. Along with that, it sets a few more flags required by Audio/Video decoders.

Download: https://androidfilehost.com/?fid=17825722713688273896

Changes:
- Fixes Audio related issues with Amazon Prime and Netflix
- Several compatibility changes for HW blobs
- Latest Lineage sources (not sure what new you will get as 12.1 is almost dead)


A big thanks to @diegocr and other folks who have worked hard on this project.

PS: As usual, not warranties, flash at your own risk. Some apps might require WebView impl. Install Android System from play store.
thanks guys it works stably, tested on amazon prime.
 

Sovik.Soni

Member
Dec 8, 2021
9
0
The patch is doing its work. The problem is with the Audio HAL. It always reports that DD and DD+ are available, even though the underlying sink (your device) does not support it. On my device, Prime Video always chose EAC3 (DD+) format and crashed as my device couldn't support that.

After analyzing blobs, I noticed that Fire OS passes some Dolby related params to Audio HAL during HDMI device setup, which are currently not sent by Lineage. Below is the build which should fix this issue. Along with that, it sets a few more flags required by Audio/Video decoders.

Download: https://androidfilehost.com/?fid=17825722713688273896

Changes:
- Fixes Audio related issues with Amazon Prime and Netflix
- Several compatibility changes for HW blobs
- Latest Lineage sources (not sure what new you will get as 12.1 is almost dead)


A big thanks to @diegocr and other folks who have worked hard on this project.

PS: As usual, not warranties, flash at your own risk. Some apps might require WebView impl. Install Android System from play store.
Great ! But Do this need a fresh installation or an update through TWRP recovery will be enough ?
 
Mar 10, 2014
37
16
21
Pune
The patch is doing its work. The problem is with the Audio HAL. It always reports that DD and DD+ are available, even though the underlying sink (your device) does not support it. On my device, Prime Video always chose EAC3 (DD+) format and crashed as my device couldn't support that.

After analyzing blobs, I noticed that Fire OS passes some Dolby related params to Audio HAL during HDMI device setup, which are currently not sent by Lineage. Below is the build which should fix this issue. Along with that, it sets a few more flags required by Audio/Video decoders.

Download: https://androidfilehost.com/?fid=17825722713688273896

Changes:
- Fixes Audio related issues with Amazon Prime and Netflix
- Several compatibility changes for HW blobs
- Latest Lineage sources (not sure what new you will get as 12.1 is almost dead)


A big thanks to @diegocr and other folks who have worked hard on this project.

PS: As usual, not warranties, flash at your own risk. Some apps might require WebView impl. Install Android System from play store.
Hi, Google login is not working in this build it has the NoTouchAuthDelegate forced stopped error.I tried applying the workaround from playfire also but it did'nt work
 

BOOTMGR

Senior Member
Aug 3, 2010
728
3,392
anoobdevsdiary.blogspot.in
Hi, Google login is not working in this build it has the NoTouchAuthDelegate forced stopped error.I tried applying the workaround from playfire also but it did'nt work
It seems since chromium 96.x Lollipop support has been dropped (or prebuilts are not available). My earlier build was referring latest webview impl which is not supported on Lollipop. Below build should fix that issue and no longer require downloading webview from Play Store:

Download: lineage-12.1-20220214-UNOFFICIAL-tank.zip

Changes:
- Fix broken webview by reverting to chromium 95.x
- Suppress unnecessary kernel logs

PS: You do not need to update to this build if previous one (here: https://forum.xda-developers.com/t/rom-unlocked-tank-lineageos-12-1.3961110/post-86294445) is working fine for you.
 
  • Like
Reactions: akela1979
It seems since chromium 96.x Lollipop support has been dropped (or prebuilts are not available). My earlier build was referring latest webview impl which is not supported on Lollipop. Below build should fix that issue and no longer require downloading webview from Play Store:

Download: lineage-12.1-20220214-UNOFFICIAL-tank.zip

Changes:
- Fix broken webview by reverting to chromium 95.x
- Suppress unnecessary kernel logs

PS: You do not need to update to this build if previous one (here: https://forum.xda-developers.com/t/rom-unlocked-tank-lineageos-12-1.3961110/post-86294445) is working fine for you.
Hey, I just entered this world today with surprisingly not so much pain, I have managed to install Lineage OS and Gapps.
Do you know how to make the device appear certified on Google Play Store?
EDIT: I have managed to fix that issue
 
Last edited:

illICITAF

New member
Mar 21, 2022
2
0
It seems since chromium 96.x Lollipop support has been dropped (or prebuilts are not available). My earlier build was referring latest webview impl which is not supported on Lollipop. Below build should fix that issue and no longer require downloading webview from Play Store:

Download: lineage-12.1-20220214-UNOFFICIAL-tank.zip

Changes:
- Fix broken webview by reverting to chromium 95.x
- Suppress unnecessary kernel logs

PS: You do not need to update to this build if previous one (here: https://forum.xda-developers.com/t/rom-unlocked-tank-lineageos-12-1.3961110/post-86294445) is working fine for you.
Hi I am trying lineage on tank for the first time, I flashed this build with gapps but I can't get it to pair remote no matter what, trid different build, tried 5-6 times after restarting, even changed batteries, I have this remote https://www.amazon.in/Voice-Remote-Amazon-Fire-Stick/dp/B01HBY5B38?tag=xdaforumin-21 which was working fine on fire os

Can you please help on how to proceed through setup or any solution
 

wwwkkk

Member
Mar 1, 2022
19
3
Hi, I've the same problem. The original remode was found, but pairing is impossible. Wrong passwords or something else is the error-code.
The Lineage build from 2020 worked fine with the same stick. i tested it several times !

Anybody help us to fix the error? Maybe a patch to flash?
Maybe a bug in the 2022 releases?
 

gothmogkris

New member
Mar 29, 2022
1
0
It seems since chromium 96.x Lollipop support has been dropped (or prebuilts are not available). My earlier build was referring latest webview impl which is not supported on Lollipop. Below build should fix that issue and no longer require downloading webview from Play Store:

Download: lineage-12.1-20220214-UNOFFICIAL-tank.zip

Changes:
- Fix broken webview by reverting to chromium 95.x
- Suppress unnecessary kernel logs

PS: You do not need to update to this build if previous one (here: https://forum.xda-developers.com/t/rom-unlocked-tank-lineageos-12-1.3961110/post-86294445) is working fine for you.

Firstly, thank you a lot for this patch! It basically solved all my problems with this OS.

I had installed the 20220120 version and had to install the Webview or Spotify wouldn't work.

Would you recommend installing the 20220214 version ? I can't download it as it is saying 'No mirrors found'.
 

Arci57

New member
Mar 29, 2022
1
0
Italy
I'm having trouble downloading the rom from androidfilehost. It says that there are no mirrors :(
 

Attachments

  • Screenshot_20220329_231248.png
    Screenshot_20220329_231248.png
    42.7 KB · Views: 15

BOOTMGR

Senior Member
Aug 3, 2010
728
3,392
anoobdevsdiary.blogspot.in
New build is up!

Download: lineage-12.1-20220403-UNOFFICIAL-tank.zip

Changes:
- Fix screen does not wake sometime after turning off TV
- Remove "/sdcard1" mount as we don't have external SD card (This may fix caching issues on some apps)
- Interim fix for incorrect system time on startup

#3 is purely a synchronisation issue in Lollipop codebase. It was fixed in later android versions. I have applied some changes to reduce chances & added some additional logs to debug exact point where race condition occur. Please share full logcat if it occurs to you. That would help in troubleshooting.

Next goal is to fix random freezes. I already have some hints where it occurs. Some SurfaceFlinger threads gets stuck probably due to deadlock. So problem could be at surfaceflinger, HWC or GPU driver. Randomness is making it hard to debug. But still I am analysing blobs to understand piece of puzzle we are missing 🤞If you know how this occur, let me know.

I saw few people having trouble connecting FTV remote. unfortunately I broke mine long ago, using CEC ever since. But I can have a look at it if someone can provide me logs (dmesg + logcat) at time of pairing.

MTK and AMZN drivers spam logs a lot. So, to store all information since device boot, please uncomment below properties in /system/build.prop. This will increase log buffer size so old logs can be retained till repro. (do not forget to take a reboot)
#persist.logd.size=4M #ro.logd.size=4M

PS: I do not get time to reply here often, but I'll be taking feedback from posts here.
 

JoshuaHasNoClue

New member
Apr 7, 2022
1
0
Germany
Awesome work on this project. Just one question: Is there a possibility for a newer version of Android to run on the FTV Stick 2? (I mean that in performance, it is most likely possible to work just dk how it would perform)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 34
    http%3A%2F%2Fi.picasion.com%2Fpic89%2F7652ffeccaa6bbdcda57289d991b093d.gif
    DISCLAIMER:
    We are not responsible for any damage, bootloop, bricked or broken devices and Relationships.
    Need an unlocked tank with amonet patched recovery
    https://forum.xda-developers.com/fire-tv/development/unlock-fire-tv-stick-2nd-gen-tank-t3907002
    This is an LineageOS 12.1 build for Amazon TV Stick (aka TANK).

    DON'T UPDATE MAGISK WITH THE APP. THIS WILL BRICK THE DEVICE AND YOU WILL NEED TO UNLOCK IT AGAIN!

    Issues:
    • Netflix won't play 5.1 audio videos on some TVs.
    • Can't pair bluetooth speakers.
    • On latest versions of Prime Video text is not show on some buttons.
    • Permissive kernel

    Installation:
    Connect device to pc with a USB cable, don't use tcp adb
    • Reboot tank to recovery
    • Adb push rom to /sdcard/
    • Wipe dalvik cache, cache, data and system if you come from stock or another rom.
      adb shell
      twrp wipe data
      twrp wipe cache
      twrp wipe dalvik
      twrp wipe system (if it gives error, try adding "/" /system)
    • Flash Rom:
      twrp install /sdcard/lineage-12.1-xxxxxxxx-UNOFFICIAL-tank.zip
    • Reboot and pair remote, if fails reboot and try again, complete setup wizard.
    • Reboot to recovery and install magisk, microG .........
    • Enjoy

    Quote:
    On first boot it will ask you for pair the TV Remote. For do that, press the home button 10 secs or more.
    If don't pair on first start reboot and pair again

    Quote:
    Since this ROM is optimized for TV Stick, this ROM uses LeanBack Launcher, LeanBack IME and TVSettings intsead of CM Launcher, AOSP Keyboard and CMSettings.

    Thanks:
    • @k4y0z for the bootloader unlock and recovery
    • @MSe1969 for the lineageos-12.1 sources
    • @ggow for the mt8127-common tree
    • LineageOS team

    Source Code:

    Download:
    Please don't mirror!

    XDA:DevDB Information
    [ROM] [unlocked] [tank] LineageOS 12.1, ROM for the Amazon Fire TV

    Contributors
    diegocr, Rortiz2
    ROM OS Version: 5.1.x Lollipop
    ROM Kernel: Linux 3.10.x
    Based On: LineageOS

    Version Information
    Status: Testing

    Created 2019-08-26
    Last Updated 2020-04-23
    12
    Changelog:

    20200927
    Update keylayouts (thanks 0815hoffi)
    Revert useFixedVolume

    20200806
    Update kernel to fos 5.2.7.3
    Add AppDrawer
    Remove CMFileManager
    Update keylayouts
    Add Android TV remote wifi support (tvstock gapps may broken it)
    Use amazon tank fingerprint
    Repo sync

    20200514
    Update kernel and vendor to fos 5.2.7.2
    Add microG support
    Repo sync

    20200422 REMOVED
    Updated Security Patches to April 2020
    Synced with the LineageOS Source Code
    Added missing keylayouts
    Removed browser shortcut in LeanBack

    2020221
    Add some keylayouts

    20191225
    Disable volume buttons

    20191220
    Use libMtkOmx libs from austin

    20191215
    Update kernel and vendor to 5.2.7.2
    Enable adb on boot
    Build btremoted

    20191211
    Update LeanbackLauncher and LeanbackIme
    Disable adb on boot (now need to enable on developer settings)
    Overlay, Update remote pairing instructions
    TvSettings, patch to autopair on fistboot settings

    20191210
    Remove dolby sound service (not working)
    system.prop: Enable USB OTG (Thanks Petoriano)
    LOS updates

    20191029
    Enable ozwpan kernel module

    20191014
    Build kernel from source
    Use Sharp an_np40 fingerprint

    20190911
    Fixed secure video playback. Thanks @julianwi

    20190901
    Rebuild device tree
    Add some blobs

    20190828
    Fix privacy guard issue, thanks @ggow
    Add Overscan app
    Disable Trebuchet
    Hide notification bar (set only on on firstboot)

    20190827
    Set screen timeout to 15 min on firstboot
    Change setup pairing bluetooth device screen text (english only)
    Small notification bar (1px)
    Don't build TeleService
    9
    How to get DRM Playback working

    I analyzed the binaries in the stock rom and found the missing patch to get secure video playback working. libstagefright needs to set an special gralloc usage flag. For the devs, here is the source patch for frameworks/av:
    Code:
    diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
    index cdeb161f7..130dc18c4 100644
    --- a/media/libstagefright/ACodec.cpp
    +++ b/media/libstagefright/ACodec.cpp
    @@ -784,6 +784,12 @@ status_t ACodec::configureOutputBuffersFromNativeWindow(
             usage |= GRALLOC_USAGE_PROTECTED;
         }
     
    +#define GRALLOC_USAGE_SECURE 0x01000000;
    +    if (mFlags & kFlagIsSecure) {
    +        usage |= GRALLOC_USAGE_SECURE;
    +        ALOGW("ACODEC: use GRALLOC_USAGE_SECURE\n");
    +    }
    +
         // Make sure to check whether either Stagefright or the video decoder
         // requested protected buffers.
         if (usage & GRALLOC_USAGE_PROTECTED) {
    I will attache a patched libstagefright version to the post. Copy it over /system/lib/libstagefright.so and it should work. I tested it with the official prime video app.
    7
    New Build is UP

    DATED 14-05-2020
    • DRM Fixed!
    • Added MicroG support (tested and works).
    • Updated kernel and vendor to latest fire os.
    Download link in OP.
    Enjoy:)
    7
    So I looked at it a little more. This OS is a nuisance! Apps I install do not show up on the launcher and no matter what I do, no Google anything! I have LineageOS on both of my Fire Tablets and it is nothing like this.

    I'm going to do some more tinkering and see what I can find.

    Please fix this as I'm probably going to go back to the old FireOS for the Fire Stick 2. I can try to flash GApps to that and somehow get it to work.

    Sorry? I think it goes without saying that. If someone read the first post there would be no such doubts. THIS ROM IS ADAPTED FOR ANDROID TV AND IS A BETA.
    If you don't like it, don't install it.
    It is very angry that we have worked hard on this ROM so that you come now and insult it. This doesn't make sense