Livecasting porting notes for Zenfone 8

Yes, it worked. Now I’m playing a bit around with Android 11 but … what the heck … since my last Android experience (Lineage on Fairphone 2) there has changed some stuff. Not in a good way. Strange gestures. Annoying notifications which can’t be muted or dismissed. It turns totally crazy when you disable Play Services. The pull-down menu is absolutely messy.
Now I understand why screens become bigger and bigger - you need that much space to see the interesting things between all the unnecessary stuff :sweat_smile:

2 Likes

@nasi @multispeedlurker Thanks for joining the discussion! I hope the unlocking services become available soon™️!
Can you folks and/or @pansen-jim comment on the standby power drain with and without wifi? Like percentage/hours, and which Android version you used. I might need to start looking for “other wifi drivers” if that is even possible, the current one makes the device last only a day if wifi is on… Thanks!

Thanks. I asked the customer support via their contact form. I’ll report back.

I’m not at home atm, but I can start checking on Monday. In principle, I don’t really want to use it with Android :smiley: But checking standby-time is something which I will be able to endure.

Thanks for your efforts, if I can manage to unlock, it will surely be a nice device!

1 Like

Of course measure this at your own pace. Just as I am updating here.
I should also study how to install without needing twrp, but ping me if you need to install sooner than I do that, there are some instructions on Sailfish on Zenfone 8 · GitHub but they probably need more love.
Thanks!

1 Like

Do you have an idea how to prevent auto-upgrading? As soon as I switch on wifi, this stupid Android starts downloading the upgrade :thinking:

Do you think it is necessary that it is connected to a wifi? Or would it be sufficient to have it switched on but not connected?

Switched on but not connected is fine.

There must be a setting next to the one checking for updates, to automatically upgrade over wifi, that can be switched off

Settings → System → System Update → Gear Icon in upper right corner
But for some reason it was greyed out when I tried to set it. Later I came to this setting via the update notification and it was not greyed out. I’ve deactivated automatic update, now it’s greyed out again. Pretty strange.
And it’s still asking very often if it should resume update. Annoying.

I disabled or removed most of the standard apps (Gmail, Maps, Play Store etc.) but Play Services are still enabled. I’ve charged to 80% and phone was just lying around.
With WiFi enabled and connected I was on 78% after 4hrs and 73% after 20hrs.
With WiFi disabled I was on 79% after 4hrs and 73% after 26hrs.
I’ve installed “BatteryBot Pro” which said 22hrs until drained on 80% without WiFi and 19hrs until drained on 80% with WiFi enabled.

EDIT: now BatteryBot Pro tells me there are 5days 11hrs left until drained while having 72% battery. Maybe this measurement is not very reliable or it’s still “learning”.

2 Likes

I think that measurements by me are not longer needed which makes it possible for me to let the phone switched offuntil an unlock becomes possible again :slight_smile:

2 Likes

Thanks @nasi - so I guess Asus firmware does not have the wifi drain problem… need to diff their OSS kernel with the one used in lineage and parameters used for the module…
Indeed @multispeedlurker, no need to switch it on :slight_smile:

2 Likes

Day 19

What FingerprintInscreen does on this device is: android_device_asus_sake/FingerprintInscreen.cpp at lineage-18.1 · LineageOS/android_device_asus_sake · GitHub
But then:

# ls -l /proc/globalHbm
-rw-rw-rw-    1 system   system           0 May 14 00:59 /proc/globalHbm

I have to change it so that defaultuser can do this, since lipstick, sailfish-fpd-community-test etc are run as an user.

But even running manually # echo 1 > /proc/globalHbm and # echo 0 > /proc/globalHbm does not get me a useful output.

vendor.goodix.sensor.status changes from 3 when idle to 4 when enrolling.
# cat /proc/driver/fp_xy always returns 0,0

Found something.
In kernel.

# cat /sys/devices/platform/soc/990000.i2c/i2c-1/1-0038/fts_fp_mode 
Notify FP:Off

