yashsingh1/xdaforums huggingface dataset:
[Galaxy S 5 Original Android Development] festr:
lightflow can only cycle through notifications but each cycle needs wakelock. What I'm looking for is that if there is multiple notifications I want to see different color for that combination which does not need any CPU service / cycle etc. and I still know that I have missed call + whatsupp for example and it seems non of such applications can do that.

I'm also curious how it is possible that lightflow is able to override the kernel settings - when I set in lightflow that some notification should be solid RED it stays RED even though I set blinking in the kernel. How the LED notification message is layered?

But I'm facing to another problem which is related to the android itself or the TW ROM - the blue led notification from missed call (tw rom default) is overriding all applications like lightflow or light manager which correctly sets led colors I want for missed call (I use RED) - sometimes it is RED but most of time it falls back to blue like both applicaitons interfere to each other. It is pretty inconsitent and I cannot find any setting which does consitent behaviour. And what is funny is that facebook messanger can do green notification out of the box as well as whatsup lights the LED white while missed call / hangouts / sms are all blue. Obviously no way to customize it :D
[Galaxy S 5 Original Android Development] Many40:
[MENTION=947981]Lord Boeffla[/MENTION],

I have a question related to your pegasusq governor implementation.

In the past, when I was using Siyah kernel by Gokhanmoral on my s2, the pegasusq implemented into the kernel was a multicore aware governor what means it had its own logic to control hotplugging. When pegasusq was chosen it automatically deactivated Stand Hotplug in order to not have two logics to do the same thing at the same time and to not create conflicts.

That's why pegasusq governor of Siyah kernel had some additional tunables to control hotplugging.

In your implementation I can't see any available hotplug tunables so does it mean that your pegasusq implementation doesn't have its own hotplug logic and default logic (Stand hotplug) is still in use?

Interesting thing is that (according to RC @ droidphile) pegasusq was originally authored by Samsung for quad core devices.

Thanks
[Galaxy S 5 Original Android Development] andip71:
Good question, might we worth asking the Lightflow developers which sysfs files they use to control the LED.

I guess, they are using lots of hardware-dependent custom access to low level nodes. I have no clue how lightflow internally works.

This is true!

On the S3 Exynos devices, hotplugging was responsibility of the governor itself.

However, in our Snapdragon world here, hotplugging is done outside of the govneror. Standard (which I use in my kernel being close-to-stock) is the Qualcomm mpdecision process, some other kernels implement custom hotplugging as well.

In any case, hotplugging is not done by the governor on Snapdragon devices like the S5 or OnePlus One, so these tunables are not available.

Hope it is clear now.

Cheers

Andi
[Galaxy S 5 Original Android Development] festr:
I mean how it is done in samsung kernel - through the sysfs? There are more ways to control the LED?
[Galaxy S 5 Original Android Development] andip71:
There are for sure more ways to control the LED, yes.

Official sysfs interfaces, Android itself uses. But there are also low level specific ones. Maybe lightflow controls them after detecting the hardware.

I do not know, notification LED was never such an important topic I did completely read through the full code :)

Andi
[Galaxy S 5 Original Android Development] festr:
ok so there are more approaches how to control the LED but I guess that the android apps just sends something like "light the LED with this color" but what did you do exactly in the kernel? I'm trying to understand to it on very low level (I had done some kernel modifications so you can speak to me freely :)
[Galaxy S 5 Original Android Development] andip71:
Then I think, you should go into my github and check the commit? This shows you on low level what I did :)

I cannot explain the code in easy words quickly.

Andi
[Galaxy S 5 Original Android Development] festr:
ok so I have read the whole driver source and I have two things:

- /sys/class/sec/led/led_intensity - 41-255 : brighter than Samsung stock - but in your app you only allow values up to 130 - do you multiply it by 2? Because when I set it to 130 I do not get the full brightness so there must be some error (only if I set it to 0)

in the code below if I set the intensity to 0 brightness is set to LED_R_CURRENT so CM stock behaviour but if I set it to 130 for example it is set to 130 / LED_DYNAMIC_CURRENT and beacuse LED_DYNAMIC_CURRENT is 0x28 I believe something is wrong or you sent in the end another values to the /sys/class/sec/led/led_intensity file?

/* Yank555.lu : Control LED intensity (normal, bright) */

