yashsingh1/xdaforums huggingface dataset:
[Google TV General] nshah2810:
Hello, I am trying to build dopinder from scratch since last week. I am able to flash lineage-19.1-20220908-unofficial-dopinder.zip release and that works but when I flash my own build it fails to boot.

Can someone help me debug the issue? I flash recovery, dtb, dtbo followed by adb sideload of the image.

The build log is from today, I think this might be the error.

Full logs attached below

Thanks,

Nirmit Shah
[Google TV General] nshah2810:
not able to attach the file

boot_log_dopindr - 18490a5e

bl2_stage_init 0x01 bl2_stage_init 0x81 hw id: 0x0000 - pwm id 0x01 bl2_stage_init 0xc1 - 18490a5e

controlc.com
[Google TV General] RiCkLaR:
What you "see" as a user may have changed, but Amlogic's code that interacts with the SoC stays the same and didn't change from Android 9/10/11 unless there was something completely f'kd up.

That HDR setting in the picture has incorrect label, {HDR_POLICY} for Amlogic refers to whether to get the HDR state from the media "SOURCE" or the connected "SINK" device in the code. That setting should instead have been labeled {HDR_MODE}.

HDR_POLICY = "0" || #0 = SINK (connected TV or AVR determines HDR mode)

HDR_POLICY = "1" || #1 = SOURCE (media file determines HDR mode)
[Google TV General] RiCkLaR:
This may help...

DROIDLOGIC "HdrManager"

String KEY_HDR_MODE = "persist.vendor.sys.hdr.state"

int

MODE_OFF = 0;

MODE_ON = 1;

MODE_AUTO = 2;
[Google TV General] :
How does AUTO (2) work? What's the effect of the source media and/or the edid of the sink while in auto mode?

Are there actually two distinct settings (HDR_POLICY and HDR_MODE), or only one setting that was mislabeled? If the former, should the HDR_POLICY setting not have any user control?

I'm slightly more confused now.
[Google TV General] tenfox:
Agree. And, apparently "2" is debug mode, which I have not yet tested.

hdr_mode changes do not appear to have an effect, as when set "0" (off) with or without sdr2hdr, HDR sources still output a HDR stream, but I have not tested this exhaustively.

hdr_policy = 1 is probably what we want for most use cases. CoreElec (media player distro) also chose it as their amlogic default.

Yes

It seems to have the most control over output selection, so it should be user controlable.
[Google TV General] RiCkLaR:
So it is my belief that the PROP:ro.vendor.sdr2hdr.enable=true originated in Amlogic's source-code because the JAVA coding for the SdrManager was originally written with only 2 variables OFF & AUTO, the ON variable was missing; and instead of just adding the coding for ON, they added it as a PROP to save time, which ironically forces it ON when it doesn't need to be ON, let alone forced_on by having the prop=true, which is what's happening by setting it as a "Read-Only" prop in the vendor.prop for sdr2hdr.

Of course, I may be wrong, maybe the system_root permission file doesn't even allow sdr2hdr to be set when the prop is coming via vendor init and not system init; just letting you know my thinking on the issue.
[Google TV General] :
If that hypothesis is true, how do some of the factory builds, like sabrina, manage to switch hdr on and off properly as needed?

I realize that this hdr issue has been a problem in various certified amlogic builds for years, but a few devices have fixed it. How was it fixed in those builds?
[Google TV General] RiCkLaR:
Do you have a SABRINA? Fortunately, I don't, but all other devices use Amlogic's DROIDLOGIC subsystem which gives control to things like HDR_POLICY. Sabrina may not need Droidlogic to make HDR function properly if all the Droidlogic TVsettings, like HDR_POLICY, were hardcoded or hooked into the stock com.android.TVsettings.apk .

You familiar with the TiVo Stream4K (S905Y2), it used {HDR_POLICY=1} as default when it was on Android 9, but when they pushed out the Android 10 Q update the default is now {HDR_POLICY=0}, which I hate; but all these settings "should" be End-User selectable via DROID_SETTINGS vendor app if the software engineer took the time to go through Amlogic code and doesn't just build the firmware as-is. And with the TiVo at least it gives access to some of the Droidlogic coding, but not all; with its HDR settings hardcoded into the TVsettings.

So, if I choose to watch HDR content on the TiVo, I have made an ACTIVITY shortcut with the tvQuickActions app to activate its HDR_POLICY setting overlay manually. The Activity that toggles HDR_POLICY inside the TiVo is found inside the package:com.droidlogic.tv.setttings as a DolbyVision setting.

