yashsingh1/xdaforums huggingface dataset:
[Xperia Z1 Original Android Development] Poesini:
I really dont care about performance-benchmarking-wise... The device is hella snappy with the specs... All I care is about getting a great battery life so I propose SmartMax EPS (or just the plain one). Some basic info for SmartMax (I dont know the EPS version, maybe this? http://review.cyanogenmod.org/#/c/35432/ I really dont know how that works lol)

Ofast or O3 flags could help a bit (I know Andro already addressed this issue, but just saying)

About scheduler, well that could be the case as I suspect FIOPS is consuming some battery and NOOP would be the best battery combo (Maybe you can shed some light here?)

My knowledge is based on this kernel from n3ocort3x http://xdaforums.com/showthread.php?t=2236121 which is the last phone I had and with less battery than Z1 I had better battery life
[Xperia Z1 Original Android Development] prbassplayer:
... that governor is exactly the same as interactive...... only difference is interactive defaults to 300mhz step... Ofast has been, in my past experience, a pain. I'm running O3 in my personal build, think it would be easier to run O3 + ffast-math. Next weekly will have O3 in kernel+ few other things :p
[Xperia Z1 Original Android Development] _Garry_:
For gov and io i prefered this - and its my reference - from my old s2 times:

http://xdaforums.com/showthread.php?t=1369817

Ofc its not up to date, but imo the base information are still be the same as for other phones.

Gesendet von meinem Xperia Z1 mit Tapatalk
[Xperia Z1 Original Android Development] Destroyedbeauty:
Anyone that can share how PegasusQ is performing when it comes to battery saving on the Z1? I did remember that PegasusQ was an beast when it did come to save battery juice on the Samsung Galaxy S3 - is it the same here, or worse or better?
[Xperia Z1 Original Android Development] Juzman:
I've found intellidemand / eco mode / deadline. CPU max 1200, GPU max 200 best for battery.
[Xperia Z1 Original Android Development] madmikeuk:
Using this kernel with the latest CM11 nightly and I just get bootloops at the kernel. Doesn't even make it to the CM splash.
[Xperia Z1 Original Android Development] Juzman:
Download the "cm" kernel a few pages back.
[Xperia Z1 Original Android Development] ->---:
Why should it be useful to have another governor for screen off? I do not know the settings from intellidemand or intelliactive, but boostedassv2 fixed max freq on screen of at minimum freq (adjustable). Deep sleep would not need any governor, because deep sleep means cpu is nearly offline - no frequency is set.
[Xperia Z1 Original Android Development] prbassplayer:
Make it more restrictive, but it's not a solution to the underlying problem, have apps working while screen is off :p
[Xperia Z1 Original Android Development] Destroyedbeauty:
There is both highs and lows with screen off governors - faster wakeups / screen-on and less drainage when forcing & enabling CPU out of sleep states.

But then, it will drain small amount of battery if always active at lowest screen off freq, and maybe causing some weird lag when shifting between the governors in screen off / on state..
[Xperia Z1 Original Android Development] Poesini:
Deep sleep is actually more than just CPU, but yeah I wouldnt care about governors with screen offline as long as there are no wakelocks in which case it will be different
[Xperia Z1 Original Android Development] ->---:
If a gov caps freq in screen off at min freq, it is always enough power to run things like mp3 players without any problems. Thats my experience with that (single core cpu, 512MB RAM).

Switching the governor always caused a lag while activating the screen.

I would also know just one use case where a cap would be counterproductive. Huge amounts of data transfer during screen off, maybe transferring a whole directory of music through WLAN while on battery power. But how often that would be the case?

Well, maybe I am wrong and there are other cases too which would profit from more than 300MHz?
[Xperia Z1 Original Android Development] _Garry_:
Well i just saw that some govs have a deep sleep and normal "mode". So adding a deep sleep gov option is not needed.

The problem of having 2 governors is the fact that you can't just use them, you need to look if they are "compatible".

I like to give some links and quotes but the GPU from my laptop just said goodbye yesterday and doing everything with my phone is a pain in thr ass.

Gesendet von meinem Xperia Z1 mit Tapatalk
[Xperia Z1 Original Android Development] Androguide.fr:
Most "good" governors already have a different behaviour when screen is on or off.

SmartassV2 for example exposes Kconfig flags for setting the ideal freq for when the device is awake and asleep, as well as the wake-up frequency:

CONFIG_SMARTASSV2_AWAKE_IDEAL_FREQ=1728000
CONFIG_SMARTASSV2_SLEEP_IDEAL_FREQ=729600
CONFIG_SMARTASSV2_SLEEP_WAKEUP_FREQ=2150400

Intellidemand also exposes Kconfig flags for setting the max freq for when the screen is on/off (Intelliactive is also screen-aware):

CONFIG_INTELLI_MAX_ACTIVE_FREQ=2150400
CONFIG_INTELLI_MAX_INACTIVE_FREQ=1497600

Lagfree is another example:

CONFIG_LAGFREE_FREQ_SLEEP_MAX=422400
CONFIG_LAGFREE_FREQ_AWAKE_MIN=300000
[Xperia Z1 Original Android Development] Destroyedbeauty:
And this means? *noob sometimes*
[Xperia Z1 Original Android Development] Androguide.fr:
This means that when building the kernel you can set the above parameters for those governors, like limiting the max cpu frequency when the screen is off, or the 'ideal' frequency towards which the governor tries to stay at (usually by ramping-up faster when it's below, and ramping-up slower/ramping-down faster when it's above) when the screen is off vs when the screen is on.

Those parameters are probably also exposed to sysfs, in /sys/devices/system/cpu/cpufreq/[governor_name]
[Xperia Z1 Original Android Development] ->---:
Is it possible to set this to 300000? Maybe with some kind of app or an init.d script?
[Xperia Z1 Original Android Development] Androguide.fr:
Unfortunately this can only be done at build-time, but I can build one with this if you wanna give it a try, lemme know.

I re-added most of the "main" features on top of the new sources, plus some new governors (darkness, alucard, ondemandplus), lazy to do a changelog right now, it's late.

Download
[Xperia Z1 Original Android Development] 3x3cUt0r:
i'm eagerly waiting for a F2FS version :D, thanks for all your hard work.
[Xperia Z1 Original Android Development] Poesini:
Is the last kernel F2FS?

And which ROMs are compatible with it?
[Xperia Z1 Original Android Development] ->---:
Yeah, that would be great :)