if (led_intensity == 0) {

r_brightness = LED_R_CURRENT; /* CM stock behaviour */

g_brightness = LED_G_CURRENT;

b_brightness = LED_B_CURRENT;

} else {

r_brightness = led_intensity / LED_DYNAMIC_CURRENT;

g_brightness = led_intensity / LED_DYNAMIC_CURRENT;

b_brightness = led_intensity / LED_DYNAMIC_CURRENT;

}

- samsung is using some specific stuff it seems which uses an30259a_start_led_pattern function where there are few modes like CHARGING, CHARGING_ERR, MISSED_NOTI, LOW_BATTERY, FULLY_CHARGED, POWERING

the driver provides few interfaces like led_pattern, led_blink, led_fade, led_intensity, led_speed, led_slope, led_br_lev and led_lowpower

So now it is much more clear how the applications like lightflow uses the driver to set the LED and here I think is the problem - the samsung rom is indeed using led_pattern and sets mod MISSED_NOTI which resets any previous LED states.

Andi can you please add one test feature for me : allow disabling in drivers/leds/leds-an30259a.c line 442 where is	case MISSED_NOTI: - disable the whole code so the LED hw is not programmed? Ideally it would be nice if your apk can control if this mod is disabled. I believe that this mode MISSED_NOTI is resetting my LED notifications from other applications like the lightflow EDIT: the whole function an30259a_start_led_pattern must be disabled since there is /* Set all LEDs Off */	an30259a_reset_register_work(reset); function at the beginning.

edit: I overlooked that the interface led_fade, led_intensity, led_speed, led_slope were added by your patch so those must be supported in lightflow and others if it should work which I have to confirm with the developers. Seems like this is already in cyanogenmod.

---------- Post added at 03:22 PM ---------- Previous post was at 02:53 PM ----------

and here is my idea about the patch : download.voipmonitor.org/leds-an30259a.c.patch

it adds disable_samsung_pattern with default value 0 and if set to 1 it should disable the MISSED_NOTI

maybe you can build much simpler test build for me with just disabled the whole function an30259a_start_led_pattern to see if it will work at least.
[Galaxy S 5 Original Android Development] ElenaPower:
When I turn it to 130 the LED is nearly off. Missed calls are blue for me and I did not see it flashing only in my dark room ;) With 0 intesitiy it looks like standard but standard is really low brightness.

With /sys/devices/virtual/sec/led/led_intensity other than 0 the led is nearly off for me. Boeffla Config sets it to max 130 but then it is very dark blue blinking/fading.
[Galaxy S 5 Original Android Development] andip71:
Well, maybe I should remove the whole LED control again if more people are unhappy with it than happy.

It works exactly as on the S3, so I thought people will like it on the S5 too. But if not, no issue to remove it.

I will think about it.

But what makes me wonder: If you configure fading to off, intensity to 40 and speed to 1 -> does it then not exactly work like stock??

Ok, I am off for rest of today.

We have "Fathers-Day" in Germany, and I was already for too long at my PC doing kernel stuff today. Rest of the day is reserved for my family.

CU again tomorrow

Andi
[Galaxy S 5 Original Android Development] festr:
Get out from the PC! :) lets talk about it later. The problem with LED is specific to Samsung and I have suggestion how to enhance the LED so it will work exactly how I want. And for the brightness please tell me what you exactly send to sysfs file and I will help with debugging (do you send the exact value 130 if I set 130?)
[Galaxy S 5 Original Android Development] andip71:
Yes, I send exactly the value in that you see in the app.

Cheers and off for today

Andi
[Galaxy S 5 Original Android Development] festr:
I wish I'm able to build the kernel from source so I can do experiments by myself and send you only patches. Can you do custom build for me if I provide you my git branch? Or did you ever write any howto how you exactly do builds?
[Galaxy S 5 Original Android Development] andip71:
Can do a test build for you tomorrow, no problem.

And building my kernel is pretty easy.

Clone my git repo, download 4.8 gcc toolchain and put it under /opt/toolchains (same path than in Makefile of my repo).

Then just start the bbuild.sh script in my repo with parameter a.

This will drop out a fully working kernel if all goes well.

But now: REALLY off :)

Andi
[Galaxy S 5 Original Android Development] festr:
I'm trying to find that toolchain would you please suggest where? I tried google but I got confused what I download and what I need :D
[Galaxy S 5 Original Android Development] ZaneZam:
https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8 ;)
[Galaxy S 5 Original Android Development] MIKEMON:
Good to know this issue

big thanks
[Galaxy S 5 Original Android Development] PIRATA!:
And about a porting to the Snapdragon 805 of S5 G906K??[emoji16]

