yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Compact Android Development] baristurunc:
Why don't you do these yourself, and come up with ready to ship changes to this rom's builder? If he refuses to include your work, then you can build your own version.

He's just a human like you, sharing work done for free. Asking such (non-essential, there are other ways to do them too) features doesn't seem right.
[Xperia Z5 Compact Android Development] Berni-0815:
As far as I remember, I've never asked what to integrate additional into my ROM.

All that I can remember is that I've asked for help to fix the current issues.
[Xperia Z5 Compact Android Development] Berni-0815:
Sure! It's quite the same source basis.

That's half the truth! The focus does only failed to work in short distance.
[Xperia Z5 Compact Android Development] Berni-0815:
But will this help to solve the current issues?

Please remember:

Overheating while charging in powered down mode

Hotspot

Camera focus in short range

Laggy video recording

Restart into recovery

Slow speed on /sdcard partition

Encryption

...you tell me?

I don't think so....
[Xperia Z5 Compact Android Development] Berni-0815:
And here is my next version. I've changed some charging thresholds that hopefully reduce the overheating of the battery in powered down mode.

Changelog
[Xperia Z5 Compact Android Development] :
I don't see how that would fix the issue though, the same problem happens on any other camera app with 23 mpx support, even those that are fully compatible with android 10/11.

Also, i don't think those newer versions even have the support for 23 mpx to begin with. The reason HTC Camera supports those resolutions is because the one x9 used the same sensor of the Z5 i think.

That model of course never got updated to such recent android versions, i'm 100% sure they removed support for it a long time ago.

No point in trying to bypass the verification.

Also as Berni pointed out, the camera focus is still buggy even on those cameras, i though it was working fine there but i was wrong. And that's the main problem.

One last camera issue i can point out (that i think is easy to solve) is that the front selfie camera is laggy when it's used on any app (videocalling on whatsapp and google meet or just recording a video with telegram).

This is the same that happens when trying to record with snap at 480p.

All it would take to fix the problem is setting the default front camera resolution to "CIF" (should be 352x288, 0.1MP) instead of 480p.

It still looks good enough and fixes the lag.
[Xperia Z5 Compact Android Development] Berni-0815:
I can set the default video quality to CIF. But I haven't found a point so far where I could set these default values differently for the rear and front cameras.

For now, you should set it up manually.
[Xperia Z5 Compact Android Development] H4NNE5:
Ok, so what does it mean in the first post as the Camera is in the "Working"-list?

Does it mean it's working in CIF-settings? Or do I maybe have a problem that is unique with my phone and the camera works without problems on your device(s)?
[Xperia Z5 Compact Android Development] Berni-0815:
Wait a moment! Are those apps using the built-in camera app Snap? If not and if they have implemented their own camera solution, I can't help with this issue!
[Xperia Z5 Compact Android Development] Berni-0815:
@H4NNE5 : That means, that the camera itself is working. We are so proud that we have managed this stuff to work!

If there are some lags it's often not fixable. You have to play around with the settings or try another camera app.

That's all I can say or do for the moment.

Maybe we're able to fix those issues in the future?
[Xperia Z5 Compact Android Development] baristurunc:
Can somebody please try adding the following text to /system/vendor/etc/thermal-engine.conf file for fixing the battery overheat issue, at least when the phone is booted (not offline charging)? You have to do this via recovery or any other method as long as system is not booted.

Unfortunately, I can't try this myself as my battery's temperature sensor is dead and always shows 30.2 degrees.

[BATTERY_MONITOR]
algo_type monitor
sensor bms
sampling 1000
thresholds 43000 65000
thresholds_clr 41000 0
actions battery battery+s_shutdown
action_info 3 13+5

I don't exactly know what action_info "3" is, but I have taken the snippet above from the redundant /system/etc/thermal-engine.conf, which is the stock firmware thermal configuration file, I presume.

If this does not work, try changing bms with battery.
[Xperia Z5 Compact Android Development] Berni-0815:
Where is your information from?

This comes from our file device/sony/suzuran/configs/thermal-engine.conf:

[batt_therm]
algo_type monitor
sensor bms
sampling 1000
thresholds 43000 67000
thresholds_clr 41000 0
actions battery battery+s_shutdown
action_info 3 13+5

Edit:

