[OnePlus 6 Questions & Answers] svg1234:
I've been tracing down an issue related to double tap to wake and my OP6 screen and maybe the proximity sensor. I originally thought it was just an app misbehaving or one of the custom roms (crdroid 7.x and 6.x) coding, but after trying a bunch of stock OOS 9.x and 10.x ROMs, as well as other custom ROMs, and doing full recovery/restores w/ msmdownload tool, the problem now seems more hardware related than software.

It began when I realized that when dt2w (or gestures) was enabled in settings, not only didn't those features work (ever), but I also experienced very high battery drain through the night when the phone was supposed to be in deep doze mode. Double-tap-to-sleep works fine. Otherwise, screen and phone are behaving normally. I've been investigating everything from wakelocks to the light/deep doze modes (deviceidle) to sensors to synaptics stuff. The problem is definitely not wakelock related. Upon deeper investigation, I've narrowed it down to a few things.

When dt2w is enabled, the phone actually IS going into both light and deep doze modes. But the battery drain per hour is similar to normal/active (app 2.5%/hr). Obviously something (the screen?) is still draining battery despite the phone being in doze mode ('dumpsys deviceidle' confirms the display is off and locked). I can just keep the d2tw disabled, so it's not a huge problem, but I would very much like to get that feature (and gestures) working, and understand wtf is going on.

I've read that it could be a proximity sensor calibration issue. I've run some testing apps on the sensors and they seem ok. Proximity sensor definitely fires on/off while testing and watching logs in realtime. (Also the screen turns off when I am on phone call, and back on again when moving phone further away - as it should). I should have done the calibration thing in engineering mode when I rolled back to 9.0.2. But now I'm back at 10.3.9. I did a msmdownloadtool upgrade, which went fine, but had no impact on the problem. The synaptics firmware is obviously involved. OOS 10.3.9 uses fw_synaptics_17819.img. The logs were flooded with synaptics-related entries and errors.

I would like to compare my logs against other OP6's logs. Just need to confirm a couple of things.

1) Upon reboot, this dmesg log shows that the synaptics driver is attempting to update (flash) its firmware! It tries twice, fails, and moves on. Is this normal behaviour on OP6 boot?

OnePlus6:/ # dmesg -Tw | grep syna