Echoing 1 goes “On”

Also echo 1 > /sys/devices/platform/soc/990000.i2c/i2c-1/1-0038/fts_fp_ctrl_mode
makes the touchscreen NOT work but emit:

/dev/input/event8: 1684183261.138 - 0x01/EV_KEY - 0x021/KEY_F - 1
/dev/input/event8: 1684183261.138 - 0x01/EV_KEY - 0x021/KEY_F - 0
/dev/input/event8: 1684183261.889 - 0x01/EV_KEY - 0x016/KEY_U - 1
/dev/input/event8: 1684183261.889 - 0x01/EV_KEY - 0x016/KEY_U - 0

when fingerprint sensor is touched, and

/dev/input/event8: 1684183259.775 - 0x01/EV_KEY - 0x026/KEY_L - 1
/dev/input/event8: 1684183259.776 - 0x01/EV_KEY - 0x026/KEY_L - 0
/dev/input/event8: 1684183260.358 - 0x01/EV_KEY - 0x016/KEY_U - 1
/dev/input/event8: 1684183260.358 - 0x01/EV_KEY - 0x016/KEY_U - 0

when it is clicked outside.

There’s also “echo 2” to it which seems to make both touchscreen and fingerprint sensor work.


Logs when enrolling seemed to work, by treating 10 as onDown, and adding multiple times fingerprints (the first one made progress without me touching the screen). (sorry, no logs as no paste service allow this big…)

05-15 21:31:08.034 6723 7877 D [GF_HAL][DataSynchronizer]: [onMessage] message.msg=7
05-15 21:31:08.034 6723 7877 D [GF_HAL][DelmarSensor]: msg : 7
05-15 21:31:08.034 6723 7877 D [GF_HAL][DelmarHalDump]: [onEnrollEnd]DUMP_OP_ENROLL dump is disabled.

And the start of it?

05-15 21:30:37.359 6723 7877 D talog : D [gf_algo_common][gf_algo_enroll] group_id=0, finger_id=3112954849, samples_remaining=19

The previous log was made by whitelisting some pids.
Let’s do the reverse, blacklist the noise.
/usr/libexec/droid-hybris/system/bin/logcat | grep -v therm | grep -v wpa_supplicant | grep -v KTOP | grep -v "\[BAT\]\[CHG\]" | grep -vi battery | grep -v light_polli | grep -v "Synchronizing SCSI" | grep -v 26913 | grep -v 19308 where the number is sensors-hal

And
journalctl -f | grep -v "\[BAT\]\[CHG\]" | grep -v "Synchronizing SCSI" | grep -v BSSID | grep -v light_polli | grep -vi battery | grep -v KTOP | grep -v ngfd | grep -v cs35l45

Also tried from some asus rog lineage 19.1
/ # setprop vendor.asus.touch_control_aod 1
/ # setprop vendor.asus.touch_control_fod 1
/ # setprop persist.vendor.asus.fp.wakeup true

[GF_HAL][FingerprintCore]: [onEnrollError] fp property_set 2
[GF_HAL][CustomizedFingerprintCore]: [notifyAcquiredInfo] transfer acquired info: 1005 to customized: 1000.
...
[GF_HAL][FingerprintCore]: [onEvent] event = 4 workstate = 2
[GF_HAL][CustomizedFingerprintCore]: [notifyAcquiredInfo] transfer acquired info: 1003 to customized: 1002
...
[GF_HAL][FingerprintCore]: [onEvent] event = 2 workstate = 2
[GF_HAL][FingerprintCore]: [onAuthDownEvt] Auth Down.
[GF_HAL][CustomizedFingerprintCore]: [notifyAcquiredInfo] transfer acquired info: 1002 to customized: 1001
...
[GF_HAL][FingerprintCore]: [enroll] Enroll.
[GF_HAL][CustomizedFingerprintCore]: [notifyAcquiredInfo] transfer acquired info: 1001 to customized: 1010.
[GF_HAL][FingerprintCore]: [notifyAcquiredInfo] acquired_info=1010
watch -n 1 cat /sys/class/drm/fod_touched