Would love to help.[emoji18]
[Galaxy S 5 Original Android Development] Many40:
[MENTION=947981]Lord Boeffla[/MENTION],

Small issue which is nothing critical, just for the record (for your information):

I tweaked a little pegasusq governor by changing values of some tunables in the tunable profile from Boeffla configuration app. I could change most of them but one - sampling_rate_min (when I change the value, press "apply" then "ok" and when I enter the tunables again the value is unchanged. Is it something known by you?

Thanks
[Galaxy S 5 Original Android Development] festr:
Andi, I have managed to build the kernel from sources with my modification to LED driver which disables samsung pattern api and the lightflow is now not overriden by the blue led notification. I will polish the patch and finish debugging the brightness issue and provide you the patch. I will make disabling samsung pattern via sysfs file so you can integrate it to your app.
[Galaxy S 5 Original Android Development] andip71:
Welcome to the club of developers now :)

This is good stuff, as I am not having always enough time. So appreciate your efforts and will take it over once I reviewed it and you are done!

Thanks and pls keep us posted

Andi
[Galaxy S 5 Original Android Development] andip71:
Can you try to change the sampling_rate_min to the value you would like in another app, like root explorer etc?

I am pretty sure, you will have the same effect there. I.e. maybe you are hitting some limits/validations that are put in the governor for this tunable.

Andi
[Galaxy S 5 Original Android Development] festr:
yes it is a fun hacking kernel :D

I have send pull request from my git branch festr (https://github.com/voipmonitor/boeffla-kernel-samsung-s5/commits/festr)

brightness is fixed but I need that you will change the app and brightness slider. Values has to be between 0 - 255 but your slider is up to 130 and you can only slight by 5 points. It would be probably better if you allow to set exact value from 0 - 255 with slider is enough imho.

I have added /sys/devices/virtual/sec/led/disable_samsung_pattern which is set to 0 by default and it is standard behavior. If set to 1 it disables the annoying led blue light for notifications but you need third party app like lightflow. If set to 1 your app will also not work when testing LED notification fade/blink because this is applied for samsung notifications only so I suggest that if this will be se to 1 in your app will be disabled fade/blink/brightness settings. Instead of samsung pattern lightflow probably uses CM interface in this driver or led_r|g|b nodes which are not disabled - only the led_pattern node is disabled. It might be worth to implement testing LED in your apk by using such interface which are (and I believe which are used by lightflow but I have to confirm with devs).

those nodes in sysfs are samsung specific and I believe those are used by applications like whatsup which can set its own LED color on its own as well as facebook can do that and it must use those nodes since there is no other interface (on stock unmodified driver)

static DEVICE_ATTR(led_r, 0664, NULL, store_led_r);

static DEVICE_ATTR(led_g, 0664, NULL, store_led_g);

static DEVICE_ATTR(led_b, 0664, NULL, store_led_b);

those nodes were added by your patch (+ my disable_samsung_pattern) I'm not sure but they are probably backported from CM

static DEVICE_ATTR(disable_samsung_pattern, 0644, disable_samsung_pattern_on_show, disable_samsung_pattern_on_store);

static DEVICE_ATTR(led_blink, 0664, NULL, store_an30259a_led_blink);

static DEVICE_ATTR(led_fade, 0664, show_an30259a_led_fade, store_an30259a_led_fade);

static DEVICE_ATTR(led_intensity, 0664, show_an30259a_led_intensity, store_an30259a_led_intensity);

static DEVICE_ATTR(led_speed, 0664, show_an30259a_led_speed, store_an30259a_led_speed);

static DEVICE_ATTR(led_slope, 0664, show_an30259a_led_slope, store_an30259a_led_slope);

static DEVICE_ATTR(led_br_lev, 0664, NULL, store_an30259a_led_br_lev);

static DEVICE_ATTR(led_lowpower, 0664, NULL, store_an30259a_led_lowpower);
[Galaxy S 5 Original Android Development] Many40:
Just tried that but unfortunately with root explorer (partition mounted as r/w) I can't edit any of the tunables values, I only can view them (strange to be honest - maybe your "hack"?)

The value of sampling_rate_min is set by default to "10000" and whatever I set in the Boeffla config app it is not accepted. It looks like the tunable is not tweakable.

Btw I was not familiar with this tunable before (i.e. it wasn't implemented in the old s2 pegasusq - at least not available for the user for tweaking) so might be it is not so important ...
[Galaxy S 5 Original Android Development] andip71:
Hehe, yes, this is "locked" by my hack to prevent the rom from overwriting the tunables again.

So - you need to do the folloinwing:

1) before you want to modify the tunables, set tunable bk_locked to 0

2) then change your tunables