Sent from my Xperia Z1 using Forum Fiend v1.1.7.
[Xperia Z1 Original Android Development] Destroyedbeauty:
Is the build working with OmniROM build 0315?
[Xperia Z1 Original Android Development] andymg350:
hey, I've been thinking about trying out this kernel with carbon ROM and was wondering if anyone has tried it yet? if not which version do I need to download? im using exFat for my sdcard :confused:
[Xperia Z1 Original Android Development] Androguide.fr:
Nope, use the previous builds for Omni.

This is for roms using the new sources, so at least released this month.

I know CM & Slim are compatible, don't know if the other roms migrated to the new sources yet.

This one is only ext4, f2fs coming back soon.

See above about compatible roms
[Xperia Z1 Original Android Development] Juzman:
Working fine on CM11 20140410. :)

However. For battery. Would it be better to use alucard hotplug with max cores at 2, or intelliplug + eco mode + max cores at 2 + power suspend? I'm thinking the latter.
[Xperia Z1 Original Android Development] Androguide.fr:
I don't know, it basically comes down to which driver is the best in that regards, as having intelliplug with eco mode at 2 cores or Alucard hotplug with 2 max cores is pretty much the same thing.

I'd assume faux's driver is better too, but this warrants testing.
[Xperia Z1 Original Android Development] Juzman:
That's what I was thinking too. Never heard about alucard until now. I will stick with Faux's stuff. :)
[Xperia Z1 Original Android Development] andymg350:
I've just flashed this on my c6903 z1 using carbon ROM, so far so good no problems or fc's just wanted to confirm its working :)

edit: i may have spoken to soon as im having a problem getting into the recovery, i also tried fastboot flashing the boot.IMG and its still not working, the lights appear but when I press vol keys it goes to load but its just blank and the screen seems to go on and off.

edit2: i reflashed using 04/03 boot.img pimped kernel and all seems to be working perfectly now including recovery!

Sent from my Xperia Z1 C6903
[Xperia Z1 Original Android Development] NiM72NiK:
I use romaur and I wanted to test the pimped kernel... but when i flash the kernel ,the kernel logo shows up,but it sticks at a boot loop. and the recovery just shows a flashing on and off screen...both ext4 and f2fs are like this...what to do?
[Xperia Z1 Original Android Development] Destroyedbeauty:
Pimped Kernel is based on CM-kernel sources, with other words.. Pure Open Source Code, so it will not work at stock Sony / stock based ROMS. Flash back Doomkernel / Advanced Stock / stock kernel and get rid of that bootloop and READ instructions next time. Please..
[Xperia Z1 Original Android Development] NiM72NiK:
ok so you mean this kernel only works on cm roms? huh? ok I have to get to recovery to flash the cm rom.but I cant enter to recovery with this rom at all.even after re flashing .136 ftf
[Xperia Z1 Original Android Development] Destroyedbeauty:
It's only working on ROMS that is based on sources provided by CM, as far as I know, I am no expert at this field (yet..). Stock ROMS requires kernels that is based on sources by Sony to work and boot up the phone.

