yashsingh1/xdaforums huggingface dataset:
[Android Q&A, Help & Troubleshooting] bigwigs:
i can give u kernel dump. if u want :)
[Android Q&A, Help & Troubleshooting] vbhai:
Strange. What settings did you enable?
[Android Q&A, Help & Troubleshooting] vbhai:
The source?
[Android Q&A, Help & Troubleshooting] bigwigs:
nope, just from image. u would need ghidra tool or secret tools from @Renate
[Android Q&A, Help & Troubleshooting] bigwigs:
I enabled both below:-

-Use alternate audio policy

- Disable stereo support on VOIP.

rebooted.

disabled wifi calling.

i did mic test using https://apkpure.com/mic-test/lauresprojects.com.mictest/download

and mic is working :)
[Android Q&A, Help & Troubleshooting] vbhai:
Share away! Would be nice to take a look.
[Android Q&A, Help & Troubleshooting] vbhai:
But the mic is not working during calls?

Can you try making a WhatsApp call and check if the mic is working then? It's not working JUST during VoLTE calls? And you have VoLTE enabled, right? Check in status in settings. The status of the call should also say HD.
[Android Q&A, Help & Troubleshooting] bigwigs:
whatsapp also didn't work. VOLTE is enabled.
[Android Q&A, Help & Troubleshooting] vbhai:
Well, these are the settings I have enabled:

Qualcomm features:

1. Use alternate audio policy

2. Disable soundvolume effect

3. Disable stereo support on VoIP

Misc features:

1. Use system wide BT HAL

Everything is working fine on my phone.
[Android Q&A, Help & Troubleshooting] bigwigs:
no luck.

doesn't work on android14 asop image too
[Android Q&A, Help & Troubleshooting] vbhai:
Well, you can check the logs then. Logcat please. See what's going on there. Quite strange.
[Android Q&A, Help & Troubleshooting] bigwigs:
Below are some interesting lines in logcat:-

03-12 23:01:58.476 2164 5770 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_GAIN_DEP_STEP_TABLE, vol index 0

03-12 23:01:58.476 2164 5770 D android.hardware.audio.service: Failed to fetch the lookup information of the device 00000058

03-12 23:01:58.476 2164 5770 D ACDB-LOADER: Error: ACDB AudProc vol returned = -19

03-12 23:01:58.476 2164 5770 D ACDB-LOADER: ACDB -> AUDIO_SET_VOL_CAL cal type = 12

03-12 23:01:58.476 2164 5770 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_STREAM_TABLE_SIZE

03-12 23:01:58.476 2164 5770 D ACDB-LOADER: ACDB -> send_audstrmtable

03-12 23:01:58.476 2164 5770 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_INSTANCE_STREAM_TABLE

03-12 23:01:58.476 2164 5770 D ACDB-LOADER: ACDB -> audstrm_cal->cal_type.cal_data.cal_size = 20

03-12 23:01:58.476 2164 5770 D ACDB-LOADER: ACDB -> send_afe_topology

03-12 23:01:58.476 2164 5770 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AFE_TOPOLOGY_ID

03-12 23:01:58.476 2164 5770 D ACDB-LOADER: ACDB -> GET_AFE_TOPOLOGY_ID for adcd_id 88, Topology Id 112fb

03-12 23:01:58.476 2164 5770 D ACDB-LOADER: ACDB -> send_afe_cal

03-12 23:01:58.476 2164 5770 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AFE_INSTANCE_COMMON_TABLE_SIZE

03-12 23:01:58.476 2164 5770 D android.hardware.audio.service: Failed to fetch the lookup information of the device 00000058

03-12 23:01:58.476 2164 5770 D ACDB-LOADER: Error: ACDB_CMD_GET_AFE_INSTANCE_COMMON_TABLE_SIZE Returned = -19

03-12 23:01:58.476 2164 5770 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AFE_INSTANCE_COMMON_TABLE

03-12 23:01:58.476 2164 5770 D android.hardware.audio.service: Failed to fetch the lookup information of the device 00000058