3) after done, set bk_locked to 1 again

As easy as that :)

Andi
[Galaxy S 5 Original Android Development] andip71:
Goodie, I will review the patch and see. Enabling the sliders to 255 is a simple thing, it does not even require an app change :)

You can even do yourself by changing the following in file ramdisk_boeffla/fs/res/bc/bccontroller.sh:

# LED brightness min/max/steps

echo "0;130;5"

here set 130 to 255 - and you are done :)

Andi
[Galaxy S 5 Original Android Development] Many40:
Hi,

It seems that you are a skilled programmer who has just started development on xda. Only thing which is bothering me is - what have you been doing before (2010 - joining year)? ;):D

Regards
[Galaxy S 5 Original Android Development] festr:
Nice :) But I do not need to set brightness since this is only for led_pattern which I disabled on my ROM :) besides that I was testing the brightness fix by setting values manually. I leave this complete up to you how you decide to control the brightness - once you review the fix you will see.
[Galaxy S 5 Original Android Development] andip71:
Ok, no worries.

Andi
[Galaxy S 5 Original Android Development] festr:
The LED control bothered me for very long time started on S3 through the S5 so enough is enough and I just diged in to the problem :D Besides that I have no enough time to play with all of this - 4 little kids and running a company is enough :D

---------- Post added at 11:47 AM ---------- Previous post was at 11:44 AM ----------

btw I'm really glad for the effort Lord Boeffla put into porting his work to the S5. This is the exact approach I was looked for - stable kernel with no nonsense patches. And the bbuild.sh script is well organized which allowed me to do compilation and flashing with just one command.
[Galaxy S 5 Original Android Development] andip71:
That was exactly the goal of it: Enable everyone to be able to recompile my kernels with minimum efforts. Seems, this was achieved :)

I also "hated" to answer the same questions over and over again about "how to build the kernel", as it is a quite complex process, especially the ramdisk patching stuff.

So, very happy to see people like a) my lean approach and b) the extra services they get with that script and my app.

Cheers

Andi
[Galaxy S 5 Original Android Development] festr:
the only obstacle was your binary mkbootimg which is shared compile with too new libc 2.14 which is not on my debian 7 so I had to recompile it for my libc so maybe static version would be better in the git (I can provide you statically compiled version which will run on any linux)

but besides this I was suprised that after running the bbuild I really got working img which I flashed and it booted. The script is masterpiece :D
[Galaxy S 5 Original Android Development] andip71:
Yeah, ok. My build machine is a xubuntu 14.04 LTS, probably a bit "newer" :)

Andi
[Galaxy S 5 Original Android Development] Many40:
It is not as easy as it seems to be :)

bk_locked tunable you implemented only to interactive governor - there is no such tunable in pegasusq.

Even if I change the governor back from pegasusq to interactive, the bk_locked tunable is not available from the Boeffla and can't be edited manually by root explorer.
[Galaxy S 5 Original Android Development] festr:
can you please someone confirm that if you call to your mobile that the time from first ring in caller phone takes about 5 seconds before the S5 shows ring screen? I have the same S5 without this kernel and the ring is immediate but it is another operator.
[Galaxy S 5 Original Android Development] andip71:
Yep, this is true. Of course the lock is only implemented in interactive, as the Sammy rom cannot change tunables of other governors it does not know.

Ok, will look into pegasusq code later. Maybe this tunable is indeed not available for maintenance.

Andi
[Galaxy S 5 Original Android Development] andip71:
At least I cannot confirm, I never do phone calls with my S5 (lol, but it is true).

Out of curiousity - which governor do you use?

Andi
[Galaxy S 5 Original Android Development] festr:
I was using zzmoove with optimal which I suspect that it might be the problem but I switched to the interactive/standard and also tried performance and it is the same. The phone wake after third ring and not on the first as it should be (like on my second stock s5).

So I flashed the original stock BOD3 kernel and it is the same it wakes on third rind - wtf?
[Galaxy S 5 Original Android Development] andip71:
Yes, was asking about the governor. Because zzmoove limits the CPU frequency when screen is off. This is known and a feature of zzmoove. So it is clear, the phone does not "start that quickly" for a call until screen is on.

