Workaround screen dimming after A12 update

Since Fairphone seems to be unwilling or incapable of fixing this, here’s a workaround for rooted users.

You need to execute this command line with root rights:

while true;do sleep 0.5;echo 0 > /sys/devices/virtual/thermal/cooling_device16/cur_state;done

I use the Automate app for that.

If you want to use it too, check out this flow I made for the Automate app:

https://llamalab.com/automate/community/flows/45916

It’s really frustrating that it took me 5mins to workaround it, but Fairphone can’t be bothered to fix this.

13 Likes

Doesn’t that essentially forcibly disable thermal throttling?

Also, you have something running every half second. Not great for battery life I suppose.

3 Likes

I have unlisted this thread until we know it’s a safe workaround. That why I also flagged the post.
As I agree with the concerns placed by @O.o

2 Likes

I don’t think this needed unlisting. One would have to be fairly technical to 1/ root their phone (yes, even an open Fairphone) and 2/ realize this is a shell script and set it up.

In short, whoever manages to implement this workaround knows perfectly well what they’re doing and what the risks are. It’s not like your average clueless Joe could try it and set their phone on fire :slight_smile:

7 Likes

Since you are already making it in Automate, you can use the “Display on?” block to prevent it from running all the time. Possibly also the Delay block to replace the while loop and the sleep command.

2 Likes

It only overrides one of many “cooling devices” (i.e. the display), all the others are not affected.

3 Likes

As Ingo said, it only overrides the screen dimming, all other cooling devices are still available.

Running an echo every half second does nothing at all to the battery life as it’s such a short burst. It adds maybe 0.1% of active CPU time.

The sleep command is a minimum sleep, not an exact sleep, thus requireing no CPU resources.

But if you are worried, you can easily scale it down to run once every 10 seconds or so and it will still work fine.

If the phone does get hot, you can always manually decrease the screen brightness if you want to.

The reason why I don’t use Automate completely (including a screen on check) is because it would show a toast every time the “Shell superuser block” is called.

But yeah, you could also use a screen on check block, then a non-superuser block to check the state of the file and only write to the file if it’s not 0, but that’s just a waste of blocks and will not give you more performance/battery life, since the current shell script is about as light-weight as possible.

An echo to a kernel file (meaning it’s not stored on disk but just in RAM) is about as light-weight as it gets.

9 Likes

Is the cooling device associated with the display guaranteed to get index 16? Perhaps it’d be more robust to loop through all device directories and choose the one with the appropriate type?

2 Likes

Since .flo is ultimately a fairly textual format

git would probably work well for this, so perhaps one of us could

We can show Fairphone how software development should be! XD

By fixing their issue for them, that is…

5 Likes

I improved the flow to save some battery. The new version is available here: Workaround for Fairphone 4 screen brightness bug ⋅ Community ⋅ Automate for Android

2 Likes

I’ve uploaded Workaround screen dimming after A12 update - #12 by Dakkaron to it, and I’ll try to keep it updated with changes so that if any of this becomes unavailable, you can use the commit log to get the version you want, should that be desirable.

I suppose that won’t be necessary much longer, as an official fix will be included in the October update of FPOS:

5 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.