yashsingh1/xdaforums huggingface dataset:
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
Today I did spent a lot of time on this. After a lot of dt hacks/test I'm unable to resolve this problem for now. So I had another idea and started to port kexec hardboot for our device. I'm at the point where is successfully load kernel and DT (something is different for our device, the msm_id struct, which I solved) and reboot but will hang or restart just after a few seconds of the reboot. I think I'm almost there but I may have some problem to find correct memory addresses which are not overwritten by the boot loader. Let me know if you want to take a look I'll upload patches. But well even if we succeed we may still encounter the same DT problem.

In the "dt.img" there is 3 dtb files in, which are scanned by the bootloader for the correct hw revision. I did find that our device use the "thor-v2-apq.dts/.dtb" dt file for booting (not the thor-v1 nor v2) which correspond to our hardware revision. This is in correlation to the 4.1 kernel which only compile this dtb.

When loading the 4.1 dt image with kexec I was able to debug and see that while the header of each dtb parts have changed, there's still the correct hw revision included (of course!?). This one is correctly loaded by kexec and so probably by the bootloader (but in the new dt.img we still need to modify the img header for our bootloader to find it). By the way, I wonder how this final dt.img is built !?

I just don't know yet what is the thor.dtsi file in the 4.1 kernel, the one missing the fb_mem def. This is not included in the dt.img so should it be modified to match our old thor-v2-apq.dts instead the new one ?

By the way manual compilation (and decompilation!) does work with the dtc utility (apt-get install device-tree-compiler).
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
Yes, upload the the patches for kexec. Definitely interested in taking a look. I have configured a kernel last night with kexec config enabled (great minds think alike)

This DT problem is troubling me. Perhaps not everything is included in this kernel for Apollo or Thor to boot.

I received a reply from amazon, they said they will post the missing source for the last 3 updates very soon (no idea of time frame).
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
I don't think the sources are the problem as we have it on stock 4.1 boot.img. I'll upload the patches tomorrow with a little briefing.
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
[MENTION=5749760]ggow[/MENTION] : 4.1.1 kernel booted :) :) :) (not from sources. As you noted this sources may be incomplete).

I'll post the kernel this night, with a clean 4.1.1 system if i have the time.
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
Good News, well done :)
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
Finally, sorry for the delay :) So here is the modded 4.1.1 boot image. In short : binary extract correct dts from 4.1.1 stock dt image and happend it to 4.1.1 stock zImage.

Didn't had the time to finish my gapps rom based on 4.1.1 but should not be too long :)

http://android.mydedibox.fr/hdx/boot-4.1.1.img
[Kindle Fire HDX 7" & 8.9" Android Development] cdub50:
Good work looking forward to testing it out.
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
This is a wip for you. You need to wait for a root exploit on 4.1.1 for using it !
[Kindle Fire HDX 7" & 8.9" Android Development] cdub50:
Ah gotcha. Hopefully that will be sooner than later.
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
Thanks for that :)

Which number dts is the correct one (there are 3). I need to do the same for Apollo...
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
From what i remember this is the third (which is thor-v2-apq.dtb)
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
Well, cm is still a ***** to get ported :/, tree days on it without success.

Else the new odex framework is not deodexable by baksmali. If you ever have a solution let me know (You may not need that but I'm in a dead end).
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
So [MENTION=5749760]ggow[/MENTION], did you made some progress on resurecting your device ?

In the meantime i did get msm aosp up and running ! (but no wifi, qcmediaplayer not found for no apparernt reason which prevent some audio to work, slow ui transitions and probably more stuff to fix).
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
So far no...

What I think could have happenned is the synaptic dsx firmware and configuration has been updated or corrupted by the new kernel.

I am in the process trying to figure out exactly what I need to do to fix it. I have found a utility which can be used to force an update to an older version of synaptic firmware.

I might have to write a utility to extract the firmware and configuration area from a working device.

Will let you know what I find.
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
Yep i was just going to talk you about this. I'm trying to fix wifi on the aosp build and discovered this lines in dmesg :
[Kindle Fire HDX 7" & 8.9" Android Development] Mr.Nik:
Thank you for your work! I hope your problem will spill over into different firmware for our device. With the support of LTE I hope.
[Kindle Fire HDX 7" & 8.9" Android Development] kindle2021:
来自内核源的 Synaptics.3.B.apollo.img 找不到这个文件
[Kindle Fire HDX 7" & 8.9" Android Development] kindle2021:
Synaptics.3.B.apollo.img这个文件找不到！求助
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
I'll have some time later to work on this. I found the synaptic image files but wasn't sure how to confirm which file I needed to flash... So will be looking into that first.
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
Relief - Device Restored

Hi [MENTION=503571]Cpasjuste[/MENTION],

I have fixed it :)

