For starters: im not a linux power user.
The minimum brightness is to high. Is there a way to set this lower?
ThnX!
There is Nightish which helps some (but can also mess up the gamma making blacks distort).
Thanks for your input. I already use nightish. This is not an optimal solution.
Unless you can somehow affect the driver and somehow make the backlight darker, which is really unlikely to he possible, all you can do is affect the gamma.
So Nightish is the best thing you can do, on desktop Linux if you use X server you could use xrandr. But SFOS uses wayland, so it is much harder, and there is no universal way to change that, it has to be specific to the compositor. So I am not even aware of any other way to change it than nightish.
With my other android devices the brightness is much lower. Possible to send this to the Jolla team?
The real question is the brightness of 10 II stock is lower, or the AOSP source, that is all that matters. If stock can get darker than AOSP, then maybe it can get fixed, but that is a Sony issue. Then maybe SFOS is brighter than AOSP, I deem that very unlikely, onpy this is a problem with SFOS.
I looked at the driver, granted I am not too experienced in that, and with the minimum brightness the OS simply sends “0” brightness to the display driver. There unless there is a bug and other OS on the 10 II can get darker, it is the limitation of the hardware, or the display firmware.
It could also be the ambient light sensor going haywire or something. However, I agree that this minimum brightness “too high” is rather subjective and should dig down to the real question as you pointed out. For instance, I haven’t experienced any “too high” brightness with my Xperia 10 II, and I have the brightness set to minimum in normal use.
In addition, Xperia 10 II has OLED screen so you can’t really affect on backlight since it doesn’t have one, but of course there’s some control for the individual leds on the screen.
I realise this is an old question and I also understand that there is possibly no solution, but…in Settings/Display, we can adjust screen brightness automatically and adjust the brightness base level.
By turning off Adjust brightness automatically and sliding the Brightness base level slider to far left, we can get a general lower brightness.
So there is a way to adjust how bright the screen will be for any given lux level:
You need to edit /var/lib/mce/builtin-gconf.values (system file) and change the number after /system/osso/dsm/display/display_brightness=…. The default value is 1 and setting it to 0 will make the display about 2% dimmer in most situations, to make the display brighter values up to 20 are supported by default.
If you want to it even lower than level 0, you need to edit /etc/mce/20als-defaults.ini and add new brightness profiles by adding the following at the end of the [BrightnessDisplay] section:
LimitsProfile21=1;2;4;6;11;19;34;61;109;195;350;431;513;611;727;866;1031;1227;1461;1739;2070
LevelsProfile21=1;3;4;6;7;9;10;12;13;15;17;26;34;42;51;59;67;76;84;92;100
LimitsProfile22=1;2;4;6;11;19;34;61;109;195;350;446;531;632;753;896;1067;1270;1512;1800;2143
LevelsProfile22=1;2;3;5;6;7;8;10;11;12;14;23;32;40;49;57;66;75;83;92;100
LimitsProfile23=1;2;4;6;11;19;34;61;109;195;350;462;550;655;779;928;1105;1315;1566;1864;2219
LevelsProfile23=1;2;3;4;5;6;7;8;9;10;11;20;29;38;47;56;65;74;83;92;100
LimitsProfile24=1;2;4;6;11;19;34;61;109;195;350;478;569;678;807;961;1144;1361;1621;1929;2297
LevelsProfile24=1;1;2;2;3;4;5;5;6;7;8;18;27;36;45;54;64;73;82;91;100
LimitsProfile25=1;2;4;6;11;19;34;61;109;195;350;495;589;702;835;994;1184;1409;1678;1997;2378
LevelsProfile25=1;1;1;1;2;2;3;3;4;4;5;15;24;34;43;53;62;72;81;91;100
LimitsProfile26=1;2;4;6;11;19;34;61;109;195;350;512;610;726;865;1029;1225;1459;1737;2068;2461
LevelsProfile26=1;1;1;1;1;1;1;1;1;1;2;12;22;32;42;51;61;71;81;91;100
LimitsProfile27=1;2;4;6;11;19;34;61;109;195;350;531;632;752;895;1066;1269;1510;1798;2140;2548
LevelsProfile27=1;1;1;1;1;1;1;1;1;1;1;10;20;30;40;50;60;70;80;90;100
LimitsProfile28=1;2;4;6;11;19;34;61;109;195;350;549;654;778;927;1103;1313;1563;1861;2216;2638
LevelsProfile28=1;1;1;1;1;1;1;1;1;1;1;7;17;28;38;48;59;69;80;90;100
LimitsProfile29=1;2;4;6;11;19;34;61;109;195;350;569;677;806;959;1142;1359;1618;1927;2294;2730
LevelsProfile29=1;1;1;1;1;1;1;1;1;1;1;4;15;26;36;47;58;68;79;90;100
This adds profiles 21 to 29 which are each successively darker than profile 0; meaning that the order of profiles in terms of brightness is now: 29, 28, 27, 26, 25, 24, 23, 22, 21, 0, 1, 2, 3, 4, …, 18, 19, 20
(Think of the leading digit 2 like a minus sign.)
Note that it is not possible to have the display brightness be less than 1% of the display’s maximum supported brightness, 1% is always the minimum brightness in mce.
Hope this is helpful to others with chronic light sensitivity as well!
For reference, the additional curves suggested above were generated using the following Python code after analyzing the shape of the pre-defined curves:
limprf = lambda max: f"1;2;4;6;11;19;34;61;109;195;350;{';'.join(str(round(max * 0.84**p)) for p in range(9, -1, -1))}"
lvlprf = lambda mid: f"{';'.join(str(max(floor(mid / 11 * i), 1)) for i in range(1, 11 + 1))};{';'.join(str(ceil(((100 - mid) / 10 * i) + mid)) for i in range(1, 10 + 1))}"
def gen_curves(n):
for i in range(1, n + 1):
print()
print(f"LimitsProfile{20 + i}={limprf(2000 / (0.966 ** i))}")
print(f"LevelsProfile{20 + i}={lvlprf(20 - (3 * i))}")
gen_curves(9)
And here are my approximate steps in arriving at this solution:
- Compiling fanotify-example and running it as
sudo ./fanotify-example /sys/class/backlight/panel0-backlightrevealed that thebrightnessvalue of the main panel is controlled by/usr/sbin/mce(I already knew that backlight devices are exposed at/sys/class/backlightunder LInux) - Checking in
/etc/mcerevealed a file named20als-defaults.ini(ALS = ambient light sensor) containing several mappings of ALS input brightness levels to display backlight levels but no indication which profile is currently used - From starting
mcewith debug logging I learned that there are apparently some “GConf” values influencing its operation in addition to the files at/etc/mceand that it reads the file/var/lib/mce/builtin-gconf.valuesto find these values (apparently this was intended to be compatible with the GNOME 2.x configuration system, but only kinda-somewhat is) - After some digging and trial-and-error, I learned from the manpage at mce/man/mce.8 at 91198feec76f1069ed7b38f519e9a0f7852ed358 · sailfishos/mce · GitHub (not shipped in SailfishOS itself) that the “GConf key”
/system/osso/dsm/display/display_brightnesscontrols the brightness profile used - Finally, I had to figure out how to generate dimmer curves since the default curves are too bright: something, something try different value relations and try to spot the pattern. Plotting the existing curves was very helpful of course and I should have done it from the start.
Published this as blog post with more details:
Thanks for the clear instructions. This is also an issue on the Jolla C2: Brightness in automatic mode in mid-dimmed environments is often too high, even if the slider is set to the lowest position on the left.
I will tinker with it if it’s possible to modify it on the C2 and share the results here with the community. Maybe someone has already done that research for this device, if so, please raise your voice.
Ok, there is a serious blunder unfortunately: The value in /var/lib/mce/builtin-gconf.values does not control the brightness profile used, it is actually a saved version of the Brightness base level setting in settings and the limited documentation on it is quite misleading (also since it apparently documents something that doesn’t exist anymore in this form).
I just dug through the source code again and found out that my previous approach was completely wrong: There can only be exactly 21 curves (hard-coded in source code) and /system/osso/dsm/display/display_brightness indeed selects the curve – by doing display_brightness * 21 / 100. So what we really need is to just replace the default set of curves with darker ones in the lower levels!
Ok, different approach!
Just edit /etc/mce/20als-defaults.ini and replace the entire contents of [BrightnessDisplay] with the following:
LimitsProfile0=1;2;4;6;11;19;34;61;109;195;350;511;608;724;862;1026;1221;1454;1731;2060;2453
LevelsProfile0=1;1;1;1;1;1;1;1;1;1;1;10;20;30;40;50;60;70;80;90;100
LimitsProfile1=1;2;4;6;11;19;34;61;109;195;350;490;584;695;827;985;1172;1396;1662;1978;2355
LevelsProfile1=1;1;1;1;1;2;2;2;3;3;4;14;24;33;43;52;62;72;81;91;100
LimitsProfile2=1;2;4;6;11;19;34;61;109;195;350;471;560;667;794;945;1125;1340;1595;1899;2261
LevelsProfile2=1;1;2;2;3;4;5;5;6;7;8;18;27;36;45;54;64;73;82;91;100
LimitsProfile3=1;2;4;6;11;19;34;61;109;195;350;452;538;640;762;908;1080;1286;1531;1823;2170
LevelsProfile3=1;2;3;4;5;6;7;8;9;10;12;21;30;39;48;56;65;74;83;92;100
LimitsProfile4=1;2;4;6;11;19;34;61;109;195;350;434;516;615;732;871;1037;1235;1470;1750;2083
LevelsProfile4=1;2;4;5;7;8;10;11;13;14;16;25;33;42;50;58;67;75;84;92;100
LimitsProfile5=1;2;4;6;11;19;34;61;109;195;350;416;496;590;703;836;996;1185;1411;1680;2000
LevelsProfile5=1;3;5;7;9;10;12;14;16;18;20;28;36;44;52;60;68;76;84;92;100
LimitsProfile6=1;2;4;6;11;19;34;61;109;195;350;400;476;567;674;803;956;1138;1355;1613;1920
LevelsProfile6=2;4;6;8;10;13;15;17;19;21;24;32;40;47;55;62;70;78;85;93;100
LimitsProfile7=1;2;4;6;11;19;34;61;109;195;350;384;457;544;648;771;918;1092;1301;1548;1843
LevelsProfile7=2;5;7;10;12;15;17;20;22;25;28;36;43;50;57;64;72;79;86;93;100
LimitsProfile8=1;2;4;6;11;19;34;61;109;195;350;368;439;522;622;740;881;1049;1249;1486;1769
LevelsProfile8=2;5;8;11;14;17;20;23;26;29;32;39;46;53;60;66;73;80;87;94;100
LimitsProfile9=1;2;4;6;11;19;34;61;109;195;350;354;421;501;597;710;846;1007;1199;1427;1699
LevelsProfile9=3;6;9;13;16;19;22;26;29;32;36;43;49;56;62;68;75;81;88;94;100
LimitsProfile10=1;2;4;6;11;19;34;61;109;195;350;340;404;481;573;682;812;967;1151;1370;1631
LevelsProfile10=3;7;10;14;18;21;25;29;32;36;40;46;52;58;64;70;76;82;88;94;100
LimitsProfile11=1;2;4;6;11;19;34;61;109;195;350;326;388;462;550;655;779;928;1105;1315;1566
LevelsProfile11=4;8;12;16;20;24;28;32;36;40;44;50;56;61;67;72;78;84;89;95;100
LimitsProfile12=1;2;4;6;11;19;34;61;109;195;350;313;373;443;528;629;748;891;1060;1262;1503
LevelsProfile12=4;8;13;17;21;26;30;34;39;43;48;54;59;64;69;74;80;85;90;95;100
LimitsProfile13=1;2;4;6;11;19;34;61;109;195;350;300;358;426;507;603;718;855;1018;1212;1443
LevelsProfile13=4;9;14;18;23;28;33;37;42;47;52;57;62;67;72;76;81;86;91;96;100
LimitsProfile14=1;2;4;6;11;19;34;61;109;195;350;288;343;409;487;579;690;821;977;1163;1385
LevelsProfile14=5;10;15;20;25;30;35;40;45;50;56;61;65;70;74;78;83;87;92;96;100
LimitsProfile15=1;2;4;6;11;19;34;61;109;195;350;277;330;392;467;556;662;788;938;1117;1330
LevelsProfile15=5;10;16;21;27;32;38;43;49;54;59;64;68;72;76;80;84;88;92;96;100
LimitsProfile16=1;2;4;6;11;19;34;61;109;195;350;266;316;377;448;534;636;757;901;1072;1276
LevelsProfile16=5;11;17;23;29;34;40;46;52;58;64;68;72;75;79;82;86;90;93;97;100
LimitsProfile17=1;2;4;6;11;19;34;61;109;195;350;255;304;362;430;512;610;726;865;1029;1225
LevelsProfile17=6;12;18;24;30;37;43;49;55;61;68;72;75;78;81;84;88;91;94;97;100
LimitsProfile18=1;2;4;6;11;19;34;61;109;195;350;245;292;347;413;492;586;697;830;988;1176
LevelsProfile18=6;13;19;26;32;39;45;52;58;65;72;75;78;81;84;86;89;92;95;98;100
LimitsProfile19=1;2;4;6;11;19;34;61;109;195;350;235;280;333;397;472;562;669;797;949;1129
LevelsProfile19=6;13;20;27;34;41;48;55;62;69;76;79;81;84;86;88;91;93;96;98;100
LimitsProfile20=1;2;4;6;11;19;34;61;109;195;350;226;269;320;381;453;540;643;765;911;1084
LevelsProfile20=7;14;21;29;36;43;50;58;65;72;80;82;84;86;88;90;92;94;96;98;100
Then, execute systemctl restart mce as root.
Now every Brightness base level setting below 24% in settings will use reduced automatic brightness levels! (I think the lowest level is actually a bit too low to be usable, but I’m open to feedback!)
These curves where generated using:
limprf = lambda max: f"1;2;4;6;11;19;34;61;109;195;350;{';'.join(str(round(max * 0.84**p)) for p in range(9, -1, -1))}"
lvlprf = lambda mid: f"{';'.join(str(max(floor(mid / 11 * i), 1)) for i in range(1, 11 + 1))};{';'.join(str(ceil(((100 - mid) / 10 * i) + mid)) for i in range(1, 10 + 1))}"
for i in range(0, 20 + 1):
print()
print(f"LimitsProfile{i}={limprf(2000 * (0.96 ** (i - 5)))}")
print(f"LevelsProfile{i}={lvlprf(20 + (4 * (i - 5)))}")
Did anyone test these updated brightness profiles? What are your experiences?
(If I can show 2-3 people like this, I could actually submit this as a proper SailfishOS patch to be included in future SFOS versions, since its part of the Open Source SFOS codebase.)