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
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)
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!
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
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>
?
● 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
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
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?