Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[beluga] screen flickering #210

Closed
argosphil opened this issue Aug 2, 2023 · 7 comments
Closed

[beluga] screen flickering #210

argosphil opened this issue Aug 2, 2023 · 7 comments
Labels
beluga OPPO Watch 41mm/46mm

Comments

@argosphil
Copy link
Contributor

The screen on beluga watches flickers slightly; the problem appears to be pixels not lighting up all the time, so it's particularly visible with bright backgrounds and high "backlight" brightness, and appears to happen (mostly?) near the left and right edges of the screen.

So far, the only way I've found to stop the flickering is to unbind devices from the kernel drivers in the right order, causing an oops in the process and preventing further modification of the screen contents.

@argosphil argosphil changed the title Screen flickering [beluga] screen flickering Aug 2, 2023
@eLtMosen eLtMosen added the beluga OPPO Watch 41mm/46mm label Aug 2, 2023
@argosphil
Copy link
Contributor Author

Here's the very hacky script which will produce a solid white bright screen without flickering (at least, sometimes) on today's asteroidos image. It requires installing msm-fb-refresher first, but that's just to pan the frame buffer:

killall -STOP asteroid-launcher
killall -STOP mce
for i in $(seq 1 $((500 * 476))); do echo -ne '\xff\xff\xff\xff'; done > /dev/fb0
msm-fb-refresher
echo 255 > /sys/class/leds/lcd-backlight/brightness
echo 1 > /sys/class/graphics/fb0/mdss_hbm_enable
echo 1ac8000.qcom,mdss_dsi_ctrl0 > /sys/bus/platform/drivers/mdss_dsi_ctrl/unbind
echo 1a00000.qcom,mdss_mdp:qcom,mdss_fb_primary > /sys/bus/platform/drivers/mdss_fb/unbind
echo 1a00000.qcom,mdss_mdp > /sys/bus/platform/drivers/mdp3/unbind
echo soc:qcom,mdss_dsi@0 > /sys/bus/platform/drivers/mdss_dsi/unbind

@argosphil
Copy link
Contributor Author

Some of the things I've tried without success:

  • starting asteroid-launcher (which I understand uses libhybris) but not psplash (which doesn't)
  • starting psplash but not asteroid-launcher
  • playing around with the sysctls in /sys/class/graphics/fb0 (mdss_hbm_enable increases screen brightness, mdss_fb_disp_en_gpio disables the display and is necessary to apply other sysctls)
  • playing around with the sysctls in /sys/kernel/debug/mdp
  • playing around with the sysctls in /sys/kernel/debug/mdss_panel_fb0 (note: after modifying those, you need to write 1 to /sys/kernel/debug/mdss_panel_fb0/override_flag, then 0 to mdss_fb_disp_en_gpio, then 1 to mdss_fb_disp_en_gpio, then restore framebuffer contents)
  • playing around with the clock rates/disabling clocks in /sys/kernel/debug/clk
  • ioctls on /dev/fb0, particularly LPM mode and vsync settings
  • modifying the kernel drivers to debug more
  • crashing the kernel to see whether the flickering would stop (it didn't)
  • stopping asteroid-launcher at various points to try to work out when the flickering starts

@argosphil
Copy link
Contributor Author

Some progress:

If I modify mce to lie about the display state to the dbus (and whoever's listening), the flickering goes away, but the display still works and brightness seems okay. In particular, I'm making mce send

signal time=1691185489.798890 sender=:1.78 -> destination=(null destination) serial=107 path=/com/nokia/mce/signal; interface=com.nokia.mce.signal; member=display_status_ind
   string "off"

even though the display is on and working. So my guess is someone's listening on the system dbus and putting the display in some sort of power-saving mode that I cannot distinguish from normal intended operation. However, it's possible it's blurry or the color representation is off and I just haven't noticed.

As this test was done on a somewhat hacked system, it needs further verification. Grepping suggests mcewatcher.c might be what listens to the signal and somehow forwards it to the hybris layer...

@MagneFire
Copy link
Member

Wow thanks for the research thus-far!

I'll follow this thread closely, it seems you're making great progress.

It might also fix the display issue introduced in #149.

@argosphil
Copy link
Contributor Author

@MagneFire Thank you! That's really encouraging. I'll have a look at #149 (but don't have affected hardware).

Any suggestions or ideas would be very welcome, of course :-)

@argosphil
Copy link
Contributor Author

I finally traced it down to the component that was literally my last desperate "just in case" entry on the list: nfcd.

Does anyone have a beluga with stock firmware to test whether it happens there when NFC is in use or enabled? I feel rather silly for not thinking of the possibility before...

Anyway, is it possible this is a hardware issue and that NFC just isn't sufficiently isolated from the display electronics?

argosphil referenced this issue in MagneFire/meta-asteroid Aug 28, 2023
NFC seems to cause issues on multiple watches.
On `beluga` it causes for a screen flickering issues on the sides.
On `ray` it causes for random horizontal lines to appear as well as ghost touchscreen presses.

As there's currently little use of NFC disable the service from starting to workaround these issues.

This cause of this issue was first discovered by @argosphil.

Signed-off-by: Darrel Griët <[email protected]>
@MagneFire
Copy link
Member

Fixed via AsteroidOS/meta-asteroid#178 thanks for the great work you've put into figuring this one out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beluga OPPO Watch 41mm/46mm
Projects
None yet
Development

No branches or pull requests

3 participants