03-12 23:01:58.476 2164 5770 D ACDB-LOADER: Error: ACDB AFE returned = -19
[Android Q&A, Help & Troubleshooting] bigwigs:
@dferreira @vbhai is there any way to reload Hisense a9 stock rom using edl or qfil ?

I tried using below instructions but it gets stuck in fastboot mode after rebooting:-

Download and install the following software, where applicable:

The Hisense A9 firmware, which you can find here.

QFIL 2.0.3.5

Qualcomm HS-USB QDLoader 9008 Driver

Reboot your computer.

Unzip the RAR files. This is achieved simply by clicking the first one and then the software will figure out the rest.

Open QFIL and select the following options:

Select Build Type - Flat Build

Programmer Path: Browse and select the prog_firehose_ddr_001360E1.elf file from the extracted firmware file.

Load XML: Select rawprogram0_001360E1 to rawprogram5_001360E1. You don't need to select rawprogram_unspare0. Select patch0 to patch5.

Storage Type: UFS (located on the bottom right side)

Put your phone into EDL mode.

You should now see your phone as an available port on QFIL. Click download.

Unfortunately, below recommendation doesn't work:-

If it succeeds and your phone starts boot looping into a screen which says "fastboot mode", follow Step 5 and 6 again. Pushing the firmware twice generally fixes the bootloop for some reason.

I tried changing active partition also using

fastboot set_active other

while stuck in fastboot mode but no luck. I don't think QFIL worked properly even though it said success.
[Android Q&A, Help & Troubleshooting] dferreira:
Yeah, will be full ROM because you can't install a system service via .apk. I'm keeping things clean, so the service runs on the OS layer, and then I can have a vendor .apk which brings the quick tile and reacting to button presses OOTB. Don't want to make the same mistake that Hisense did with bloating their service with app functionality...

We can modify LineageOS apps as well. If you are up for it, here's how to do this. On the root folder of lineage-20-build-gsi:

source build/envsetup.sh
lunch

#pick lineageos-arm64

make idegen
development/tools/idegen/idegen.sh

It will create a new file on the root folder called `android.ipr` and you can open that in Android Studio. Android Studio will ask what SDK to use and you pick Android SDK, not Java SDK!

You wait a bit while it loads all the classes and jar files etc from the source. Recommend at least 32GB of RAM for this!
[Android Q&A, Help & Troubleshooting] dferreira:
Hisense did not share kernel source. Hence the GSI image is the only way to update this phone.
[Android Q&A, Help & Troubleshooting] dferreira:
Only way I was able to restore my phone was using EDL. QFIL does not work for me - nor do I use Windows for that matter :D
[Android Q&A, Help & Troubleshooting] bigwigs:
got it working on fedora

using below script-

qdl --debug --storage ufs --finalize-provisioning --include . prog_firehose_ddr_001360E1.elf rawprogram0_001360E1.xml rawprogram1_001360E1.xml rawprogram2_001360E1.xml rawprogram3_001360E1.xml rawprogram4_001360E1.xml rawprogram5_001360E1.xml patch0.xml patch1.xml patch2.xml patch3.xml patch4.xml patch5.xml

Now , back to test if call works on this or not !
[Android Q&A, Help & Troubleshooting] bigwigs:
does ur rom needs IMS download similar to phusson setings? or it would work without them?
[Android Q&A, Help & Troubleshooting] Renate:
You may be just digging yourself a bigger hole.
[Android Q&A, Help & Troubleshooting] dferreira:
OK, I'm back and kicking. Had to use linux and Linaro's QDL to flash back the original ROM. From inside Hisense A9 ROM dump:

qdl --debug --storage ufs --finalize-provisioning --include . prog_firehose_ddr_001360E1.elf rawprogram0_001360E1.xml rawprogram1_001360E1.xml rawprogram2_001360E1.xml rawprogram3_001360E1.xml rawprogram4_001360E1.xml rawprogram5_001360E1.xml patch0.xml patch1.xml patch2.xml patch3.xml patch4.xml patch5.xml
[Android Q&A, Help & Troubleshooting] dferreira:
So reflecting on what happened, I realised that perhaps EDL I used before flashed the modified boot.img on the wrong sector, leaving the phone without a proper boot.img hence always going to fastboot. I'll take a look at A5 root kit. I think we need to create something similar, but with A9 patch and rawprogram files so that QDL knows where to place the boot.img on this device.
[Android Q&A, Help & Troubleshooting] Renate:
Why would you presume that?