[Wed May 5 22:07:01 2021] synaptics,s3320: tpd_driver_init enter
[Wed May 5 22:07:01 2021] synaptics,s3320: before on cpu [4]
[Wed May 5 22:07:01 2021] synaptics,s3320: check CPU[0] is [online]
[Wed May 5 22:07:02 2021] synaptics,s3320: after on cpu [0]
[Wed May 5 22:07:02 2021] synaptics,s3320: synaptics_ts_probe is called
[Wed May 5 22:07:02 2021] synaptics,s3320: synaptics_parse_dts ts->support_hw_poweroff =1
[Wed May 5 22:07:02 2021] synaptics,s3320: synaptics,tx-rx-num is 15 30
[Wed May 5 22:07:02 2021] synaptics,s3320: synaptic:ts->irq_gpio:125 irq_flags:8200 max_num 10
[Wed May 5 22:07:02 2021] synaptics,s3320: synaptics_parse_dts: avdd current = 20000
[Wed May 5 22:07:02 2021] synaptics,s3320: synaptics_parse_dts:avdd_vmin=3008000,avdd_vmax=3008000
[Wed May 5 22:07:02 2021] synaptics,s3320: synaptics_parse_dts: Failed to get regulator vdd current
[Wed May 5 22:07:02 2021] synaptics,s3320: synaptics_parse_dts: Failed to get regulator vdd voltage
[Wed May 5 22:07:02 2021] synaptics,s3320: F12_2D_QUERY_BASE = 4a \x0a \x09\x09\x09F12_2D_CMD_BASE = 0 \x0a\x09\x09\x09F12_2D_CTRL_BASE\x09= 13 \x0a\x09\x09\x09F12_2D_DATA_BASE\x09= 8 \x0a\x09\x09\x09
[Wed May 5 22:07:02 2021] synaptics,s3320: F34_FLASH_QUERY_BASE = 23 \x0a\x09\x09\x09F34_FLASH_CMD_BASE\x09= 0 \x0a\x09\x09\x09F34_FLASH_CTRL_BASE\x09= c \x0a\x09\x09\x09F34_FLASH_DATA_BASE\x09= 0 \x0a\x09\x09\x09
[Wed May 5 22:07:02 2021] synaptics,s3320: F54_QUERY_BASE = 43 \x0a\x09\x09\x09F54_CMD_BASE = 42 \x0a\x09\x09\x09F54_CTRL_BASE\x09= e \x0a\x09\x09\x09F54_DATA_BASE\x09= 0 \x0a\x09\x09\x09
[Wed May 5 22:07:02 2021] synaptics,s3320: before fw update bootloader_mode[0x0]
[Wed May 5 22:07:02 2021] synaptics,s3320: CURRENT_FIRMWARE_ID = 0xad00902100000000
[Wed May 5 22:07:02 2021] synaptics,s3320: max_x = 1080,max_y = 2280; max_x_ic = 1079,max_y_ic = 2279
[Wed May 5 22:07:02 2021] synaptics,s3320: synaptics_soft_reset !!!
[Wed May 5 22:07:02 2021] synaptics,s3320: synaptics_tpedge_limitfunc limit_enable =1,mode:0x41 !
[Wed May 5 22:07:02 2021] input: synaptics,s3320 as /devices/platform/soc/a90000.i2c/i2c-3/3-0020/input/input2
[Wed May 5 22:07:02 2021] synaptics,s3320: synaptic:ts->irq is 377
[Wed May 5 22:07:02 2021] synaptics,s3320: synaptics_ts_probe 3203: normal end
[Wed May 5 22:07:02 2021] synaptics,s3320: synaptics bootmode 0 !
[Wed May 5 22:07:09 2021] synaptics,s3320: changer_write_func:ts->changer_connet = 1
[Wed May 5 22:07:10 2021] synaptics,s3320: synaptics bootmode 0 !
[Wed May 5 22:07:10 2021] synaptics,s3320: start update ******* fw_name:tp/fw_synaptics_17819.img,ts->manu_name:S3706B
[Wed May 5 22:07:10 2021] synaptics,s3320: enter version 17819 update mode
[Wed May 5 22:07:10 2021] synaptics,s3320: FW_ID:2744099--CONFIG_ID FW_NAME:tp/fw_synaptics_17819.img
[Wed May 5 22:07:10 2021] synaptics,s3320_firmware: fwu_start_reflash: Start of reflash process
[Wed May 5 22:07:10 2021] synaptics,s3320_firmware: fwu_go_nogo: Device firmware ID = 2744099
[Wed May 5 22:07:10 2021] synaptics,s3320_firmware: fwu_go_nogo: Image firmware ID = 2827775
[Wed May 5 22:07:10 2021] synaptics,s3320_firmware: fwu_go_nogo: Updating UI firmware and config
[Wed May 5 22:07:11 2021] synap rmidev_create_attr
[Wed May 5 22:07:11 2021] synaptics,s3320_firmware: fwu_enter_flash_prog: BL mode not entered
[Wed May 5 22:07:11 2021] synaptics,s3320_firmware: fwu_start_reflash: End of reflash process
[Wed May 5 22:07:11 2021] synaptics,s3320: FW update not success try again
[Wed May 5 22:07:11 2021] synaptics,s3320: FW_ID:2744099--CONFIG_ID FW_NAME:tp/fw_synaptics_17819.img
[Wed May 5 22:07:11 2021] synaptics,s3320_firmware: fwu_start_reflash: Start of reflash process
[Wed May 5 22:07:11 2021] synaptics,s3320_firmware: fwu_go_nogo force update firmware
[Wed May 5 22:07:11 2021] synaptics,s3320_firmware: fwu_go_nogo: Updating UI firmware and config
[Wed May 5 22:07:12 2021] synaptics,s3320_firmware: fwu_enter_flash_prog: BL mode not entered
[Wed May 5 22:07:12 2021] synaptics,s3320_firmware: fwu_start_reflash: End of reflash process
[Wed May 5 22:07:12 2021] synaptics,s3320: FW update failed twice, quit updating process!
[Wed May 5 22:07:34 2021] synaptics,s3320: start get base data:1
[Wed May 5 22:07:34 2021] synaptics,s3320: set_doze_time: set doze time: 1
[Wed May 5 22:07:34 2021] synaptics,s3320: reset doze time
[Wed May 5 22:07:34 2021] synaptics,s3320: synaptics_tpedge_limitfunc limit_enable =1,mode:0x41 !
[Wed May 5 22:07:34 2021] synaptics,s3320: all finger up
[Wed May 5 22:07:37 2021] synaptics,s3320: all finger up
[Wed May 5 22:07:42 2021] synaptics,s3320: all finger up

2) When dt2w is enabled, watching dmesg in realtime, the phone starts generating (spamming the log) with the following error messages non-stop, but ONLY when in an inactive state (screen is off, etc). As soon as the state becomes active (screen on), the errors stop.