ADB shell command to toggle the setting:

am start 'com.droidlogic.tv.settings/com.droidlogic.tv.settings.display.dolbyvision.DolbyVisionSettingActivity'

But, that same shell command used with a stock Amlogic device without the DolbyVision license, will give two options: Enable or Disable. You DO NOT want to enable it, possible Green screen of death for the Onn.4K if enabled, or at least that what I believe seeing as the Onn.4K didn't block access to DolbyVision setting activities last I checked in its stock original firmware releases.
[Google TV General] :
Thanks, that's very helpful. The interplay of dolbyvision with the hdr switching issue has been confusing to me. My optimum stream device (sdmc dv8555 s905x2 operator tier device w/dolbyvision) has done better with hdr switching than some of my sei devices like the tivo stream 4k. A recent review of a new sei804 based device also has hdr switching effected by whether or not the relevant app supported dolbyvision. The various chinese odm/oem (sei, sdmc, etc.) do all of the engineering a-to-z on these builds. It has repeatedly demonstrated to be quite sloppy.

You've obviously dove into this issue pretty deeply. I'm just trying to understand.
[Google TV General] nshah2810:
Not to spam but do we expect dopinder build from source to be stable? Can anyone assist me with it?
[Google TV General] npjohnson:
Make sure you bootloader is the latest stock one, and it will boot fine.
[Google TV General] nshah2810:
Hi, thanks for the reply. Yes it does boot if I manually flash the stock bootloader on top of my build. However it gives a different KeystoreService error, although the aidl is present.

here are the full logs. I even tried adding KeystoreService to DCM but the error is the same.

boot_log_fail - c652588d

board_late_init(): store dtb read 1000000 fail [KM]Error:f[keymanage_dts_parse]L317:not a - c652588d

controlc.com
[Google TV General] npjohnson:
Yup. It boots but secure keystore is broken.

Welcome to dopinder at the moment. That's why wade and Deadpool shipped but dopinder didn't.
[Google TV General] nosillock:
Hello, I have several dopinder devices still on 18.1 that I would like to update to 19.1. What is the process for updating 18.1 to 19.1? I only see instructions in the wiki for updating a build within the version.
[Google TV General] bigCrashdev:
Unbelievable, but that did the trick for me.

As it might be of interest for others (puzzling random replies together ;) ):