You can do a check on the two backup boot images to see if they are the same.

Of course, since the actual image does not fill the partition you'd be comparing image+random.

In Windows you could use imgutil.exe /v /l boot.img.

(imgutil.exe in the sig.)
[Android Q&A, Help & Troubleshooting] dferreira:
I didn't use your EDL, but Kerler one and it seems to have some issues reading the partitions correctly. The backup does not match the factory dump boot.img, so that explains it 😅 So I won't be using that EDL but can use Linaro's QDL to flash a patch like A5 root kit did. That should allow me to write a modified boot.img with Magisk and we can boot from it. Will give it a go later tonight and post updates. I feel we're almost there.

I've added a copy of the factory ROM to google drive link I shared previously. That should allow folks to recover their devices in case they get into the same situation as me.
[Android Q&A, Help & Troubleshooting] Renate:
I pretty much doubt that.

Could you post your two boot image backups somewhere?
[Android Q&A, Help & Troubleshooting] dferreira:
https://drive.google.com/file/d/1xRNmLluS-hbGnsa4uL5EowQuq9Ws8ia-/view?usp=drive_link they are here. So I've been educating myself regarding Magisk. So I missed the step that we need to sign the boot patched image otherwise the image won't boot. I found how to do it, so I'm on it.
[Android Q&A, Help & Troubleshooting] Renate:
Thanks, those two boot images are identical.

If you wrote them back it should have worked out fine.

As they are original they don't need to be signed.