Requirements:

1. synaptics_fw_updater

2. Synaptics.3.B.apollo.img from the kernel source

3. Reboot into recovery (twrp)

Method: (This works using linux)

1. Push synaptics_fw_updater to /data

adb push synaptics_fw_updater /data

2. Push firmware to /data

adb push Synaptics.3.B.apollo.img /data

3. Change permissions of synaptics_fw_updater

adb shell
cd /data
chmod 777 synaptics_fw_updater

4. Flash the firmware

./synaptics_fw_updater -v -f -b Synaptics.3.B.apollo.img

5. Reboot and voila touchscreen should be good.
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
MSM AOSP Android / Linux

Good work getting that running :)

Is that running on a modified .4.1.1 kernel?

I also managed to build TWRP 2.8.1.0 for apollo.
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
Haha "we" rocks :)

Yes its running with stock kernel (which was a pain). But well the WiFi makes me crazy. I can see the akh module is correctly loaded, but I think there is a problem with the p2p config. I think I may have a problem in my core config.xml about WiFi configuration. Could you provide yours ? This could help :)
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
I have been trying to solve this too, I rebuilt 13.3.2.4 from source but couldn't get it to load the ath6kl module. However it works loading via 13.3.1.0 built from source. Something has changed since 13.3.1.0.
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
Can you get on Google Hangouts?
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
Yes and it's a good idea but tomorrow as its done for me today ( ~4h on WiFi :x ).

Else are you in EU ? (timezone) I'm French by the way :)

Edit: UK, that's cool :)
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
tomorrow may be difficult, with work then in the evening got to finish a bit of re-decorating.

Tuesday sometime after work will be good if you're available.

I've also started a github page. Not much on it at the moment though.

https://github.com/ggow
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
There is some new updates/sources on Amazon. But well, they are still playing with us as the hdx 7/8 sources are just some other crap ...
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
Yeah I saw that, I absolutely give up on amazon for source code. Their source code notice releases are a pile of crap because if and whenever they do provide kernel source it never builds cleanly.
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
[MENTION=503571]Cpasjuste[/MENTION],

I have the kernel booting ok now. Must have been a freak accident that the touchscreen got corrupted before.

Did you ever try and boot a clean version of 4.1.1 stock system?

If so did you get it working?
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
Yes it work fine (of course i disabled some services to prevent ota). But to get playstore working I have to use my old hdxposed module as I can't deodex the new ROM :'(
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
Oh cool that's good to know. I tried putting together a stock rom from the .4.1.1 but it wouldn't even show the boot animation so there must be something wrong with what I have done.

Could they have changed the header format for the odex file?
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
I wanted to be sure to be on the correct msm branch, so i added the amazon kernel to the msm build. I was able to find that i'm not using the exact same kernel sources as my current msm branch, and i'v made a script to find changes in msm releases :

#!/bin/bash

API=04.04.02
CHIPSET=msm8974
MASTER="LNX.LA.3.5.1.5-01700-8x74.0"

while read line
do
if [[ $line == *$API* ]] && [[ $line == *$CHIPSET* ]]
then
branch=`echo $line | awk '{print $4}'`;
found=`git diff $MASTER $branch | grep $1`;
if [ -n "$found" ]; then
printf "$branch: $found\n\n";
fi
fi
done <msm.releases

Copy the table from "https://www.codeaurora.org/xwiki/bin/QAEP/release" to a file named "msm.releases", then execute "./findchanges.sh msm_fb_panel_info" in the wanted directory.

This way i was able to easly find where the "msm_fb_panel_info" change happened since it's not on our device, and other minor changes.

So i'm now close to the msm branch used for our hdx, but there's still something really strange. Our "msm_mdp.h" header does contain the "mdp_display_commit" structure, but the same structure is not found in any other msm branches ... ( we have "l_roi" and "r_roi", while all other past commit only have a "roi" definition).

So it's total crap :)
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
Since my msm hwcomposer is working with the hdx kernel I think we can say this is not the correct kernel sources (or there is some other/custom commits).
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
I made some progress on CM11, i now have working compositor/rendering. But now there is a problem with audio preventing it from booting :/
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
Did logcat show anything of interest for the audio issue?
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
Unfortunately no :/ I fixed audio hw modules loading, I can see the sound card correctly opened then it just loop on "interface controller : dlopen failed for libnetcmdiface.so" which is not a problem in fact ..
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
yeah the libnetcmdiface.so is hardly ever included in any rom release.

So is it booting now?
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
YESSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS ! But there is a BUT : i just get a crappy screen asking for "the password to decrypt the storage" ... no idea how it's possible, maybe a wrong fstab ? Something to do with the keystore or some crappy amazon stuff left ? ...
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
Unfortunately I haven't seen that one before.
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
[MENTION=5749760]ggow[/MENTION] (no sound, no wifi) :

:):):):):):):):):):):):)

