[X10II] [X10III] Color banding in low light conditions

You could edit Lipstick compositor, like when trying to repurpose the assistant button… but that is most likely an awful idea.
The proper way would be to use the DBUS signal, as you said… or report this specific finding to Jolla and hope they fix this in 4.5…

@flypig Could you add the newest findings from direc85 to the internal bugtracker? It looks like he managed to find the root of the issue.
(Sorry for ping, I would love for it to get fixed in 4.5, to me it is the biggest papercut with 10 III)

1 Like

I would hardly call that a fix; a bit hacky workaround at best, and it still doesn’t get us any closer the the root cause of the issue :sweat_smile:

2 Likes

I mean the error log a post above, seems helpful? Also maybe it could enter hmb each time the screen gets turned on? I don’t know.
But as for your hacky workaround, I turned it into a script:

#!/bin/bash
dbus-monitor --system sender=com.nokia.mce,interface=com.nokia.mce.signal,member=display_status_ind |
while read -r line; do
    if [[ "$line" == *"\"on\""* ]]
        then echo 1 > /sys/devices/dsi_panel_driver/hbm_mode ; sleep 0.1 ; echo 0 > /sys/devices/dsi_panel_driver/hbm_mode;
    fi
done

I put it in my home directory, nano ~/bin/FixBrightness.sh, but you can choose any location you like.
Then create a systemd service to start it at boot. nano /usr/lib/systemd/system/FixBrightness.service

[Unit]
Description=FixBrightness
After=ofono.service lipstick.service

[Service]
ExecStart=/home/defaultuser/bin/FixBrightness.sh
Restart=always

[Install]
WantedBy=user-session.target

Then systemctl start FixBrightness.service to test it, and systemctl enable FixBrightness.service to start it at boot. And voila! Brigthness fixed with a hacky workaround!

5 Likes

Thanks, works great! I guess I don’t have to make a small C++ application for this after all :slight_smile:

1 Like

Hmmm… I would love to use it but it doesn’t seem to work for me. The script itself works, but I still see awful color banding in low light conditions (e.g. in dark room late at night) with the display brightness set to very low level.

So before and after using the script, or using the workaround with maximum brightness you still get color banding, but different type?
Or this script has no effect?
Super weird, did Sony use 2 different panels? Also what Android version did you update from?

1 Like

Highly unlikely, I’m sure the problem must be on my side. But I’ve checked everything and I can’t identify anything that I might be doing wrong. Everything works and does what it should, just the banding doesn’t go away.

Even if I manually echo 1 and then 0 to /sys/devices/dsi_panel_driver/hbm_mode (which does what it should, i.e. increases the brightness and then sets it back to what it was), the colors are still awful in dark areas, looking like washed out stains with color banding (sometimes even yellow-ish) instead of dark/black areas. If I start the script, or the service, the result is the same - I can see the script working (modifying the brightness when I turn on the screen) but as soon as brightness returns to the set level banding instantly reappears.

I’ve got the automatic brightness level set to some 15-20%. If I use manual brightness then it is set even lower, to some 10%. Maybe those are too low for this kind of panel?

I’m really starting to miss my XA2’s normal screen where at least all colors were correct regardless of the brightness level…

Well, actually identical.

If does work, because I can see how the brightness increases and decreases. If I increase the sleep timeout in the script to some higher value, e.g. 1 second, I can see how the banding disappears when the display becomes bright, but after that 1 second when the display dims banding just returns. If I stat /sys/devices/dsi_panel_driver/hbm_mode modification time updates, so it is correctly written to (and I can see the result of it, i.e. brightness change, anyway).

The highest Android 11 version, the last one before Android 12 update.

1 Like

Do you have automatic brightness enabled? I think it has some effect to the banding and the workaround, but it still works for me for sure.

I get same results (i.e. none) with both automatic and manual brightness :disappointed:

Could you disable automatic brightness, then do the workaround with setting the brightness to the max, and then back to low value. Is the banding still there?
Energy saving needs to be disabled too

Yes, Jacek, it’s still there. I’ve tried the workaround many times ever since I bought the 10 III, it never worked. Of course, as I wrote, it’s only apparent if very low brightness levels are used, up to some 10% with manual brightness or up to some 15-20% with automatic brightness in very low light (e.g. late night with only small bedside lamp lighting the room), i.e. when the display is really dim. And of course it only manifests itself in dark (almost black) areas of pictures. But when it shows up, it looks really awful.

1 Like

That is really interesting! You are the only person so far for whom this workaround is not working.
I suggested that maybe they are using different screens, because that happened with OLED PlayStation Vita. (Where small part of devices used different screen revision with different way of controlling it. And VitaBright plugin for changing the LUT values for each brightness levels wouldn’t work for years with them.)
I wonder why is that in your case. Only difference I was using Android 11 straight from Emma, not updated, but I know a lot of people have updated too.

Does the max-brightness slider trick still fork for you? The automatic brightness should be disabled for it to work.

No, it doesn’t. It never did. No matter if automatic or manual brightness is used, it just doesn’t work. I mean, the banding obviously disappears when I set the brightness to max level, but when I set it back to the dim level banding instantly reappears…

And also Jacek’s script does function as I can see it writing to /sys/devices/dsi_panel_driver/hbm_mode, which also has the clearly visible effect of setting the brightness to max and then back to what it was. So the script (either started directly or as a service) does what it should, but it doesn’t affect the banding…

I’ll try to record a movie illustrating it. It’ll probably be difficult to make it visible but maybe my dSRL camera will manage. If I succeed, I’ll post it here.

Writing 0 or 1 to /sys/devices/dsi_panel_driver/hbm_mode certainly does work as expected as it does change the brightness level as it should. So panel control seems to be the same…

Anyway, on Reddit I’ve seen a post from someone who says that for him the workaround to increase brightness to max was only removing the green tint, but wasn’t removing the banding. So at least I’m not alone :slight_smile:

1 Like

What could it possibly be if not screen/microcode differences?

Well, indeed, not much else remains…

For some reason, it no longer starts for me at boot. And it is funny, because I wrote it, and I never had such a problem with systemd service before. Does anyone has any idea why it doesn’t work at boot, but then works after I manually start the service?

● FixBrightness.service - FixBrightness
   Loaded: loaded (/usr/lib/systemd/system/FixBrightness.service; enabled; vendor preset: enabled)
   Active: inactive (dead)

Not an expert at all, but maybe the service needs some more dependencies added.

It should e.g. only start after /home is mounted, maybe have ConditionPathExists=/sys/devices/dsi_panel_driver/hbm_mode, and depend on com.nokia,mcs dbus service being available.

Otherwise systemd will look for /home/defaultuser/bin/FixBrightness.sh when it loads the service, and depending on timing will not find it.

I modified it to do this, not sure if it improves things (note the script has been moved to a new path):

[Unit]
Description=Brightness fixer for Xperia 10III
Documentation=https://forum.sailfishos.org/t/11659/
After=ofono.service lipstick.service mce.service dbus.service
Wants=mce.service
AssertPathExists=/sys/devices/dsi_panel_driver/hbm_mode

[Service]
ExecStart=/usr/bin/X10IIIFixBrightness.sh
Restart=always
RestartSec=15s

[Install]
WantedBy=user-session.target
3 Likes

For some reason it is still not working for me at boot, so weird!

   Loaded: loaded (/usr/lib/systemd/system/FixBrightness.service; enabled; vendor preset: enabled)
   Active: inactive (dead)