changes only from 0 to 1, you need to echo 0 back

Need to let go fingerprint for now, until I have new ideas.


Let’s make a roundup of other problems:

ramdump device should look like “md_%s” according to drivers/soc/qcom/subsys-pil-tz.c
The “Fatal error on modem!” is a generic “Fatal error on %s!” in subsys_err_fatal_intr_handler in the same file.
I think the important stuff is

(CPU:0-pid:182:irq/335-smp2p) [18:30:57.000940032] modem subsystem failure reason: rmts_api.c:2304:[2, 3145728, -919099608] EFS:rmts_get_buffer failed while writing.

There is no rmts_api.c though :o_O:


Build a recovery inside hybris boot?
We could reverse the “if(ForceNormalBoot)” which used to switch root to “/first_stage_mount” and copy a recovery root there.
But that also means that the modules from vendor_boot.img need to be compatible with the kernel.
I just tested that the one in /vendor/lib/modules/ does not insmod and it has the same file size as the one in vendor_boot:

-rw-r–r-- 1 root root 520576 Jan 1 2009 /vendor/lib/modules/focaltech_fts_zf.ko

But, I could copy mine in there.
Actually, if I think about it, I could copy the recovery image inside the vendor_boot partition :hmm:
But… I think Lineage itself hardly booted with my kernel… what are the chances a recovery would :scratches-head:.


Let’s look a bit at wifi…

# cp /vendor/firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini /etc/
gDot11Mode=1
mount -o bind /etc/WCNSS_qcom_cfg.ini /vendor/firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini

(nope, no difference, but sounds like a good idea to have this in /etc to play with anyway)


FPS

# cat /sys/firmware/devicetree/base/soc/qcom,mdss_mdp@ae00000/qcom,mdss_dsi_sharp_qsync_wqhd_cmd/qcom,mdss-dsi-panel-name 
Sharp 2k cmd mode qsync dsi panel
# cat /proc/driver/panel_fps 
cat /sys/class/drm/card0-DSI-1/modes 
1080x2400x60x183357cmd
1080x2400x90x183362cmd
1080x2400x120x183357cmd

Hmm I think the composer needs to set this to > 60. It is not a file to be written, but some calls to be made.

2 Likes

If unlocking became possible again, would the drain under LOS be of interest?

As I said, they have contacted support. Freely translated was the answer:

According to the Software Specifications, we were able to determine that your phone is intended for further support with firmware like Unlock Device after all.

Expect the update of the firmware support website in coming weeks.

And as was wondering why the maintenance was still ongoing although May 2nd was over, it was obviously a misinterpretation by me:

The maintenance has just started on May 2.

So there is hope.

1 Like

By the way, how would you rate it? Are you confident (apart from the wifi problem) that it will be a daily-driver capable port?

If halfway decent pictures are taken (within the limits of what is possible with SFOS…), mobile data, telephony, encryption and waydroid work, that would be a really cool duo: the halfway compact phone (one-handed operation, yippie!) and SFOS…

By the way (number 2): in the Asus forum, many people complain about echoes in speaker mode. Have you noticed any problems there?

Sure, if time allows. It would help differentiating between driver issue or userspace services.

Thanks for following up on unlocking with Asus!

I am probably more resilient to bugs and might be more comfortable to wait for the right time to debug or new idea for a bugfix, so I’m not the best person to answer this:)

But the answer is yes, I can daily drive this. I have not really done this with my main SIM card yet and have not took it out more than a couple of days, mostly because I am preparing to reflash it if I change the way I build the image (I’m considering learning how to build a LVM image that would mean a re-flash will be necessary)

However I did test shortly the speaker call, by placing the Zenfone on spearker in another room and “talking” to it from far away and I don’t think there was echo. I should try with a real person to help me, but the echo I had on my previous port when the Android audio services were (intentionally) left running was not there.