---------- Post added at 03:57 PM ---------- Previous post was at 03:52 PM ----------

Sound fixed (at least for sounds and musics, didnt tried hw decoders).
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
Wifi fixed huhuhu ! :)
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
Excellent stuff :)
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
For the update, again good news. I think i have fixed all the hardware, all is working great now (3D, sound, wifi, bt, hw decoding (at least with mplayer), auto brightness etc..) ! There's just a minor "screen teering" when rotating the screen for example, but this is not present when there is no rotations it seems. This is something i'll probably fix :)

I only used the device for a few hours so we will probably find other bugs but for now it rocks ! I'll try to upload you a zip tomorow, or this week. My github is partially updated but it will be updated very soon for sure (probably tomorow). For your interest i use msm caf sources for media, display and audio (which are already on github).

This was a hard work for sure, but (as you know) it's a great reward ! Now we need to wait for a root exploit so everybody can enjoy :)
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
This is really fantastic work and definitely very rewarding. Well done and can't wait to try it out :)

Also have a question, my kernel seems to boot - but there is no output on the screen - did you experience this?

Which tools did you use to unpack/repack the boot.img?

My method so far:

1. Extract zImage

2. Extract 3rd dtb entry

3. Append extracted dtb entry to zImage

I'm missing something somewhere....
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
No that's it. I use mkbootimg_tools (github) to extract the 4.1.1 DT.IMG. From there you extract third DTS (or maybe it was the second?!) from dt.img and happend it to zimage (cat zimage extracted.dtb > zImage.dtb). Finally use abootimg to repack (so it doesn't include dt.img) boot image.

Did you try my boot imgage with your ROM ?

(Edit: it should be written "sent with my cm11 hdx" at the bottom :p)
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
That's pretty much what I have done with the kernel.

When I try your boot.img on my device it results in the corrupted touchscreen. - I just tried it again but with the same results.

I'll take a look again tomorrow.

Enjoy the cm11 hdx :)

ps. check to see whether the latest kindle reader app works on it...
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
That's strange. You have a WiFi only Thor like me ?

Him ..

Edit : the "kindle" amazon app on the market require an account .. You'll try it yourself tomorrow :)
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
My device is the Apollo 8.9".
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
Ho ok, that's it. You may not correctly extract the dtb. You see some whites spaces before the "Amazon" stuff of each dtb in the string view. But in the hex view you can see it really start a few bytes before. Be sure to cut from here.
[Kindle Fire HDX 7" & 8.9" Android Development] cdub50:


So do both of you guys have an unlocked boot loader? How are you guys flashing the Roms to test? Also can't root be built into the ROM so you don't need to flash a root zip. Man wish the damn boot loader could be unlocked. Picked up a nexus 6 so nice to be able to unlock your boot loader.
[Kindle Fire HDX 7" & 8.9" Android Development] icedtrip:
The HDX bootloader was unlocked, but never released. A few people here got the unlock to verify that it worked. This is now allowing this kind ROM development, but the bootloader unlock opens up legal issues with anyone that would publicly release it for now.
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
My boot.img seems to startup ok. From logcat I can see that flashable zip of stock 4.1.1 is booting albeit with lots of errors (mainly permissions). The display driver is picking up the correct resolution for the display and the correct adreno attributes and tags are been found.

There could be something wrong with the flashable zip that I created, but a bit lost as to what that could be. I'm not seeing the boot animation and there are errors like:

W/asset ( 952): Asset path /system/framework/amazon-notes-res.apk is neither a directory nor file (type=1).
E/asset ( 952): Failed to add Amazon Resource: framework/amazon-notes-res.apk

and also lots of permission errors with PackageManager

Attached is a copy of the cleaned up updater-script that I am using.

At the end of the kernel boot log could be the reason why the bootanimation is not showing.
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
The amazon res apk errors are "normal". You should not have any problem's it's strange. I just took the bin, renamed to zip and removed all but system flash in the updater script. If you did that then I guess the problem is not from the ROM. I'll take a look at your logs today. BTW I said you'll test cm today but indeed you need to fix this before !
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
Also based on the offset and size values in dt.img header, attached is dtb entry #2.

And by all means post the new ROM, it will take me a while to download it on my connection anyway :)
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
At least you are correctly extracting dtb's from what i see.