[Wed May 5 22:44:21 2021] synaptics,s3320 3-0020: synaptics_rmi4_i2c_read_block: I2C read over retry limit
[Wed May 5 22:44:21 2021] synaptics,s3320: Synaptic:ret = -5
[Wed May 5 22:44:21 2021] synaptics,s3320: synaptics_hard_reset !!!

Also get some of these: ("dose mode" lol)

[19677.286066] synaptics,s3320: synaptics_hard_reset !!!
[19677.306065] synaptics,s3320: synaptics_enable_interrupt_for_gesture: select page failed ret = -5
[19677.306715] i2c_geni a90000.i2c: i2c error :-107
[19677.306877] i2c_geni a90000.i2c: i2c error :-107
[19677.306894] synaptics,s3320: synaptics_mode_change: set dose mode[0xb0] err!!

3) With dt2w disabled, when awakened from screen off, it generates these two messages:

synaptics,s3320: synaptics_mode_change: set dose mode[0xb0] err!!
synaptics_tpedge_limitfunc limit_enable =1,mode:0x7f !

4) Can you confirm that you have /system/vendor/etc/firmware/tp/fw_synaptics_17819.img and that that is what the boot dmesg log is showing?

5) Proximity sensor:

05-06 19:06:56.550 9209 9209 I Dialer : AudioModeProvider.getApproximatedAudioRoute - Routing to earpiece
05-06 19:06:56.619 860 860 I sensors-hal: batch:183, android.sensor.proximity/6, period=200000000, max_latency=0
05-06 19:06:56.619 860 860 I sensors-hal: batch:192, android.sensor.proximity/6, period=200000000, max_latency=0 request completed
05-06 19:06:56.619 860 860 I sensors-hal: activate:150, android.sensor.proximity/6 en=1
05-06 19:06:56.623 860 860 I sensors-hal: activate:161, android.sensor.proximity/6 en=1 completed
05-06 19:06:56.655 860 19060 E sensors-hal: handle_sns_client_event:69, prox_event: near_far=0, distance=5.000000, raw_adc=11, crosstalk=0, timestamp=67223704860956
05-06 19:06:58.719 860 860 I sensors-hal: activate:150, android.sensor.proximity/6 en=0
05-06 19:06:58.719 860 860 I sensors-hal: activate:161, android.sensor.proximity/6 en=0 completed
05-06 19:07:09.529 860 900 I sensors-hal: batch:183, android.sensor.proximity/6, period=200000000, max_latency=0
05-06 19:07:09.529 860 900 I sensors-hal: batch:192, android.sensor.proximity/6, period=200000000, max_latency=0 request completed
05-06 19:07:09.529 860 900 I sensors-hal: activate:150, android.sensor.proximity/6 en=1
05-06 19:07:09.544 860 900 I sensors-hal: activate:161, android.sensor.proximity/6 en=1 completed
05-06 19:07:09.577 860 19105 E sensors-hal: handle_sns_client_event:69, prox_event: near_far=1, distance=0.000000, raw_adc=255, crosstalk=0, timestamp=67236625352206
05-06 19:07:10.388 860 19105 E sensors-hal: handle_sns_client_event:69, prox_event: near_far=0, distance=5.000000, raw_adc=33, crosstalk=0, timestamp=67237433905227
05-06 19:07:11.487 860 19105 E sensors-hal: handle_sns_client_event:69, prox_event: near_far=1, distance=0.000000, raw_adc=123, crosstalk=0, timestamp=67238531122831
05-06 19:07:12.525 860 19105 E sensors-hal: handle_sns_client_event:69, prox_event: near_far=0, distance=5.000000, raw_adc=28, crosstalk=0, timestamp=67239570519081
05-06 19:07:13.626 860 19105 E sensors-hal: handle_sns_client_event:69, prox_event: near_far=1, distance=0.000000, raw_adc=117, crosstalk=0, timestamp=67240667706320
05-06 19:07:14.430 860 19105 E sensors-hal: handle_sns_client_event:69, prox_event: near_far=0, distance=5.000000, raw_adc=19, crosstalk=0, timestamp=67241476122102
05-06 19:07:15.430 860 900 I sensors-hal: activate:150, android.sensor.proximity/6 en=0
05-06 19:07:15.432 860 900 I sensors-hal: activate:161, android.sensor.proximity/6 en=0 completed
05-06 19:07:16.109 1046 1046 I Telecom : ProximitySensorManager: All calls removed, resetting proximity sensor to default state: CSW.rC->CM.mCAR@DII

Thank you.