2 Likes

Looking forward to trying this out :slight_smile:

Thanks for putting the work in!

Day 20, Season 2

Waited one second for vendor.qti.hardware.cacert@1.0::IService/default

When did that start.

Looking at video decoding:

/usr/bin/pulseaudio: Failed to fetch the lookup information of the device 0000000F
ACDB-LOADER: Error: ACDB_CMD_GET_AFE_INSTANCE_COMMON_TABLE_SIZE Returned = -19

0-pid:3334:irq/401-cs35l45) [21:38:57.709438493] cs35l45 5-0031: Global enable assert detected!
3-pid:10086:droid-sink-deep) [21:38:57.715544747] cs35l45 5-0031: Timeout waiting for MBOX ACK
3-pid:10086:droid-sink-deep) [21:38:57.715561562] cs35l45 5-0031: MBOX failure (-110)

ps aux | grep 6252

6252 mediacod {vendor.qti.medi} media.hwcodec /vendor.qti.media.c2@1.0-service

First there’s CCodec saying

05-21 21:38:58.051 CCodec : setup formats input: AMessage(what = 0x00000000) = { CCodec : int32_t feature-secure-playback = 0 CCodec : int32_t frame-rate = 25 CCodec : int32_t height = 544 CCodec : int32_t max-input-size = 7077888 CCodec : string mime = "video/avc" CCodec : int32_t priority = 0 CCodec : int32_t profile = 8 CCodec : int32_t width = 1280 CCodec : Rect crop(0, 0, 1279, 543) CCodec : int32_t level = 512 CCodec : } and output: AMessage(what = 0x00000000) = { CCodec : int32_t android._video-scaling = 1 CCodec : Rect crop(0, 0, 1279, 543) CCodec : int32_t color-standard = 130817 CCodec : int32_t color-range = 2 CCodec : int32_t color-transfer = 65791 CCodec : int32_t android._dataspace = 260 CCodec : int32_t width = 1280 CCodec : int32_t feature-secure-playback = 0 CCodec : int32_t frame-rate = 25 CCodec : int32_t height = 544 CCodec : int32_t max-height = 4320 CCodec : int32_t max-width = 8192 CCodec : string mime = "video/raw" CCodec : int32_t priority = 0 CCodec : int32_t rotation-degrees = 0 CCodec : int32_t sar-height = 1 CCodec : int32_t sar-width = 1 CCodec : Buffer hdr-static-info = { CCodec : 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ CCodec : 00000010: 00 00 00 00 00 00 00 00 00 AsyncCodecSource: Configured codec 'c2.qti.avc.decoder'!

The CCodecBuffer saying more or less the same thing

05-21 21:38:58.152 6252 1286 I QC2Buf : Reconfig: clearing from 0 bufs. Peak mem=0 MB CCodecConfig: c2 config diff is c2::u32 output.delay.value = 12 CCodecConfig: c2::u32 raw.crop.height = 544 CCodecConfig: c2::u32 raw.crop.left = 0 CCodecConfig: c2::u32 raw.crop.top = 0 CCodecConfig: c2::u32 raw.crop.width = 1280 CCodecBuffers: [c2.qti.avc.decoder#713:2D-Output] popFromStashAndRegister: output format changed to AMessage(what = 0x00000000) = { CCodecBuffers: int32_t android._video-scaling = 1 CCodecBuffers: Rect crop(0, 0, 1279, 543) CCodecBuffers: int32_t color-standard = 130817 CCodecBuffers: int32_t color-range = 2 CCodecBuffers: int32_t color-transfer = 65791 CCodecBuffers: int32_t android._dataspace = 260 CCodecBuffers: int32_t width = 1280 CCodecBuffers: int32_t feature-secure-playback = 0 CCodecBuffers: int32_t frame-rate = 25 CCodecBuffers: int32_t height = 544 CCodecBuffers: int32_t max-height = 4320 CCodecBuffers: int32_t max-width = 8192 CCodecBuffers: string mime = "video/raw" CCodecBuffers: int32_t priority = 0 CCodecBuffers: int32_t rotation-degrees = 0 CCodecBuffers: int32_t sar-height = 1 CCodecBuffers: int32_t sar-width = 1 CCodecBuffers: Buffer hdr-static-info = { CCodecBuffers: 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ CCodecBuffers: 00000010: 00 00 00 00 00 00 00 00 00 ......... CCodecBuffers: } CCodecBuffers: int32_t color-format = 2130708361 CCodecBuffers: }

And in between:

05-21 21:38:58.056  6252  1286 E QC2V4l2Codec: [avcD_26]  ? is not a supported pixel format!
05-21 21:38:58.148  1192    68 E ion     : ioctl c0044901 failed with code -1: Inappropriate ioctl for device
05-21 21:38:58.150  1192    67 E FMQ     : grantorIdx must be less than 3
05-21 21:38:58.151  6252  6252 E FMQ     : grantorIdx must be less than 3
05-21 21:38:58.152  6252  6252 E ion     : ioctl c0044901 failed with code -1: Inappropriate ioctl for device

And after:

05-21 21:38:58.167  1192    66 D AsyncCodecSource: [c2.qti.avc.decoder] Output format changed! Buffers remaining: 0
05-21 21:38:58.197  1192    73 I DroidMediaCodec: Format changed from codec
05-21 21:38:58.197  1192    73 I DroidMediaCodec: notifySizeChanged: width = 1280, height = 544
05-21 21:38:58.245  1192    67 E DroidMediaBufferQueue: Client wasn't able to handle a received frame.
05-21 21:38:58.273  1192    72 E BufferQueueProducer: [DroidMediaCodecBufferQueue](id:2000000000,api:3,p:32,c:32) cancelBuffer: BufferQueue has been abandoned

And in before:

05-21 21:38:58.027  6252  8139 I vendor.qti.media.c2@1.0-service: missing struct descriptor #Param::CoreIndex(-Vc010) for field window of struct #Param::CoreIndex(FV1c00d)
05-21 21:38:58.027  6252  8139 I vendor.qti.media.c2@1.0-service: missing struct descriptor #Param::CoreIndex(-Vc01a) for field misr_info_top_field of struct #Param::CoreIndex(-Vc01b)
05-21 21:38:58.027  6252  8139 I vendor.qti.media.c2@1.0-service: missing struct descriptor #Param::CoreIndex(-Vc01a) for field misr_info_bottom_field of struct #Param::CoreIndex(-Vc01b)
05-21 21:38:58.027  6252  8139 I vendor.qti.media.c2@1.0-service: missing struct descriptor #Param::CoreIndex(--002) for field mastering of struct #Param::CoreIndex(--180a)

Sometimes later

05-21 21:38:58.320  6226  4951 D qdgralloc: Falling back to default YUV format - no camera/video specific format defined, usage 0x100
05-21 21:38:58.321  6252  8136 D qdgralloc: Falling back to default YUV format - no camera/video specific format defined, usage 0x100
05-21 21:38:58.376  1192    49 W qdgralloc: Unknown Color primary = 2

This is all in /vendor/lib64/libgrallocutils.so

However this is not used # lsof /vendor/lib64/libcodec2_vndk.so

One more time:

05-21 22:56:58.788 29187    68 W ColorUtils: expected specified color aspects (0:0:255:255)
05-21 22:56:58.791 29033 29033 E StandardCaps: Failed to read platform hdr value

Also /vendor/lib64/libqcodec2_v4l2codec.so
Has “Failed to read platform hdr value”

Service is:
/vendor/etc/init/vendor.qti.media.c2@1.0-service.rc


Wifi

Searching “power” in drivers/staging/qcacld-3.0/**/*cfg*.h

gRuntimePM=0

 * 0: RTPM disabled, so CxPC aware RTPM will be disabled as well
 * 1: RTPM enabled, but CxPC aware RTPM disabled
 * 2: RTPM enabled and CxPC aware RTPM enabled as well

/sys/class/power_supply/battery/current_now seems to pass below -200k, so raising?

enable_qmi_stats defaults to * 1: Periodic stats over QMI is enabled

enable_qmi_stats=0

drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/cfg_mlme_powersave.h

gPowerUsage defaults to Mod

gPowerUsage=Min

apsd_enabled - Enable automatic power save delivery - defaults to 0

apsd_enabled=1

This ini is used to enable/disable WoW

gEnableWoW=0

gExtWoWgotoSuspend - Enable/Disable Extended WoW

gExtWoWgotoSuspend=0

Interesting comment:

 * hdd_override_all_ps() - overrides to disables all the powersave features.
 * @hdd_ctx: Pointer to HDD context.
 * Overrides below powersave ini configurations.
 * gEnableImps=0
 * gEnableBmps=0
 * gRuntimePM=0
 * gWlanAutoShutdown = 0
 * gEnableSuspend=0
 * gEnableWoW=0

I have:

  • gEnableImps absent, defaults to 1
  • gEnableBmps absent, defaults to 1
  • gRuntimePM=0, I needed to enable it
  • gWlanAutoShutdown, absent, defaults to 0, seems to disable wifi (max is 24hrs == 86400 seconds)
  • gEnableSuspend, absent, not found in drivers
  • gEnableWoW absent, defaults to 3, I need to disable it

…Plus, I have enabled gRuntimePM=2 for now, let’s test until tomorrow…

ended up with

gPowerUsage=Min                                                                       
apsd_enabled=1                                                              
gEnableWoW=0                                                                
gExtWoWgotoSuspend=0

(tommorow test - still heavy drain, 200-500mA)


Back to video playback:

May 23 00:42:40 Zenfone8 dbus-daemon[9021]: library “libandroidicu.so” needed or dlopened by “/usr/libexec/droid-hybris/system/lib64/libmedia.so” is not accessible for the namespace “(default)”

mal suggests dont-use-droid-convert. Doesn’t work.
Elros suggests I can navigate to file:/// and browse to the video to test with the browser. Works :slight_smile: But what can I do about that?

rm /odm/lib64/libandroidicu.so
touch /odm/lib64/libandroidicu.so
mount -o bind  /apex/com.android.art/lib64/libandroidicu.so  /odm/lib64/libandroidicu.so

rm /odm/lib64/libicuuc.so
touch /odm/lib64/libicuuc.so
mount -o bind  /apex/com.android.art/lib64/libicuuc.so  /odm/lib64/libicuuc.so

rm /odm/lib64/libicui18n.so
touch /odm/lib64/libicui18n.so
mount -o bind  /apex/com.android.art/lib64/libicui18n.so  /odm/lib64/libicui18n.so

Then:

A lot of buffers are being dropped.
(That happened even before though)

" [avcD_27] YV12 is not a supported pixel format!" in browser vs “[avcD_14] ? is not a supported pixel format!” in Gallery

mediacod {vendor.qti.medi} media.hwcodec /vendor.qti.media.c2@1.0-service

https://pastebin.ubuntu.com/p/TWn75y3gNC/

Browser plays the video. Gallery does not.
It’s
YV12 is not a supported pixel format
vs
? is not a supported pixel format

2 Likes

Probably that would be too easy, but there is a page that describes an unlock simply via fastboot:
https://mobilewithdrivers.com/download/unlock-bootloader/asus-zenfone-8-zs590ks

Of course it’s possible that this is just an automatically generated page and the procedure doesn’t work…
Does anyone see a risk in just trying this?

What could happen in the worst case? That it does not work? Or that it ends up being a brick?

Yes. Please don’t link such crap.

If you could brick it in normal menus ASUS would have gone bankrupt from warranty claims.

Menus? I’m talking about fastboot which isn’t a menu, at least as far as terminals don’t count as menus. Maybe some people(you?) count everything that is easier than assembler as menu, but I certainly don’t agree with that.