Usually (but I'm not sure) the Magisk init doesn't check any of the AVB stuff.
[Android Q&A, Help & Troubleshooting] dferreira:
can you check if the backup boot.img and the factory rom boot.img are the same?
[Android Q&A, Help & Troubleshooting] Renate:
You can. As I said, in Windows imgutil.exe or the the standard command fc /b file1 file2 | more

In Linux there are other things.
[Android Q&A, Help & Troubleshooting] Segnaro:
I think the boot.img is being flashed correctly. My guess is that when the system detects an invalid boot.img some flag is set somewhere else on the LUN4 partition that won't allow the phone to boot even if you restore the original boot.img.
[Android Q&A, Help & Troubleshooting] dferreira:
Update: OK, we need to wait a bit. Magisk folks are working on an update for Android 11+ devices regarding detecting vbmeta partition. vbmeta also needs to be signed so that we can use magisk signed boot.img on our device. Prior to Android 11, this was not the case.

You can see the discussion on GH: https://github.com/topjohnwu/Magisk/issues/7219
[Android Q&A, Help & Troubleshooting] Renate:
That's why I asked for the misc partition a dozen posts ago.
[Android Q&A, Help & Troubleshooting] dferreira:
Update: I created a signed boot.img and vbmeta without verity and same behavior after flashing using EDL: phone goes to fastboot. Something is preventing boot from a modified boot.img :-/
[Android Q&A, Help & Troubleshooting] dferreira:
Hum... maybe I also need to sign vbmeta img 🤔 restoring again factory dump to try a different route. Gonna see if we can get something from this: https://www.xda-developers.com/how-to-discover-hidden-fastboot-commands/
[Android Q&A, Help & Troubleshooting] dferreira:
Some more reading regarding AVB 2.0 which is on Android 11: https://android.googlesource.com/platform/external/avb/+/android11-release/README.md

We may be able to boot with an empty vbmeta. On the device, there is vbmeta_a, vbmeta_b and vbmeta_system_a, vbmeta_system_b... so not sure if we need to do something on the vbmeta_system ones.
[Android Q&A, Help & Troubleshooting] Renate:
No, that's for the system partition.
[Android Q&A, Help & Troubleshooting] kudiep:
I have stock rom. Is it useful for you?

this is boot.img and vbmeta

thanks
[Android Q&A, Help & Troubleshooting] dferreira:
Thanks 👍 I have a copy of factory ROM so I was able to restore my phone so I can keep poking it 😉 I made progress, at least now I see the launch screen but then it reboots with a Magisk enabled boot.img. I have a feeling I need to try an older version of Magisk, since this is Android 11.
[Android Q&A, Help & Troubleshooting] kudiep:
Bạn có thể chia sẻ nó cho mọi người được không?
[Android Q&A, Help & Troubleshooting] vbhai:
Lol
[Android Q&A, Help & Troubleshooting] bigwigs:
quick update.

reinstalled stock rom. updated to last hisense update.

still person on other end cannot hear me via mic.

but bluetooth calling works. so , now need to see what could be issue if mic test works ?
[Android Q&A, Help & Troubleshooting] Renate:
You can extract the kernel with my imgutil.exe and get the symbols with my kallsyms.exe

Those aren't particularly secret as they are freely downloadable from my sig.

From there, I use objdump and findref.exe, but you can use Ghidra.
[Android Q&A, Help & Troubleshooting] treff89:
Do you think it would be possible to undervolt with the kernel source as described by Renate?

I've never tried compiling a kernel myself, having profited from the work of others in the past, but would be happy to give it a crack if someone could give some broad instructions.
[Android Q&A, Help & Troubleshooting] vbhai:
So, your mic ain't working even on the stock ROM?
[Android Q&A, Help & Troubleshooting] bigwigs:
now everything is working. not sure what was the cause. after bluetooth call working, normal call also working now.

lessons learned- like do not code late in night, don't try to debug after long day.

i'm going to take a break till weekend and work with stock rom.

will install @dferreira 's gsi whenever available.
[Android Q&A, Help & Troubleshooting] Renate:
Most of all that stuff is defined in the DTB.
[Android Q&A, Help & Troubleshooting] vbhai:
That is good. Don't take time off right now! We need you to provide the kernel source!

I'll look into building Lineage for the phone later then.
[Android Q&A, Help & Troubleshooting] bigwigs:
I don’t have kernel source. I just did some steps that @Renate mentioned. I can give u what I have
[Android Q&A, Help & Troubleshooting] bigwigs:
wallpapers from stock image. if anyone wants to use in their lineage gsi rom
[Android Q&A, Help & Troubleshooting] bigwigs:
kernel dump with other files
[Android Q&A, Help & Troubleshooting] bigwigs:
@Renate - you should reach out to this guy for broken hisense a9, you were looking for -
[Android Q&A, Help & Troubleshooting] Renate:
That video should have a trauma warning! :p
[Android Q&A, Help & Troubleshooting] bigwigs:
payload from kernel file with c code & header file from ghidra. don't remember how i managed to export it.
[Android Q&A, Help & Troubleshooting] vbhai:
@dferreira Would you be able to create a repo with Hisense specific patches? So that when we are building @AndyYan's lineage for it, we can apply those patches as well? By default then we could have a few settings enabled out of the box for the Hisense and a few lines added in @phhusson's scripts which we added before regarding the surfaceflinger, etc.
[Android Q&A, Help & Troubleshooting] phhusson:
Please send those changes to TrebleDroid at least for discussion and so that we know what are your needs
[Android Q&A, Help & Troubleshooting] vbhai:
I see. The AliExpress seller confirmed this with Hisense support? This is a violation of GPL. Oh well. Annoying.
[Android Q&A, Help & Troubleshooting] bigwigs:
@vbhai @dferreira something like this needs to be created for Hisense a9 - https://github.com/TA1312/supernote-a5x

The person has done great job of clearing documenting various information and steps.
[Android Q&A, Help & Troubleshooting] bigwigs:
Ratta the manufacturer of Supernote device , have open sourced very old version of their kernel - https://github.com/Supernote-Ratta
[Android Q&A, Help & Troubleshooting] artelse:
I ended up copying the SMS database from the A5 to the A9 via the data path:

/data/data/com.android.providers.mms/databases/mmssms.db

Now to find out where the call log is hiding. No, it's not in:

/data/data/com.android.providers.telephony/
[Android Q&A, Help & Troubleshooting] bigwigs:
Are u using out of box phone app or Google phone app?
[Android Q&A, Help & Troubleshooting] artelse:
Hisense stock app. I read the contacts db is used for the call log, but cannot find a log in:

/data/data/com.android.providers.contacts/databases/
[Android Q&A, Help & Troubleshooting] doschxda:
hey, I am trying to create a n00b manual for anyone with an Hisense A9 and wants to liberate the phone by installing LineageOS.

Gonna dig through all the posts here now and gonna try to make a good step-by-step guide. If anyone wants to help/check; my working doc is this living pad: https://semestriel.framapad.org/p/j06od0jrv6-a6lu
[Android Q&A, Help & Troubleshooting] bigwigs:
thanks, for starting this. I was planning to do same on weekend with start from rooting device.

I would recommend waiting for sometime to stabilize e-ink part for most of the users though.

experimental users can play around for now with lineageOS
[Android Q&A, Help & Troubleshooting] doschxda:
ah, didn't know that was still an issue. Maybe we can use above mentioned pad as a place to keep track of the progress. And post it once that issue is fixed
[Android Q&A, Help & Troubleshooting] vbhai:
Don't think e-ink is an issue anymore. Works flawlessly on GSIs. All features are working pretty well.

It's good to go as a daily driver.
[Android Q&A, Help & Troubleshooting] Crwnn:
I'm stuck on Unlock and root your phone Step 6

After entering the commands the screen stays on fastboot mode and doesn't prompt to wipe all data. Did I do something wrong?

Help! please
[Android Q&A, Help & Troubleshooting] bigwigs:
good to hear that you are using as daily driver.

can u pls provide all the settings u have used so that I can take plunge and see how it goes for me?
[Android Q&A, Help & Troubleshooting] bigwigs:
have u tried restarting phone by typing fastboot reboot ? Also, see if you can restart phone using power button.

if both fail then u can try typing fastboot reboot fastboot and then select recovery mode .
[Android Q&A, Help & Troubleshooting] vbhai:
Yeah, sure. Make sure you use the Lineage 21 build I shared earlier- it adds the line which allows the HW overlay to be disabled on boot before unlocking. But the option still needs to be enabled in the treble settings.

In treble settings:

Misc Settings: Disable HW overlay: enabled

IMS Settings: Install the IMS APK and enable the remaining 2 settings

Qualcomm settings: Enable pretty much all the settings here regarding audio.

I don't remember if I added the overlay which enables auto brightness, etc in the GSI I shared. Make sure you put that in the folder as well.
[Android Q&A, Help & Troubleshooting] vbhai:
The overlay for hisense and the treble settings have actually been merged into @phhusson's repo. Let me confirm with @AndyYan if he can pull those changes in his lineage build repo.
[Android Q&A, Help & Troubleshooting] bigwigs:
@vbhai would any of apk mentioned in the above message help with solidifying eink functionality on lineageOS?
[Android Q&A, Help & Troubleshooting] Crwnn:
I was able to restart the phone and reboot into fastboot mode

in the terminal window pointing to the folder containing fastboot

when ./fastboot Hisense unlock is entered, is there supposed to be a confirmation or anything? because nothing happens. So I just continued to enter all of the commands but the phone stays in fastboot mode.

Do I type ./fastboot reboot fastboot in the terminal contain fastboot or adb?

when typed into adb it says waiting for devices

In fastboot it does nothing

Thanks bigwigs for replying! :)
[Android Q&A, Help & Troubleshooting] vbhai:
I believe not since we've not baked in that functionality into the OS. This is what @dferreira was referring to.
[Android Q&A, Help & Troubleshooting] bigwigs:
Ok fastboot commands are not doing anything then it seems u didn’t install fastboot drivers. Pls make sure u have done so. And then rerun commands.