These lines can be found 1:1 in stock 7.1 ROM's file system/etc/thermal-engine.conf
[Xperia Z5 Compact Android Development] Berni-0815:
Thanks for your Information. I will take a closer look into it asap.

One question left: Does anyone tested my latest version from my post #310 with slightly modified kernel?
[Xperia Z5 Compact Android Development] Berni-0815:
That's right and that's confusing me a lot! We're using two files "thermal-engine.conf", one in the kitakami-common config section and one in the suzuran config section.

Both are copied to the ROM, but only the one in the kitakami-common config section is used for the thermal engine:

service vendor.thermal-engine /vendor/bin/thermal-engine -c /vendor/etc/thermal-engine.conf

From the file "installed-files.txt":

/system/vendor/bin/thermal-engine
/system/etc/thermal-engine.conf
/system/vendor/etc/thermal-engine.conf

Now I have to eruate, which of those files is really used and where the output of thermal-engine

thermal-engine -o

comes from...

As I wrote: I'm confused!
[Xperia Z5 Compact Android Development] Delfinololo:
Hi Berni, do you think that it will be hard to fix hotspot not working?

Thank you
[Xperia Z5 Compact Android Development] Berni-0815:
Nothing is impossible! But unfortunately I can't fix it.

Klick
[Xperia Z5 Compact Android Development] 1ggn3:
Thanks for all the thermal stuff, it looks like my results are (hopefully) already obsolete ;-)

I'll install the new 18.1 ROM (the charging stuff was the last big issue that kept me on 17.1) and run the usual tests, let's see what it will do!

In general, what has been posted recently matches my observations:

When no kernel is booted, the phone will just "trickle-charge", something like 100mA.

As soon as a kernel is running, it will unlock the charger and charge until the kernel limits (those 55°C in the dtsi) are hit, reaching this limit will also change the battery health status (in sysfs) from "GOOD" to "OVERHEAT". Those are more absolute maximum ratings than practical limits imo, since the phone becomes too hot to touch.