A little lesson for you;

Stock ROM = Stock Kernels = Stock / Advanced Stock / Doomkernel..

AOSP / AOKP / CM / PAC / PA / etc etc = Custom Kernels = Stock CM kernel / Pimped Kernel / MEOW Kernel and so on..

See it? :)

It's totally different between stock and AOSP / CM / similar ROMS when it comes to kernels. WLAN modules is one of the biggest differents, also the kernel features is different on AOSP compared to stock kernel sources.

Thanks to easier integration, we got magic things working on our Z1, like Intelliplug & ECO-Mode by [MENTION=3332811]faux123[/MENTION], Gamma / color control etc etc, while this is requiring a hell lot of testing / re-writing / searching after proper replacement wlan modules on stock, one another reason why your phone is bootlooping thanks to kernel low-level panics and "faulty optimized" WLAN modules & sources.

I rather recommend you to reflash a WHOLE FTF of latest FIRMWARE for your specific Z1 model and start from scratch again, for getting RID of your nasty bootloop issue. Then, visit this thread again and ask if you need proper install instructions. Also.. Yeah, I don't know what to say sometimes when people lost talent / time / interest to read the thread title that clearly states:

-> [KERNEL][CM-based]​
[Xperia Z1 Original Android Development] ->---:
I have some kind of unwanted behavior on my XZ1. After loading my phone it seems to consume more power when screen is off, than before the loading procedure. The unloading graph shows nearly a straight line before loading (~1%/5-6h), after that it consumes about 1% every 2 hours. After a reboot all is fine again - but I do not want to reboot after every loading session. What can possibly cause that higher power drain? Some kind of deep sleep error?

On older android versions there was the possibility to look which app consumed how much on power. That seems to be missing since 4.4? I had an app where I could check that consumption (Battery Widget Pro from JH Jeong). On 4.2 it was working, on every device with 4.4 or higher this feature has dissapeared. How can I look which app is possibly the reason for that?
[Xperia Z1 Original Android Development] Destroyedbeauty:
This is easy to fix..