Your first ./fastboot Hisense unlock should have had provided u confirmation.

So, install fastboot drivers and use custom fastboot @dferreira created.
[Android Q&A, Help & Troubleshooting] bigwigs:
Ok, I know we haven’t baked in that functionality, I was thinking maybe we can port this apk functionality if possible. We already have apk for eink button , we would need to port more functionality into it. Obviously, we would need appropriate drivers and the call.

Is it possible to use logcat to check events and driver calls being made by eink settings and other eink apps in stock rom and then see what can be ported? I willing to try this over weekend if it is worth the effort.
[Android Q&A, Help & Troubleshooting] harmtemolder:
This gives me:

unknown partition 'Roms/lineage-21.0-20240217-UNOFFICIAL-arm64_bgN.img'
fastboot: error: cannot determine image filename for 'Roms/lineage-21.0-20240217-UNOFFICIAL-arm64_bgN.img'

What am I doing wrong?
[Android Q&A, Help & Troubleshooting] Renate:
You didn't specify partition.

fastboot flash boot boot.img
[Android Q&A, Help & Troubleshooting] bigwigs:
It should fastboot flash system <>.img since it is gsi
[Android Q&A, Help & Troubleshooting] dferreira:
Think the color temperature would work with overlay values with the OS night light and enabling that for Hisense?
[Android Q&A, Help & Troubleshooting] Crwnn:
I think I have installed the fastboot drivers installed, however the first command is giving me