But yes, hm... if you have it with stock kernel as well, this is what I expected.

Andi
[Galaxy S 5 Original Android Development] festr:
yes the problem is eselwhere which is "good" :D
[Galaxy S 5 Original Android Development] andip71:
Well, good for me, but not for you honestly.

Andi
[Galaxy S 5 Original Android Development] andip71:
Looked quickly up for you in the source code of the governor:

define_one_global_ro(sampling_rate_min);

So, it is indeed defined read only. But from what I see, this is the only tunable that is read only. The rest should be configurable fine.

Andi
[Galaxy S 5 Original Android Development] Many40:
Yep, the rest is ok as reported. No issue at all. Thanks for clarification. :thumbup:

So far so good on the tweaked pegasusq.
[Galaxy S 5 Original Android Development] andip71:
Good. Of course I could rework the governor to make this tunable writable. But I guess someone had some good reasons to make this tunable read-only. So I am not really in favour of doing that.

Cheers

Andi
[Galaxy S 5 Original Android Development] Many40:
Fully agree. But I recommend to remove/hide this tunable from Boeffla configuration app to not confuse the others.
[Galaxy S 5 Original Android Development] MIKEMON:
Yep, but everyone you should, before using the OP to read a basic preference Governor

he wants to use.

Everyone also sits something else

But, big thanks to everyone @ the most LordBoeffla
[Galaxy S 5 Original Android Development] andip71:
App should not be specific at all. So if, I will remove it completely from sysfs.

But low priority, not many tweak tunables at all.

Andi
[Galaxy S 5 Original Android Development] Many40:
Roger that :)

No problem at all - happy with current version.
[Galaxy S 5 Original Android Development] Riyal:
Hi [MENTION=947981]Lord Boeffla[/MENTION] just noticed when doing some development work on my s5 using your kernel... Seems like your kernel is breaking multiple key press events. For example pressing volume down + home key doesn't trigger interaction control anymore. Same goes for pressing recent + back key to unpin "Pin windows" feature. Did you somehow made any changes that could affect this? If so can you point me on which commit is it so I could recompile your kernel to be compatible for my use? I really love using your kernel specially the tap to wake feature but I couldn't use my device for my current project with this bug. Thanks! :D

Flashed back to stock kernel and it worked again.
[Galaxy S 5 Original Android Development] andip71:
No changes in that area, no.

Maybe touch wake could cause it. Remove the touch wake commit and try. Just a vague idea.

Andi
[Galaxy S 5 Original Android Development] festr:
I have a question for the governor behavior. Specifically for the interactive (default). I have installed app (cant remember name now) which draws me histogram for cpu frequency to see how each governor reacts and what is interesting for me that in chrome (I have enabled touchwake default 1190 I think) the frequency is much lower - around 400-700 when I touch the screen and in other applications frequency is higher (like it should be). Is that for a purpose? It is "cool" feature because the chrome when I touch it usually does not need too much cpu it is still very smooth even on 600-900 Mhz. I'm curious what interface is used and how the governor knows that chrome is focused when touching display.
[Galaxy S 5 Original Android Development] Lycidias:
so we meet again andi... :) thx
[Galaxy S 5 Original Android Development] ghoster76:
After 4 days being with CM 12.1, I come back to stock TW and nothing's better than. CM caused a lot of bugs but our TW didn't have Xposed support. Poor
[Galaxy S 5 Original Android Development] botski:
can work with this firmware?

G900FOLC1BOA2
[Galaxy S 5 Original Android Development] andip71:
Yes, should work.

Andi
[Galaxy S 5 Original Android Development] andip71:
No xposed = perfect.

Sorry to be honest again ?
[Galaxy S 5 Original Android Development] botski:
sorry my bad here's my firmware:

G900FDXU1BOA2
[Galaxy S 5 Original Android Development] andip71:
Should also work.
[Galaxy S 5 Original Android Development] Looki75:
Could you please precise what you mean?
[Galaxy S 5 Original Android Development] ghoster76:
Oh, I just need some modules to improve the facility like: Unicon, OGyoutube login, LuckyPatcher.

But I think you were right, but how can you confirm your equation? Was xposed just a mess of software improvement?
[Galaxy S 5 Original Android Development] Minto107:
Great that you're here too Andi :D I'm now switching from my S3 to S5 and I'm really glad to see that my favourite kernel comes on new level too ;) great to see you here mate! Keep up good work and don't forget about S3/N2 kernel it's beast there ;)