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

I figured it out! Turns out that user-session.target is not present on SFOS! All I had to do is to change it to any other target, and it now works!
So the fixed instruction is:

#!/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=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=graphical.target

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

7 Likes

is there any video where the effect of this bug can be seen?

That’s not true, it’s just not a system target:

nemo@PGXperiiia10:~ $ systemctl status post-user-session.target
Unit post-user-session.target could not be found.
nemo@PGXperiiia10:~ $ systemctl status --user user-session.target
● user-session.target - User session
   Loaded: loaded (/usr/lib/systemd/user/user-session.target; static; vendor preset: enabled)
  Drop-In: /usr/lib/systemd/user/user-session.target.d
           └─ 50-jolla-camera.conf, 50-jolla-email.conf, 50-sailfish-browser.
   Active: active since Wed 2022-10-26 10:35:37 CEST; 2 weeks 5 days ago
3 Likes

Can be a bit confusing if you’re accustomed to looking in /etc/systemd/user (where the targets are all symlinked once you get to some wants).

All I know is that with that target it refused to launch at boot, even when enabled, and with the new one it does work.

Hm, i’ve tried to create the service but it doesnt work on my X10iii.
The two commands in the terminal work but the service doesnt work, any tips?

In what way does it not work? What is the output of systemctl status <service name>?

1 Like
● Fix.service - Brightness fixer for Xperia 10III
Loaded: loaded (/usr/lib/systemd/system/Fix.service; disabled; vendor preset:
enabled)
Active: activating (auto-restart) (Result: exit-code) since Wed 2022-12-07 00:
29:33 CET; 6s ago
Docs: https://forum.sailfishos.org/t/11659/
Process: 17594 ExecStart=/usr/bin/X10IIIFixBrightness.sh (code=exited,
status=203/EXEC)
Main PID: 17594 (code=exited, status=203/EXEC)


● Fix.service - Brightness fixer for Xperia 10III
Loaded: loaded (/usr/lib/systemd/system/Fix.service; disabled; vendor preset:
enabled)
Active: failed (Result: exit-code) since Wed 2022-12-07 00:31:14 CE
T; 4ms ago
Docs: https://forum.sailfishos.org/t/11659/
Process: 17617 ExecStart=/usr/bin/X10IIIFixBrightness.sh (code=exited,
status=203/EXEC)
Main PID: 17617 (code=exited, status=203/EXEC)

Dez 07 00:31:14 Xperia10III systemd[1]: Fix.service: Service hold-off time over,
scheduling restart.
Dez 07 00:31:14 Xperia10III systemd[1]: Fix.service: Star
t request repeated too quickly.
Dez 07 00:31:14 Xperia10III systemd[1]: Fix.service: Fail
ed with result 'exit-code'.

First log output direct after start second output after one minute

I used the code from the commend with the ‘fixed’ script 24 days agi.

Is /usr/bin/X10IIIFixBrightness.sh executable?

Ok, now its working.

What I’ve tried:
chmod +x on the sh file andI added /bin/bash into the exec line in the service file
then the service was working but the screen was still washed out
then i removed busybox-symlinks-bash and rebooted the device but the display colors were still greenish
Then I executed

echo 1 > /sys/devices/dsi_panel_driver/hbm_mode; sleep 0.1 ; echo 0 >/sys/devices/dsi_panel_driver/hbm_mode

and magically the display has after every screen unlock the right color. I dont know exactly why it is now working but it works :slight_smile:

Hey guys
Is there any fix for the washed out colors that is easy to implement and hopefully “set it and forget it” type of fix?
Not an expert so im having a hard time following the conversation here!

Try my instruction above, I set it that way and it has been working no problem for months.
Hope it works for you too

2 Likes

Thanks you for the reply!
I would like to try but i can’t really understand where and when should i do anything mentioned!

Unfortunately doesn’t work for me

But what doesn’t work?
I just noticed that I used sudo in my instruction, that some people don’t have installed. You need to replace sudo with devel-su.
Did you do devel-su systemctl start FixBrightness.service and devel-su systemctl enable FixBrightness.service?
If you did, what does devel-su systemctl status FixBrightness.service return?

Must be my case, i.e. the service (and the script) itself works fine (and does change the brightness to max and back as intended), but it doesn’t fix the issue. No matter what. I remember that we came to the conclusion that it may be a different panel version…

1 Like

Well, i tried to follow the instructions to the letter and this is what i get.

I am sorry, my instruction is not great and I can’t edit it anymore.
The .sh file should be in /usr/bin/X10IIIFixBrightness.sh, not in home folder. And after you create this file (using the nano command) you need to make it executable, using devel-su chmod +x /usr/bin/X10IIIFixBrightness.sh.
The service part seems to be working well.
After that you could do and then devel-su systemctl restart FixBrightness.service.

1 Like

If you can wait for a few days, I’ll turn this into a little RPM package you can simply download and install. There are so many struggling with installing this, and to be fair, it’s not an easy task.

6 Likes