./fastboot Hisense unlock

fastboot: usage: unknown command Hisense

How do I use a custom fastboot?

Sorry, I've never done this before and the whole process seems a bit overwhelming.
[Android Q&A, Help & Troubleshooting] bigwigs:
You need to install custom fastboot that was created by @dferreira

Download it from here - https://drive.google.com/drive/mobi...0aDFiJvycEgWH?usp=sharing&sort=13&direction=a
[Android Q&A, Help & Troubleshooting] harmtemolder:
Thanks! I'm now playing around with the vanilla (i.e. non-Google Services or apps) version (`bvN`) from here
[Android Q&A, Help & Troubleshooting] bigwigs:
i played around with E-ink settings, E-ink button options under Settings and captured log.

Attached is just eink related services at first go in log.

if u are aware other services then let me know. i can try to find them in logs.
[Android Q&A, Help & Troubleshooting] bigwigs:
Started effort of documenting - hisense a9 related info on https://github.com/aimindseye/hisense-a9
[Android Q&A, Help & Troubleshooting] dferreira:
Spoke too soon. The service compiled and it runs, but then it doesn't have permissions to change anything on the system. I tried looking for documentation on SEPolicy but there is nothing online for Android 13 and all examples I find are for older versions of Android which refer to files nowhere to be found :rolleyes: I think we have no other choice than installing Magisk to root and work with a root-enabled app for changing the display speeds etc :-/
[Android Q&A, Help & Troubleshooting] biodbl:
I wanted to use it without root because some apps don't work with it. but it looks like it won't be possible.
[Android Q&A, Help & Troubleshooting] bigwigs:
Wiki update with general info, tools, a9 resources - https://github.com/aimindseye/hisense-a9/blob/main/README.md

Next update will be instructions on bootlocker unlock, root, debloat and gsi installs and flashing to stock rom.

This will help me to speed up experimentation with various gsi as currently all this info is spread in multiple posts
[Android Q&A, Help & Troubleshooting] dferreira:
I will try to get it working because I would also prefer no root.
[Android Q&A, Help & Troubleshooting] arihan9675:
Outstanding work everyone. Thank you for all your efforts.

Has anyone managed to port TWRP or a different recovery yet? I've been trying for 2 whole days but it's past my abilities...
[Android Q&A, Help & Troubleshooting] Renate:
I'm lazy. I usually just use a stock recovery and add rooted ADB.
[Android Q&A, Help & Troubleshooting] arihan9675:
I tried to get rooted adb myself and was not able to do that either.

All I want to do is to install a non-magisk version of Gapps (I have NikGapps) so that contacts syncing and other permissions will work correctly
[Android Q&A, Help & Troubleshooting] bigwigs:
were you getting any errors while trying to get rooted adb?

Check out - https://groups.google.com/g/bananahackers/c/jNrz5gquOwQ?pli=1