Edit : of course you are 100% sure you are using the correct/same kernel/system combo ? As we can see in your dmesg it seems there is a problem with msm fence, but that's stange.

Note : I may have in the paste flashed the "NON-HLOS.bin" (or something like that) blob from latest 13.3.x release when it came out, but then (i think) reverted to my stock NONHL-OS.BIN (with dd). I think this is dangerous, but at first you can look at the "/persist" partition (which is if i recall the NONHL-OS.BIN mount) to see if there is something related to nv blobs.

Edit2: i have te worst problem ever on CM11 for me : headphone jack is not outputing , but i use them a lot :'(
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
For the headphone jack problem, the only way I could get that to work was to use the stock rom libaudioflinger.so
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
I'm 100% sure I'm on pure 14.4.1.1 kernel/system combo.

Which NON-HLOS.bin have you got installed, is it the version from .4.1.1?

Attached is a recursive list of what I have in the /persist mount... What should I be looking for with regard to the nv blobs?
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
I did fix jack by just adding a specific config.XML item to overlay, I'll post it later :) Else I'll take a look for your stuff.
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
This is the setting for correctly switch output without using hdx libs !

Else i did look again at our persist partition, i don't think there's something related to our problem :/
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
Ah yes, I tried this for the hdx nexus ROM and it didn't work for me. But great its working in cm :)
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
I couldn't make a working flashable zip today, our recovery kernel is missing something for the new setmetadata function. I'll fix this tomorrow and upload.
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
[MENTION=503571]Cpasjuste[/MENTION]

I have had no success in resolving the problems booting 14.4.1.1 on my device.

- I use mkboot to extract boot.img

- Extract 2nd dtb (I confirmed from your boot.img that this is the one you used)

- Append the extracted dtb to zImage using cat cmd

- Use abootimg to put the new boot image together

It's a simple process. There has to be something on my device preventing it from coming up.

Since originally been on 14.3.1.0 I have never modified any partitions except /recovery, /boot and /system.

Do you have any ideas as to what I may be missing?
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
I guess they must have used a different kernel configuration on appolo ?! which prevent the DT to be correctly parsed. Did you ever try a Thor kernel in the past on your appolo device and did it worked ?
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
Never tried a thor kernel, I'll give it a go.

I wish we had a bonafide kernel source package for .4.1.1.
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
Never tried a thor kernel, I'll give it a go.

I did try your .4.1.1 boot image and that didn't work...

I wish we had a bonafide kernel source package for .4.1.1.
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
You should try 4.5.1 if not already done, who knows !
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
I tried that too, with the same results.
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
At least you can search for a root exploit (or use the device as a server) :p

Else it could be something to do with the synaptic fw or lcd firmware ?! If you are really desperate you should try to flash the nonhl-os.bin (after backing up stock one). I *think* it is safe (take this with caution).
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
To flash the nonhl-os.bin from .4.1.1 what would the command be?
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
first identify non-hl.os device (i think its the persist partition, or better look in updater-script i think the device it is flashed is there)

backup :

dd if=/dev/block/"non-hl device" of=/sdcard/backup.bin

flash new :

dd if=/sdcard/4.1.1-nonhlos.bin of=/dev/block/"non-hl device"
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
From the updater script:

I extracted the contents of NON-HLOS.bin and it contains elf firmware images for various things including the modem.

I'll give a go :eek:
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
I flashed it via fastboot and HDX Nexus ROM (13.3.2.4) came up ok.

I thought at least if I could flash it via fastboot then there would be a way to recover if it all went wrong.

I'll try the .4.1.1 kernel again
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
Yep. Crossing fingers.
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
It didn't work, same results.
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
[MENTION=503571]Cpasjuste[/MENTION]

I just tried the appended dtb on 14.3.2.4 and it works. So at least that proves there was nothing wrong with my process.

It seems as you mentioned earlier that appended dtbs are not supported on 14.4.1.1 kernel image.
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
You may try to get 4.5.1 kernel sources to work (which may be a pain but well).
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
Here is the thor flashable zip : http://android.mydedibox.fr/hdx/cm-11-20141127-UNOFFICIAL-thor.zip

Unfortunately it won't work on your apollo device but if it can be usefull. For everyone else you must wait for a root exploit.
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
Thank you :)

I'm sure it will be useful. Gutted about this dtb stuff not working. But there are still some options.
[Kindle Fire HDX 7" & 8.9" Android Development] Cpasjuste:
By the way, you of course tried the three dtb ?

---------- Post added at 04:13 PM ---------- Previous post was at 04:07 PM ----------

You can add me on hangout : cpasjuste
[Kindle Fire HDX 7" & 8.9" Android Development] ggow:
Yes, tried all three dtb entries.