I am trying to flash to wade. The first steps (as described in lineage wiki) went without any problems, up to the point where I had to reboot into recovery (after flashing it via fastboot). This just gave me a black screen. So I booted normally which worked. However, from then on rebooting into bootloader did NOT work anymore. Also, rebooting into recovery did not work anymore (in both cases the brand's logo got "stuck" without adb or fastboot being able to communicate).

I then did @Jann F 's USB trick and bam. LineageOS recovery from where I could sideload the rom.
[Google TV General] nosillock:
I cannot believe this works, but it does!
[Google TV General] nosillock:
Nevermind. I ended up flashing the stock and then going through the standard process for 19.1.
[Google TV General] skippyd:
Since ODROID c4 and Banana Pi M5 both are capable of Linux and you are already building Kernels for these.... Do you think it would be easy to port Linux to Google ADT-3, Walmart Onn UHD Box, or Chromecast with Google TV???

With the Walmart Onn UHD Box being only $19.88 it would be very useful to be able to run Linux

It has been done with the Nexus 7 (full internal storage used for op sys)

https://wiki.ubuntu.com/Nexus7/Installation

or

https://xdaforums.com/t/linux-on-the-nexus-7-2012-wifi-rev-e1565-grouper-2022-edition.4323099/

here is a project that has ported other devices to Armbian

https://github.com/Calmact/amlogic-s9xxx-armbian

This version will probably boot but has issues for wifi: there is rtl8822cs driver in the kernel, but it's not completed - when realtek finish the driver (sdio part) it would work and bluetooth: there is a driver in the kernel, but it depends on the wifi part
[Google TV General] willclein:
Thanks I'll try this method. I'll also try a different cable since I know adb/fastboot can be temperamental with cables.
[Google TV General] willclein:
I can confirm that this fixed my issue. Thanks!
[Google TV General] npjohnson:
You have to wipe data to do so.
[Google TV General] npjohnson:
There is a known issue with official DTB images - we are working on it.
[Google TV General] ChriMo:
Weeks ago I had successfully unlocked a sheldon (Fire TV Stick Lite/3rd gen) from a store sale. I did buy additional ones because on old TVs this works great. But sheldon unlocking seems to become near impossible because new devices bought yesterday here have firmware which blocks unlocking so I'm now again looking for a new device where Lineage OS TV works.

The internal specs seem the same and also the microUSB connection:

- wade currently for 60€ .

- dopinder for ca. 60€ available incl. shipping from US, but probably long delivery time.

So the difference may only be the remote - the dopinder one seems to have more keys and a bit nicer.

However since wade is probably the best option I'm mainly interested about well working extensions to connect USB-Drives/Sticks (Y-cable) and Ethernet over USB.

Is there the risk of a great speed difference between various options to buy if USB 3 hardware is choosen, maybe because of limited wade support or other limitations?

Out of interest, might it be possible to connect a Fire TV remote with BT to wade (in addition to the stock one)?
[Google TV General] nshah2810:
Thanks, I guess I will wait for dopinder to be stable before building it again.
[Google TV General] activadroid:
quick test = I am able to watch DRM content on my dopinder running your 19.1 unofficial release, via Google Chrome (and Adblock Browser). I downloaded the Arm version Google Chrome apkm from apkmirror (& used apkm installer from them), with the extra libraries it mentioned. Also using HALauncher to launch Chrome. Seems to play OK (though NOT 1080P or 4K). As long as I view website through Chrome webpage & NOT use app (I was trying TubiTV). Chrome works OK with Bluetooth Mouse & Keyboard. Still need OEM remote though.

If you fix the secure keystore problem, will the resolution improve ?
[Google TV General] npjohnson:
yes, 1080P+ requires hardware backed keystone.

720P and below uses software, which ofc will work.
[Google TV General] activadroid:
Is the UNofficial build OK (fully functional) for Wade ? I am considering buying one to try until you are (hopefully) able to fix the dopinder DRM problem.
[Google TV General] npjohnson:
wade is 100% functional
[Google TV General] mldy:
I'm currently using the latest official wade build (2nd October) without google services. Sadly, the WiFi does not work. With Ethernet Plugged-In everything seems fine.

Is this a known Bug?
[Google TV General] npjohnson:
yes, DTB got mangled, we are trying to fix it.
[Google TV General] activadroid:
Unofficial wade works great on Dynalink ! Thank you NP Johnson !
[Google TV General] skippyd:
does anyone have the flash-tool ??

link is broken
[Google TV General] activadroid:
Thank you to all who have posted helpful crash recovery info here ! [edited - I first loaded Official on a wade & had problems ( messed it up so that Factory was actually still working, EXCEPT for WiFi !) Killed hours reading posted comments here & trying different things. It especially helped to see that picture of connections to TTY port on Dynalink. I made a USB converter cable for that & could see what the OS was doing ! ]
[Google TV General] activadroid:
Oops, I did leave out a detail: Sometimes I DO see response to fastboot devices: ???????????? fastboot - so that seems like something got erased ?
[Google TV General] activadroid:
edited - device is now working & my failure notes won't help anyone.
[Google TV General] RiCkLaR:
If you both know Linux, and will be installing the full factory stock .IMG, can I suggest using Khadas tools:

https://docs.khadas.com/products/sbc/vim4/install-os/install-os-into-emmc-via-usb-tool#tab__vim4

Use the instructions for VIM3 if installing the original Android 10 full firmware package.

Sidenote:

I don't know if it was a Khadas developer or some other Amlogic developer, but they said that if your device was having issues and needed to wipe/erase the EMMC, you could use the Windows tool (if your device will still connect that is) and start installing a firmware, and once it gets to 20-25% when the SYSTEM.IMG is installing you disconnect the cord and the EMMC will be erased. Never tried it personally, haven't need too, but worth a shot if you have a problematic device.
[Google TV General] criscodecookies:
Yes you can install Magisk directly to stock by just booting Lineage recovery from bootloader fastboot boot lineage-18.1-XXX-recovery-dopinder.img but you'll need a keyboard attached to select the option to flash with unverified signature.

I used an OTG Y cable and swapped between a USB A Male to Male cable (warning don't ever plug this in to a powered USB hub + PC directly) to issue the fastboot command and then a powered USB hub for keyboard + USB drive.
[Google TV General] Hig13:
Is there any way to enable wireless debugging on the dopinder? I really don't want to have to move it to my PC every time I want to sideload an APK.

Also, another quick question. I have a Chromecast Ultra that has the brick with an ethernet port. It works just fine with the Chromecast Ultra, but when I plugged it into the dopinder it doesn't detect that there's an Ethernet plugged into it. I forgot to check if it even worked with the stock image, so I wasn't sure if it was lineage or the device itself.

I couldn't find an answer to either of these questions within this thread so, hopefully I'm not being repetitive.
[Google TV General] albinoman887:
is there a way to boot directly to bootlader on wade with a button hold or something? i cant get my remote or any remote to pair after i flashed factory image and i think its cuz i did it in fastbootd not bootloader but now i cant get back and have no adb access...
[Google TV General] dirtcat:
Do I absolutely need a powered USB hub to do this? If so, can you guys help me figure out which USB hub to buy, please? Can I not just use the button on the side of the unit to select something from the menu and hold down the button to press "return"?

I want to try and load the default ROM onto my Onn UHD box from Walmart.

I have a pair of these micro-OTG splitter things. I have a MacBook that I can connect to the device and use ADB.

Can I do everything over ADB instead? Like send the data and use ADB commands like

./adb shell input text "what you want to type in"

./adb shell input keyevent 66

to issue commands like "up arrow" and "down arrow", etc?

Is this possible?
[Google TV General] Hig13:
Check out this post, it got me up and running with lineage without a OTG Y cable.

You can probably use a similar method to get magisk going

I meant to link to this https://xdaforums.com/t/unofficial-...-g12-sm1-family-devices.4313743/post-85434073
[Google TV General] dirtcat:
Did you mean to link to something? Or are you referring to this thread that we're both on right now?

Because I've been following this thread for many days now. Here's a description of my success in getting LineageOS running properly. But now I want to go back to stock and just get Magisk running instead.
[Google TV General] npjohnson:
Dyanlink's remote isn't 2.4ghz - it's IR. the box has a receiver in it. Check dmesg for info. That's why it works in recovery so easily.

It can be a little finniky.

yeah that works fine.

you can do it the old fassioned way via adb with adb root.

normally I'd say fastbootd in recovery, but if you flashed stock recovery no fastbootd. That sucks. I would say your best bet is to get UART hooked up on the board itself (it's all marked on the board), and then interrupt u-boot and run `fastboot`, should drop you to bootloader mode.

yeah you can https://stackoverflow.com/questions/7789826/adb-shell-input-events

Easy, flash factory image, then boot lineageos recovery and flash magisk. Done.
[Google TV General] deega:
1. Once you've flashed the factory image, keep the zip and extract the boot.img file. Put this boot.img in your internal storage with adb or whatever.

2. Install magisk and select install magisk from the main screen.

3. Tell it to patch an image and select thr boot.img that you saved in step 1.

4. Copy that patched image to your computer and then reboot to fastboot.

5. fastboot flash boot magisk.patched.boot.img

fastboot reboot

Nothing but a USB connection between the device and computer is needed for this. No why?-cable and no external power. Use a higher current port; a blue or yellow one usually.

It'll probably take a little longer to boot this first time with a single unannounced reboot. That's just magisk asserting dominance.

I have mine on stock + magisk and it's pretty great being able to make changes to the system. And Netflix works fine.

I haven't managed to pass safetynet, but that hasn't impeded me.
[Google TV General] dirtcat:
Do you think you could help me flash the factory image, please? I don't know how to do this.

I don't have a powered USB hub or anything like that. I'm just trying to get this done by issuing commands from the command line of my MacBook Pro.

I've done this:

./adb reboot bootloader

./fastboot boot lineage-18.1-20210811-recovery-dopinder.img

./adb reboot sideload

./adb sideload stockimg.zip

Here I get the notice that the signature verification failed ... Install anyway? No/Yes

I cannot select "Yes" and I cannot press enter.

On my terminal, it's stuck at:

serving: 'stockimg.zip' (~0%)

If I open up another terminal and try to issue commands, I get this:

./adb shell input keyevent 20

error: closed

If I press the button on the actual device it will not do anything.

Is there another way to do this with just a direct connection to the device from my laptop's USB port (which is also powering the device)?
[Google TV General] hp420:
I can't get my dopinder to connect via adb for the life of me!! i can plug in any other of a handful of devices and adb works fine, just not this one. is there something i'm missing? all i have to do is connect a micro usb from my linux machine to the power port on the android tv box right? and it should be able to read abd just like any other android device???

i do have an otg y splitter attached because i'll need the keyboard, but that shouldn't matter right? do i need a separate usb hub for power or something? the white power light on dopinder is on and i can use the remote, etc set up like it is 🤷
[Google TV General] tokoam:
On my Onn 4k Very confused I tried to follow the steps listed in the guide for dopinder . When enabling and via ADB on my computer I had no way to accept the dialogue box . So I had to hook it back up to my TV to do so . Manage to flash recovery and boot to it . But now I’m lost as to how to side load the rom file . I’m at this screen I have a OTG mouse and Kb with usb hub but unable to look for the rom file to side load it . When I select ADB debugging to side load I can’t type anything . I need help with this .
[Google TV General] Hig13:
To me, it looks like you're in the stock recovery and not the lineage recovery, that could be part of your problem.
[Google TV General] Hig13:
Thank you for answering my first question, I'll look into what the old fashioned way of enabling wireless debugging is lol. What about the other question I had? Am I to assume I just need to get a micro usb hub with eth such as the one they made for the raspberry pi?
[Google TV General] dirtcat:
Maybe you would benefit from this description of my experience?
[Google TV General] npjohnson:
should work, works on my fugu.
[Google TV General] hp420:
thanks, but the keyboard is not the issue. the android tv box will not enter adb mode for me. i tried on a windows desktop pc and it works fine, but i had no hdmi with me so i couldn't navigate through recovery.

i'm far from a noob to this...it just doesn't seem to like adb on my razz pi for some reason 🤷
[Google TV General] deega:
I haven't flashed this device, but I found the image at this lineage build's site.

I assume you download, unzip, and run a shell script that flashes the contents via fastboot.

But you patch the kernel. That's boot.img

That's all you need. No custom recovery. No y adapter. No external keyboard.

I didn't use recovery at all, stock or otherwise. I didn't even have a display connected except to enable adb.

Pressing the ok button on the remote approves your debugging credentials. No display needed.

adb and fastboot are all that's necessary.
[Google TV General] Hig13:
I've run into the same issue when trying to flash back to stock. The remote on the dopinder doesn't work in recovery so it seems you have to have a keyboard hooked up to it.
[Google TV General] albinoman887:
I just bought another one :P so what did i do wrong with flashing the stock image back? i got it from the link in the FAQ, then i opened the flash-all.sh script and commented out the bootloader.img so it wasnt relocked and ran the script in fastbootd. i noticed it errored out trying to flash dtb but i figured it was a non issue should i have done it in bootloader instead? or did i need to flash the bootloader as well?
[Google TV General] npjohnson:
Flashing bootloader. IMG does not relock the device in the slightest.

You definitely should have flashed that, but that probably wasn't your issue. Fastbootd can't flash DTB partition, so you need to have used bootloader mode. I will note it in the OP.

You were trying to use a custom DTB with stock
[Google TV General] skippyd:
I just came back from a full brick (Black Screen - No Boot Logo on power up) on the Walmart Onn 4k (dopinder)..... so if you do mess anything up, you are able to bring factory back to the device without opening it. I will create a tool so it will automate the process within the next couple of days. I should be able to make it work with the other devices, but I don't have them to test with.

TOOL IS CREATED waiting on it to upload its big because it has all 4 devices factory images so it will unbrick all 4 devices. Link up soon
[Google TV General] :
Unlike the khadas devices, certified devices have been factory provisioned with high level drm keys that are unique to each individual device. Erasing the emmc in its entirety would blow away individualized data (based on those keys) contained in the tee and factory partitions and other hidden areas of the emmc. Even just erasing the bootloader can brick a device.

Erasing the data partition is often useful in restoring operation to a certified device, but erasing the entire emmc would not be useful.

Generally it is also a bad idea to use the windows gui usb burning tool on any certified device unless a single file amlogic image designed specifically for that device is used. Generally, when using burn mode with certified devices, only individual partitions should be flashed using the command line burn mode tool 'update'.
[Google TV General] skippyd:
also.... so others know twrp is very close https://github.com/Amlogic-Devlopment-PureFusion/android_device_askey_sti6140d360_TWRP-AOSP
[Google TV General] :
The files that were contained in the broken openlinux2 link are attached to this post in the file amlogic.zip. It just contains the windows version of the command line update utility and the associated dlls.

But the openlinux2 link was posted quite awhile ago. Newer versions are available from khadas and elsewhere.