VIM4 AOSP suspend and turns off display after 24 hours

Which system do you use? Android, Ubuntu, OOWOW or others?

Android

Which version of system do you use? Khadas official images, self built images, or others?

Self built AOSP on khadas-vim4-r-64bit branch

Please describe your issue below:

Device turns off hdmi display and goes to sleep exactly after 24 hours

Post a console log of your issue below:

[86485.102492@0]  bl: bl_power_on exit, for lcd is off
[86493.836648@5]  audit: audit_lost=24 audit_rate_limit=5 audit_backlog_limit=64
[86493.836850@5]  audit: rate limit exceeded
[86493.901479@0]  gxbb_pm: early_suspend_state=1
[86493.901509@0]  gxbb_pm: early_suspend: call handlers
[86493.902125@0]  gxbb_pm: early_suspend: video_early_suspend [aml_media]
[86493.902769@0]  video_early_suspend ok
[86493.903385@0]  gxbb_pm: early_suspend: hdmirx_early_suspend [aml_media]
[86493.904076@0]  [RX]-rx_set_port_hpd, port:15, val:0
[86493.904654@0]  [RX]-hdmirx_early_suspend- ok
[86493.905213@0]  gxbb_pm: early_suspend: pdm_platform_early_suspend [snd_soc]
[86493.906064@0]  gxbb_pm: early_suspend: tdm_platform_early_suspend [snd_soc]
[86493.906931@0]  gxbb_pm: early_suspend: tdm_platform_early_suspend [snd_soc]
[86493.907813@0]  gxbb_pm: early_suspend: tdm_platform_early_suspend [snd_soc]
[86493.908666@0]  gxbb_pm: early_suspend: loopback_platform_early_suspend [snd_soc]
[86493.909601@0]  gxbb_pm: early_suspend: aml_card_early_suspend [snd_soc]
[86493.910394@0]  entry aml_card_early_suspend
[86493.911085@0]  gxbb_pm: early_suspend: hdmitx_early_suspend [aml_media]
[86493.916985@7]  type=1400 audit(1704980072.732:1707): avc: denied { read } for comm="Binder:307_2" name="wakeup26" dev="sysfs" ino=47051 scontext=u:r:system_suspend:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=1
[86493.919019@7]  type=1400 audit(1704980072.732:1708): avc: denied { open } for comm="Binder:307_2" path="/sys/devices/platform/soc/fe088000.sdio/mmc_host/mmc2/mmc2:0001/mmc2:0001:2/wakeup/wakeup26" dev="sysfs" ino=47051 scontext=u:r:system_suspend:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=1
[86493.922163@7]  type=1400 audit(1704980072.732:1709): avc: denied { read } for comm="Binder:307_2" name="event_count" dev="sysfs" ino=47058 scontext=u:r:system_suspend:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=1
[86493.924600@7]  type=1400 audit(1704980072.732:1710): avc: denied { open } for comm="Binder:307_2" path="/sys/devices/platform/soc/fe088000.sdio/mmc_host/mmc2/mmc2:0001/mmc2:0001:2/wakeup/wakeup26/event_count" dev="sysfs" ino=47058 scontext=u:r:system_suspend:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=1
[86493.928068@7]  type=1400 audit(1704980072.732:1711): avc: denied { getattr } for comm="Binder:307_2" path="/sys/devices/platform/soc/fe088000.sdio/mmc_host/mmc2/mmc2:0001/mmc2:0001:2/wakeup/wakeup26/event_count" dev="sysfs" ino=47058 scontext=u:r:system_suspend:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=1
[86493.931802@0]  HDMITX: Early Suspend
[86493.933729@0]  video suspend, vsync exit
[86493.935028@0]  hdmitx_set_hdr10plus_pkt: null vsif
[86493.935416@0]  gxbb_pm: early_suspend: aml_vout_early_suspend [aml_media]
[86493.935713@2]  vout: vout_ioctl: cmd_dir = 0x2, cmd_nr = 0x0
[86493.935985@0]  gxbb_pm: early_suspend: aml_vout2_early_suspend [aml_media]
[86493.935989@4]  vout: vmode set to dummy_l
[86493.936103@4]  aml_media: current vmode=2160p60hz, cmd: 0x10000
[86493.936122@4]  vout_viu_mux_clear_t7: index=1, mux_sel=0x22
[86493.936125@4]  vout_viu_mux_clear_t7: viu_mux reg=0x3e
[86493.936174@4]  hdmitx: recalc before invalid 0 1, frac 0
[86493.936178@4]  recalc after invalid 0 1, frac 0
[86493.936194@4]  vrr error: [2]: aml_vrr_unregister_device: vrr_drv is null
[86493.936197@4]  hdmitx_unregister_vrr ret = -1
[86493.936320@5]  dummy_encl_set_current_vmode finished
[86493.936325@5]  vout: new mode dummy_l set ok
[86493.936329@5]  aml_media: current vmode=dummy_l, cmd: 0x20000
[86493.936335@5]  DOLBY: vout_notify_callback: VOUT_EVENT_MODE_CHANGE
[86493.936340@5]  vdin0,std_dur:50
[86493.936344@5]  vsync_pts_inc 1800 1/50
[86493.946234@0]  gxbb_pm: early_suspend: aml_vout3_early_suspend [aml_media]
[86493.947040@0]  gxbb_pm: early_suspend: osd_early_suspend [aml_media]
[86493.997865@0]  aml_media: osd_suspended
[86493.997910@0]  gxbb_pm: early_suspend: sensor_early_suspend [iv009_isp_sensor]
[86493.998607@0]  gxbb_pm: early_suspend: isp_early_suspend [iv009_isp]
[86493.999349@0]  gxbb_pm: early_suspend: bt_earlysuspend
[86494.000016@0]  gxbb_pm: early_suspend: done
[86496.001349@5]  vout: vout_ioctl: cmd_dir = 0x2, cmd_nr = 0x0

@v.iyappan Is this question mandatory? How many times have you tested it?

@goenjoy We have tested this extensively on several occasions, and even with the most recent OOWOW Android 11 64-bit version, the problem still exists. We must make sure that the kvim4 device and HDMI display are turned on until they are turned off on purpose.

Although it is recognised that apps like wakelock-revamp can provide short-term fixes, we are actively working towards an operating system-level fix for this issue.

@v.iyappan I have reproduced your question, it may have been dormant within 24 hours. I will follow up on this bug and it will take some time as it is not easy to verify.

@v.iyappan

device/khadas$ git diff
diff --git a/kvim4/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/kvim4/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
index 27be73b..a22dd30 100644
--- a/kvim4/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
+++ b/kvim4/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
@@ -20,6 +20,7 @@
     <!-- Do not enable auto rotation switching -->
     <bool name="def_accelerometer_rotation">false</bool>
     <integer name="def_screen_off_timeout">2147483647</integer>
+    <integer name="def_sleep_timeout">2147483647</integer>
     <integer name="def_long_press_timeout_millis">1000</integer>

It works fine. Tested, Thanks for your support.