When a full ROM (technically, the charger should probably do this as well, idk why it doesn't) is running, the limits from the userspace thermal config are applied, those are the real life limits that the phone should follow (~42°C).
[Xperia Z5 Compact Android Development] Berni-0815:
You want to say, that charging is working better on 17.1? That's weird, because we're using nearly the same kernel in both versions. Especially the thermal and charging parts are identical! :unsure:
[Xperia Z5 Compact Android Development] 1ggn3:
That's what I was trying to say all the time! ;)

In the 14.1, 15.1 and 17.1 ROMs, the thermal config works and limits the battery temp to ~42°C. In 18.1 (at least when I tried, I'm installing your new version right now) it doesn't, and the phone gets very hot, even when the ROM is running (not shut down).
[Xperia Z5 Compact Android Development] Berni-0815:
Ok. Currently I'm uploading a new version with some fixes in thermal configuration.

Please be patient.
[Xperia Z5 Compact Android Development] Berni-0815:
Here it is.

Changelog

Please test and report if the overheating (and charging) issues are gone. On my own device everything is working as expected; but as I wrote, I'm using the original shipped charger.
[Xperia Z5 Compact Android Development] 1ggn3:
So, I just tried your previous ROM (with the kernel changes 7ac0ebe041e and 9b611da7b50, not the most recent one) and those seem to work somehow? Even while running the 7z benchmark and using my fast charger, I didn't get my battery above 39°C. The current limit was a bit aggressive, but the basic idea sounds good.

But this also means that the kernel steps in before the userspace / thermal conf does. I think the most interesting thing will be to check what a kernel without 7ac0ebe041e would do with your latest ROM changes (00494fed and so on). I hope that we will see the original behavior from 14.1: current limiting according to the thermal conf, and the kernel only stepping in to prevent a house fire :)

Sadly, MEGA is quite slow for me right now (~200kB/s), so give me some time to try this combination
[Xperia Z5 Compact Android Development] Berni-0815:
The commit 7ac0ebe041e was born out of desperation. Maybe it's not neccessary?

In commit 9b611da7b50 I've limited the hot value to 50°C. Maybe that's enough?

In the five previous commits (fde... to 06b...) I've changed some kernel behaviour too. But I'm not sure what they are really doing in powered down charging mode.

Seems so!

I'll build a new version without commit 7ac0ebe041e tomorrow.
[Xperia Z5 Compact Android Development] 1ggn3:
While I think that this is a good change, I don't think that matters until it hits 50°C. By the way, I've just tested charging while powered on (full Android), so I'm expecting the same (good) behavior as in 17.1.

I can just combine the current system image with an old boot image, right?
[Xperia Z5 Compact Android Development] Berni-0815:
That has been the idea behind this. Before my change, this value has been 55°C:

&pmi8994_fg {
- qcom,hot-bat-decidegc = <550>;
+ qcom,hot-bat-decidegc = <500>;
qcom,warm-bat-decidegc = <450>;
qcom,cool-bat-decidegc = <100>;
qcom,cold-bat-decidegc = <50>;

But the commit 7ac0ebe041e limits the voltage and current when hitting warm temperature (45°C), and, to be honest, in very cool environment too:

qcom,warm-bat-ma = <350>;
qcom,cool-bat-ma = <350>;
qcom,warm-bat-mv = <4100>;
qcom,cool-bat-mv = <4100>;

Very good! (y)

Sure you can. But you have to find a boot image that meats your needs.
[Xperia Z5 Compact Android Development] Berni-0815:
Here it is.

Changelog
[Xperia Z5 Compact Android Development] 1ggn3:
I've decided to make this a bit more "scientific", by writing a small script that logs the current and temperature, so we're not comparing apples with oranges all the time. I'll run some tests with the different versions later.

The good news so far is that the general thermal stuff seems to work fine (thermal throttling etc):

If I run a benchmark, the SoC will throttle to stay below 80°C, and then further throttle down to keep the battery below 42°C (screenshot attached).

So my current guess is that either the "sensor" or the "current throttle" in the thermal config are somehow broken. I'll report back when I have some figures.
[Xperia Z5 Compact Android Development] Berni-0815:
(y)

That sounds really good!

My hope is that in the end we find a solution for the thermal issue and I can remove the warning in my 1st post.
[Xperia Z5 Compact Android Development] Max8719:
Hello Berni,

i just wanted to give you a quick reply to this rom. I'm using this rom now for three weeks and so far I'm very happy with it. Performance is very stable and smooth. I also have no overheating problems when charging the phone. ( I'm using the shipped charger)

Camera is also okay. For me it's not a big problem that only eight megapixel shoots are possible. I always only used the eight megapixel mode to save storage and because there is not much difference in picture quality. More megapixel do not automatic produce better pictures. Better video functionality would be more important to me .

I'm using the google camera. I think the app is more stabe than snap camera, easy to use and produce not bad daylight shoots.

I use this version:

https://www.apkmirror.com/apk/googl...amera-5-1-018-177624777-android-apk-download/

Maybe someone want to try the app. Thank you for your hard work berni . It's nice to have the latest Android version on a more than five years old phone. (y)
[Xperia Z5 Compact Android Development] marvelary:
Can't we use a more recent version of gcam? I'm interested to know how you came to use this particular build, maybe I could do some more research to see if there is a newer version that works?

Hi Berni, there's something I don't understand the version you gave in this message if I understood correctly is no longer concerned by the thermal warning of the first post? Sorry if the question seems silly of course I hadn't installed a custom rom since a Galaxy S3
[Xperia Z5 Compact Android Development] uncle-sam:
Wow, this one is really working!

I've tested it with some different scenes and for me the built in snap takes better photos. Also focus in short distance is not working.

Generally the snap image quality is better then any third party app - especially the denoising and contrast/saturation settings look more satisfying. Why is that? Is snap already using some oft the built in camera2api features or some LOS enhancement algorithms?
[Xperia Z5 Compact Android Development] 1ggn3:
There we go, this time in a somewhat controlled way. This should be the version without the 45°C kernel limit, right? So from the graph, it looks like that the userspace thermal limits work!

Note that I forgot to disable my charge limit app (set to 80%), so the "fill up" part at 31:40 is most likely caused by that limit.

I want to give it one more try with some intentional heating (eg with a benchmark loop), to see if it throttles charging as well, but it's looking really good so far. Keep in mind that this is all with a fully booted ROM, since I don't know how to measure temperatures in charger mode.
[Xperia Z5 Compact Android Development] Max8719:
I simply tested different builds, starting with a Android 11 build, then 10 and so on. So I found out that the lastet Android 8 build is working on this device.

I just tested several versions, so i don't no if a newer version is working. You can try some newer versions, but I don't think that a version above Android 8 is working.

I also think that a newer version would change much in terms of overall picture quality, because I guess that the device could not really use the improved software. But that's just guessing......
[Xperia Z5 Compact Android Development] Berni-0815:
I hope that this version is working as expected. Since I don't have a high power charger, I can't test it myself.
[Xperia Z5 Compact Android Development] Berni-0815:
Yes. The thresholds at 45°C have been removed in this version. You told me that this limitation has been too aggressive...

I have an infrared thermometer. But this can only measure temperatures on surfaces, not internally.
[Xperia Z5 Compact Android Development] 1ggn3:
All right, I was just asking if I got the right version - I already know the kernel limits work (y)

Actually, the battery temperature range is somewhat close to human temperatures - maybe I can tape a medical thermometer to the battery... :unsure:
[Xperia Z5 Compact Android Development] 1ggn3:
Wait, what? I just tried to prove that it works fine :unsure:

I agree that it's not as snappy as previous versions, but it is still very usable, and after it calmed down after the first boot, it does not get any hotter than previous versions.

When you do demanding tasks like video streams, sure, it gets warm, but it should not get any hotter than with other ROMs? Did you check any temperatures?
[Xperia Z5 Compact Android Development] uncle-sam:
I don't know why, but I experienced heating and lags after a clean install over modified stock rom. It never worked properly until I flashed the original stock rom. Also the clean install over los 15.1 turned out bad on my device.

There is no science or prove in this but I think it could be one reason for issues with this rom.
[Xperia Z5 Compact Android Development] uncle-sam:
Yes, i experienced the same. In one case coming from modified stock and in the other from 15.1. If you're able try to flash with Emma (seems to work with win10) the last stock rom and flash again twrp and Bernis 18.1. This worked for me.

Edit: In this case I also had sensor issues with 18.1. Since the complete fresh install it works fine.
[Xperia Z5 Compact Android Development] /**/:
Using the 18.1 builds (at least the last two that appeared in the first post of this thread) some apps "stop working" if the device has been charging for a while, and I have to reboot the phone:

- personalDNSfilter stops working and its notification says it's inactive.

- acc (should prevent charging above a custom battery level) just does not work (I find that battery level is 100%).

- WhatsApp complains about running out of storage space.

- Maybe more.

it happens most often a couple of hours without user interaction, but sometimes even earlier, and it did *not* happen with 17.1.

Is anybody else experiencing this issue?

I'm not really an Android expert, can you advise on which logs I should collect (or other ways to investigate)?
[Xperia Z5 Compact Android Development] 1ggn3:
I did a clean stock install from FlashTool, booted that, and then flashed TWRP ("recovery_suzuran_230218.img"), wiped everything and installed 17.1. After that, I updated to 18.1. At the first boot, the device got pretty hot, with the GMS service using up the cpu, but after a few minutes (might have rebooted, I don't remeber) it calmed down. Now the phone stays as cold as 14.1.

You can check what uses all the CPU from an adb root shell: just run "htop" and it should show you the processes sorted by CPU. I think you need root to see all apps there.
[Xperia Z5 Compact Android Development] uncle-sam:
Smooth, cool and without sensor issues. I am using twrp 3.2.1. I had some trouble flashing it. It only works roundabout every 5th time. I think this is due to the driver incompatibilty to win10. For some reason flashing twrp 3.0.1 worked better but seems not to work with 18.1.

Sorry I wouldn't change the running system since it's working for now. But I suggest to do a complete reinstall as I mentioned before:

- flash latest stock rom with Emma (or flashtool)

- flash twrp 3.2.1 via fastboot

- flash latest los via twrp (with nikgapps if needed - I am using the core version)

- Reboot with patience - the setup of LOS might be a little slow and laggy but afterwards it should be fine.

And never try to reinstall a systembackup from an older twrp version - this never worked on my device.
[Xperia Z5 Compact Android Development] uncle-sam:
I did not experience such errors...
[Xperia Z5 Compact Android Development] Berni-0815:
New version out; see 1st post.

Android security patch level: 5 February 2021

Offline charging should no longer overheat the device

General overheating issue should be fixed by now
[Xperia Z5 Compact Android Development] litelinux:
My two cents...

I used the version quoted here, and it's smooth as usual. CPU still heats up but not over 50 (which is great).
[Xperia Z5 Compact Android Development] litelinux:
For those who noticed, after setting the wallpaper, the resolution gets lowered and looks blurry.

To solve this I set the wallpaper with a different method:

Crop wallpapers to 9:16

Locate /data/system/users/0/wallpaper_info.xml and change values "width" and "height" to their respective values of the cropped wallpapers. (Note that the one on top is for homescreen, bottom is for lockscreen)

Rename your wallpapers to the following without the brackets:

wallpaper (homescreen)

wallpaper_orig (homescreen)

wallpaper_lock (lockscreen)

wallpaper_orig_lock (lockscreen)

Copy them into /data/system/users/0 (replace existing files)

Reboot, Voila

Source has other methods I haven't tested.
[Xperia Z5 Compact Android Development] Berni-0815:
There is a newer version available; see 1st post.
[Xperia Z5 Compact Android Development] Berni-0815:
Crap! I've just noticed, that adb doesn't work any longer in my latest build!

I have to investigate it further; please be patient.

My bad! USB debugging has been reset; don't know why...
[Xperia Z5 Compact Android Development] Berni-0815:
In my experience, this only occurs when the background image does not meet the 16 * 9 size ratio.

For example 1280 * 720 pixels. This is the physical screen size of this device.

In the background settings, each image is reduced to a height of 1280 pixels.

The size of the image itself doesn't matter at all here.

Every picture that does not meet the 16 * 9 size ratio will be converted accordingly.

This is why an image may appear blurry.
[Xperia Z5 Compact Android Development] litelinux:
In my case the image appears blurry even when the image is 16:9.

The first screenshot is set with the method posted above, the second is with Styles and Wallpapers.
[Xperia Z5 Compact Android Development] Berni-0815:
I've tested it with a picture that has the physical screens size (1280 * 720) and there is no blur to see.

But everyone should do as he want to. Feel free to set it to your needs. ;)
[Xperia Z5 Compact Android Development] YamiYukiSenpai:
Please delete this

Wrong thread
[Xperia Z5 Compact Android Development] qwerta12:
why does the camera shoot at 8 mp?
[Xperia Z5 Compact Android Development] Berni-0815:
OMG! Please read the whole thread before asking questions!
[Xperia Z5 Compact Android Development] litelinux:
Hello @Berni-0815 How can I make unifiednlp work? Everything's checked except for "System supports location provider".
[Xperia Z5 Compact Android Development] Berni-0815:
I've never manages this to work. Maybe you follow the hint with XPosed?
[Xperia Z5 Compact Android Development] Berni-0815:
I've made a little improvement:

suzuran:/ # dd if=/dev/zero of=/sdcard/output2 count=65536
65536+0 records in
65536+0 records out
33554432 bytes (32 M) copied, 9.501779 s, 3.3 M/s

I know, this is far away from 59M/s, but better than before. I don't know where to look into any more.
[Xperia Z5 Compact Android Development] 1ggn3:
Sorry, I was busy for a few days. @Berni-0815 , big thanks for looking into the charging issue! I've tested the changes now for a few days with different chargers, and I noticed no difference between this and 14.1-17.1 - everything looks fine to me.

One small detail, I've always tested charging with a fully booted Android only, mainly because I don't know how to measure stuff in the charger (the "battery icon animation").

Anyway, I think the charger runs on a Linux kernel? So at the very least the kernel limits should still be there. From a general rule-of-thumb Li-Ion point of view, those might slightly shorten the battery lifetime, but they should be low enough to prevent any real damage.

I'm still on my first battery, and I'll probably use it until I decide to get a new phone. So I'm going to continue charging with a booted Android, just to be on the safe side and maybe to squeeze out a few more months of battery lifetime.
[Xperia Z5 Compact Android Development] 1ggn3:
I never had those issues. I had different issues, but never those...

Btw, for the charge limit, I have been using "Battery Charge Limit" for a long time now. I like to think that it is a reason why my battery has survived my constant abuse ;)
[Xperia Z5 Compact Android Development] Berni-0815:
Crap! I've tried it several times and every result differs very large from the other. Minimum speed is ~900k/s, maximum is ~3M/s.

That means, my efforts have been useless...
[Xperia Z5 Compact Android Development] Berni-0815:
(y)

To be sure I've left my changes in the kernel.