When your phone is reporting that the battery is "Full" under the About Phone section, shut down your phone and let it boot into offline charge mode a couple of minutes and then boot into system and let it load / start / boot properly so everything stabilizes, then turn off the screen and wait 1-2 minutes so phone enter full deep sleep state and unplug charger by disconnecting plug from phone first - not wall socket!
[Xperia Z1 Original Android Development] ->---:
Do I have to do that every time I charge or just once?
[Xperia Z1 Original Android Development] Destroyedbeauty:
Yup, looks like so. I've tried to remove the charger straight after full charge w/o following my method and that started the insane battery drain.
[Xperia Z1 Original Android Development] ->---:
:D Sorry to bother again, but that did not answer my question. Is it a workaround which works once or a permanent solution which has to be done just once?
[Xperia Z1 Original Android Development] Destroyedbeauty:
It has to be done everytime, after each full charge, (= "Full" under Battery level in the About Phone section).
[Xperia Z1 Original Android Development] ->---:
Well, thanks. Thats the thing I just wanted not to do. A reboot every time after charging :( I hope this bug will be fixed some day.
[Xperia Z1 Original Android Development] Destroyedbeauty:
I wanted to throw my Z1 in front of a train first time I saw this drain, but then.. I thought; "Why not test a couple of things and see if the "bug" can be fixed / reduced" and voila - I found the most optimal solution.
[Xperia Z1 Original Android Development] ->---:
Well, I had the same issue on my old Milestone2 (CM10.2). So I think it is android related, not device or kernel. It has to be something thats activated by the loading process and is not deactivated afterwards. And therefore it causes higher power drain. So there has detective work to be done. Maybe somebody knows android enough to create a list of processes and programs that are activated while loading. Sadly my insights into android are not deep enough.
[Xperia Z1 Original Android Development] Destroyedbeauty:
It was a similar problem on my old & sold Galaxy S3 - if I did remove the phone from charger and didn't reboot - the battery started to act crazy and drain in a rapid speed.

I got my own theories on this issue, and why they're starting and why they're occuring..
[Xperia Z1 Original Android Development] husky69:
Tried 20140405 version on latest SlimKat (build 4 - 3726), but it failed horribly - phone never came up again :(

It showed the kernel logo and rebooted after a while before showing boot animation. Entering recovery was impossible. Sometimes during the reboot cycles the LED got purple, so I hit VOL DOWN, but then screen just went black - but recovery didn't come up. Sometimes the phone was displayed by adb, but it always was "offline", so I can't provide any logcats.

In case anyone else runs into this - my only way back to a working phone was to flash a stock ROM through FlashTool, install DoomKernel via fastboot and boot into recovery in order to restore my backup :eek:

If there's something I can do to help solve this, please tell me here - I'll be happy to do so (after taking backups, of course...)
[Xperia Z1 Original Android Development] Androguide.fr:
Just read at least a couple pages of the thread next time...

This is completely normal, 04/05's recovery is borked, you can use 04/03 for pre-caf Roms or the latest build (Pimped-Kernel-caf-v1.0.zip) is for post-caf Roms like latest CM nightly & Slim weekly.

You could have simply fastbooted Slim's boot.img or the right pimped kernel build (you can access the bootloader by pressing vol. up while plugging in the device) , instead of going through flashtool and wiping your data.
[Xperia Z1 Original Android Development] andymg350:
If u read a few posts back I also had this problem and fixed it using the boot.img from pimp kernel build 04/03 not 04/05

Sent from my Xperia Z1 C6903
[Xperia Z1 Original Android Development] Poesini:
Tried new CAF kernel with ext4 ( :( back to ext4 )

It is really snappy :much good: :so fast: :nice speed: (ok enough with doge)

But its lacking the tcp congestion, 2.3 OC and SnakeCharmer (so far I have seen)

Good news is now the lowest GPU speed is 200 and not 27 and it could be me, but volume is hella way louder

Props on the CAF stuff :)
[Xperia Z1 Original Android Development] Androguide.fr:
Yeah, I got the TCP algorithms & I/O schedulers back-in today (+ the VR io scheduler which we didn't have before).

I'm having some issues with snake charmer but it should be fixed soon.

I also added back f2fs support, but I need to test it before releasing.

The volume being louder is probably ROM-related, unless you changed your Sound Control settings.

This makes me think I need to add slimbus overclocking back.

I take no credit for the caf stuff, you can thank Ethan Chen (intervigilium) for putting together the base caf CM kernel.
[Xperia Z1 Original Android Development] CappyT:
[MENTION=4752917]Androguide.fr[/MENTION]

Camera crash taking a picture & kernel reboots...

Checked twice.

Last kmsg here:

https://www.dropbox.com/s/c7id3gh0ze8q64d/2014-04-10_17.36-camera.zip

Other things:

- very high battery drain

- low headset mic volume (stock wired headset)

- sometimes very high ram usage, like a leak or something (didn't installed new apps since 05/04 version)

Edit:

From the log seemed to be issues with KSM, disabled it.

Now it's taking pictures...

Inviato dal mio Xperia Z1 utilizzando Tapatalk
[Xperia Z1 Original Android Development] husky69:
What is caf?
[Xperia Z1 Original Android Development] CappyT:
Code Aurora F... (Framework?)

https://www.codeaurora.org/
[Xperia Z1 Original Android Development] Juzman:
I'm guessing you will also be updating CWM to 6.0.4.8 to coincide with new CM11 release too?
[Xperia Z1 Original Android Development] infatality:
Code Aurora Forum
[Xperia Z1 Original Android Development] husky69:
Had a look at the site, but it's confusing to me - too many projects, and I can't tell which of them are of use for our device.

Androguide.fr, can you explain a little? I'd appreciate :)
[Xperia Z1 Original Android Development] Poesini:
http://lmgtfy.com/?q=caf+based+rom

Can lead you to this:

http://www.reddit.com/r/Android/comments/1rt9md/eli5_what_is_caf_why_is_cm_going_caf_affects_the/

And more and more for you to read
[Xperia Z1 Original Android Development] husky69:
For the records: After the total breakdown of my phone after flashing 0405 kernel I tried 0403 kernel today. Didn't succeed, kernel didn't boot into ROM, and restore wasn't possible, because I used TWRP. for backup, but this kernel had CWM included...
[Xperia Z1 Original Android Development] ->---:
http://xdaforums.com/showthread.php?t=2261606
[Xperia Z1 Original Android Development] Poesini:
Or you can go back to http://d-h.st/kAw which is the latest Pimped Kernel with TWRP and f2fs
[Xperia Z1 Original Android Development] ->---:
What's this theorie? Is there any kind of log where all program, system and kernel activities are logged? Maybe I can compare them before and after loading the accu.
[Xperia Z1 Original Android Development] Destroyedbeauty:
My theory is that there is something at fuel gauge level that isn't calibrating / reading the actual battery level correctly when charging full (=Under the column that shows what the actual battery level is under About Phone section), which is making it thinking there is less procentage than there actually is and this is causing heavily battery drain until rebooting the phone so the fuel gauge can clean up itself and start to read the battery level from scratch again.

I did notice this yesterday after removing my Z1 from charger, the battery started to act crazy the first 15-20% procentage before it calmed down and started to show normal drain. Will let the battery drain to 0% and charge it full in offline mode and boot it up again unplugged and see if the issue are solved / removed / fixed / reduced afterwards. Interesting it is, however.

Maybe a battery calibration init.d script can improve this, I don't know? [MENTION=4340984]krabappel2548[/MENTION] did a script of this kind on a ROM for Xperia S (Acro S?) that perhaps worked for some?
[Xperia Z1 Original Android Development] Juzman:
There isn't such thing. The calibration scripts just delete batterystats.bin file.
[Xperia Z1 Original Android Development] juicio90:
How can I get log for this app? Want to upload here...
[Xperia Z1 Original Android Development] Juzman:
Flashed latest CM zip. Working well. Just need to include intellidemand e.t.c. ;)
[Xperia Z1 Original Android Development] ChrisFirerabbit:
For some odd reason, it still doesn't work for me, but the boot.img for the Free Xperia 4.4 Project works well.
[Xperia Z1 Original Android Development] juicio90:
Same here...
[Xperia Z1 Original Android Development] lowrider_05:
i´m on Liquid Smooth rom and i have NO FC´s more and no random reboots so its working great, but not every feature is there i can´t set the power management or Fsync in the PimpmyZ1 or it crashes. GPU oc is working in the tool
[Xperia Z1 Original Android Development] Androguide.fr:
Yeah I built it from work and apparently I forgot to update my local repos.

I'm currently in the process of restarting the doomkernel features port from scratch (i.e: from the latest CM kernel), my git history was a mess.

Hopefully this will allow me to get VDD control and CPU overclock to work, and get a few more build optimizations in there.

From now on I will use only the CM ramdisk for the builds, as it's compatible with any rom.
[Xperia Z1 Original Android Development] Androguide.fr:
Thanks a lot for the bug reports :good:

As I said in my previous post I'm restarting from scratch to put things in order and hopefully get cpu overclock, voltage control, intellithermal, etc.. to work.

About the GPU overclock, the path to the sysfs interface is

/sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/max_gpuclk

You can check the available frequencies using:

cat /sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/gpu_available_frequencies

For sound control, I'll fix the fact that it doesn't stick at boot asap. You can do it with a script, but you'll need to do some bitwise calculation first.

For the digital headphone gain, the formula is as follows, where LEFT is the left gain & RIGHT is the right gain:

255 & (255 ^ (LEFT & 255) + (RIGHT & 255))

Please note that for negative values, you have to consider 256 as the representation of 0, so if you want to apply a -2 gain for example, you would use 254, for -3: 253, for -4: 252, and so on...

You can use http://www.compileonline.com/compile_java_online.php to do the bitwise calculation.

For example, let's say we want to apply a +2 gain for the left channel and a +4 gain for the right channel, just replace "System.out.println("Hello World");" with the following then press execute:

System.out.println(0xFF & (0xFF ^ (2 & 0xFF) + (4 & 0xFF)));

This gives us 249, now to actually apply our values, we use echo "left right bitrepresentation":

echo "2 4 249" > /sys/kernel/sound_control_3/gpl_headphone_gain

Now if you cat the file, you get 2 4, as expected:

$ cat /sys/kernel/sound_control_3/gpl_headphone_gain
$ 2 4

For the analog headphone gain there's one more twist, +6 is 32, and -6 is 44, so just adjust on that scale, for example 0 would be 38.

Same as above, you need the bit representation, so for example if you want +6 on both left & right:

echo "32 32 191" > /sys/kernel/sound_control_3/gpl_headphone_pa_gain

All this took me a while to figure out while writing the app^^
[Xperia Z1 Original Android Development] gallardo5:
Thanks for that, I will save it for later use :) unfortunately I had to go back to CM kernel for a while as camera is important for me, but I will test your kernel everytime you update it :)