yashsingh1/xdaforums huggingface dataset:
[Nexus S Android Development] nightsky87:
Aha! I may be on to something. After going through the code in /drivers/video/samsung/s3cfb.c, I found this interesting segment:

static int s3cfb_setcolreg(unsigned int regno, unsigned int red,
unsigned int green, unsigned int blue,
unsigned int transp, struct fb_info *fb)
{
unsigned int *pal = (unsigned int *)fb->pseudo_palette;
unsigned int val = 0;

if (regno < 16) {
val |= __chan_to_field(red, fb->var.red);
val |= __chan_to_field(green, fb->var.green);
val |= __chan_to_field(blue, fb->var.blue);
val |= __chan_to_field(transp, fb->var.transp);

pal[regno] = val;
}

return 0;
}

It seems to map a set of RGB values into a single register with bitfields. If I'm reading this correctly, by theoretically manipulating the RGB values before mapping to the bitfield, it should be possible to do it. Would it be possible for you to test some code for me bedalus? I don't have a build box for it unfortunately. :(

New (and very hypothetical) code replacement for above:

static int s3cfb_setcolreg(unsigned int regno, unsigned int red,
unsigned int green, unsigned int blue,
unsigned int transp, struct fb_info *fb)
{
unsigned int *pal = (unsigned int *)fb->pseudo_palette;
unsigned int val = 0;

// Mix colors to recreate sRGB
red = (23200 * red + 11283 * green - 53 * blue) >> 15;
green = (502 * red + 29649 * green + 1975 * blue) >> 15;
blue = (570 * red + 2238 * green + 29655 * blue) >> 15;

// Insert handler for red zero clipping here
if (red & 0x80000000)
red = 0;

// Insert handler for red saturation clipping here
if (red >= (1 << fb->var.red.length))
red = (1 << fb->var.red.length) - 1;

if (regno < 16) {
val |= __chan_to_field(red, fb->var.red);
val |= __chan_to_field(green, fb->var.green);
val |= __chan_to_field(blue, fb->var.blue);
val |= __chan_to_field(transp, fb->var.transp);

pal[regno] = val;
}

return 0;
}

So yeah, I have no idea whether this will compile or not. :eek: But if you're willing to give it a shot, it might turn out to be good!

EDIT: Btw, the modifications here are done on unsigned ints prior to mapping into bitfields. At worst, if it doesn't work, it'll only mess up the bitfield values which would cause the image to not properly appear at the hardware level. I'm pretty sure there's no way to damage hardware using this mod. :p But hey, not my call.
[Nexus S Android Development] :
Sure, I'll compile it. Off to work now though
[Nexus S Android Development] :
Cool, I'll check it out
[Nexus S Android Development] nightsky87:
Thanks bedalus! I do hope this works although I'm not too sure if Android uses the pseudo_palette structure in the first place! :p

EDIT:

Ugh... It seems that Android uses truecolor visuals so chances are the color maps are bypassed:

fix->visual = FB_VISUAL_TRUECOLOR;

Can't know for sure until we do a test kernel (I'm trying to set up my own build system btw. Can't keep relying on good 'ol bedalus for compiling all the time. :p)

EDIT2:

So it seems that in truecolor mode, the setcolregs function operates on CONSOLE colors instead which is why regno is limited to below 16. So now I'm pretty sure the code I gave earlier won't work. :p

The good news is that the framebuffer seems to be written primarily by three functions located in the files below. With some driver rewrites, I *might* be able to make this work. After some sleep. :D

/drivers/video/cfbcopyarea.c
/drivers/video/cfbfillrect.c
/drivers/video/cfbimgblt.c
[Nexus S Android Development] dextermorganx:
Why can't i activate these?
[Nexus S Android Development] :
Okay, I'll hold off and wait for your feedback
[Nexus S Android Development] :
Read the links in the OP for guidance on settings. You need to use init.d scripts ideally.
[Nexus S Android Development] N_E_X_U_S:
Hi,

I'm using CNA rom on nexus S device.

Which flavour of the kernel I shall use from the matrix?
[Nexus S Android Development] :
If you're not using 4G, then get the 'All ROM version' (in green column)
[Nexus S Android Development] mpjoe2000:
bedalus have you seen this?:

https://github.com/cyanogenmod/andr...mmit/5bff9aca163c0602f4f4a47001bc40c6d4f887ba

https://github.com/cyanogenmod/andr...mmit/1d96fbc43ef01cd765a79e24c220960b371ac03a

https://github.com/cyanogenmod/andr...mmit/e943a896aa113708294da9d18f8973f390e6ed10

:)
[Nexus S Android Development] Maximilian Mary:
Dim to 1: (Default dim is 20)

su
echo 1 > /sys/class/backlight/s5p_bl/brightness

Increase by 1: (requires busybox)

su
expr "(" $(cat /sys/class/backlight/s5p_bl/brightness ) + 1 ")" > /sys/class/backlight/s5p_bl/brightness

Script manager pro widgets make it just as easy as tapping a power control widget.
[Nexus S Android Development] sperelli:
Script manager pro widget? Link please?
[Nexus S Android Development] deani77:
I'm currently using debug CM Kernel on PA 2.15... Still no random reboot as before (after hanging up call) :D Will wait further more time.
[Nexus S Android Development] :
Thanks, but those are ROM modifications. If you see any kernel mods let me know :)
[Nexus S Android Development] :
Now these naughty phones know they are being watched...
[Nexus S Android Development] dekaru01:
Is 4.7.4 supposed to be 3.0.43? I thought almost all kernel devs gave up on post-3.0.31 updates. Then again, I may be confused.

And what are the defaults? Ondemand&cfq? At 1000 MHz max?
[Nexus S Android Development] leap_ahead:
Ondemand&cfq At 1000 MHz max
[Nexus S Android Development] :
Correct.

I'm continuing with mainline updates. There was a battery drain myth started somewhere. I found as soon as i disabled IDLE2 battery drain was normal.
[Nexus S Android Development] caliban2:
CM also is on 3.0.43. So no, not all devs went back to .31...

Bedalus, seems like you fixed something with 4.7.4. Debug-version is getting to 24 hours and still fine. Littlebit of lag sometimes, but I blame that on debugging.

How long do you want it tested before claiming it stable? (And I can flash normal 4.7.4) Two days, three? :)
[Nexus S Android Development] :
@Caliban: test for a bit longer. But could you do a normal reboot and send me the last_kmsg please? I'd like to compare it to your previous one.

I'm putting up a version v4.7.5: http://d-h.st/0Y0

Some people want to test this? (All ROMs, non 4G, non CM) I'm way too tired to upload all the other versions right now.

I've fixed every compiler warning (bar four or five) that happens during the build. Some were warnings that could be safely ignored, so I just silenced them. Others seemed to genuinely need fixing. Out of the left-over warnings, there was one warning which I didn't know how to fix (probably safe), and the rest were definitely safe. Overall I think I have fixed three or four things that just maybe might possibly have been real problems.
[Nexus S Android Development] caliban2:
Will do, but not now - would end the test. I'll give it another 10 hours. Will also check what I can pull via adb, iirc a reboot isn't really needed.
[Nexus S Android Development] polobunny:
Thanks for the dimming man. :)

Any idea about the bln bedalus?
[Nexus S Android Development] :
Not yet. I'll have a look when I'm properly rested
[Nexus S Android Development] polobunny:
Alrighty! Not really a killing bug anyway, I just have to sporadically check my phone for pending notifications. :)
[Nexus S Android Development] :
Enable blinking. You can keep max blinks at 1. Then it should blink once then stay on.
[Nexus S Android Development] polobunny:
So, 1 for everything?
[Nexus S Android Development] towelboy:
Is this normal? I was just using my phone like usual until I felt it was really slow, I checked running apps and got 8.8m ram left, and once it dropped to 0! Not sure if a kernel or rom fault. Latest JellyBro & Marmite 4.7
[Nexus S Android Development] migueldbr:
this kernel is great but i am still having the lockscreen flicker(it does not happen with stock kernel so its not ROM related). also having high drain from Google services, dont really know why. i have location services disabled. i am running rasbean 26th september build on a i9023 with marmite 4.7
[Nexus S Android Development] Maximilian Mary:
Script Manager-SManager(NoAds)

It's a little janky, but it gets the job done.

This paid version allows widgets to be run in the background.
[Nexus S Android Development] polobunny:
Not wanting to bash on your head, but Jellybro is a bleeding edge kang. It's not only CM10 nightly, it's CM10 nightly with picks. There's a lot of problems with these roms and they're hardly stable from one day to the other.

What you are describing has everything to qualify as a ROM problem.
[Nexus S Android Development] caliban2:
...and has everything to qualify as a kernel-problem as well.

@danshuynh, update to marmite 4.7.4-cm, you're using an outdated version which wasn't really stable on CM-based roms.
[Nexus S Android Development] alen1901:
BEDALUS, check this. binaries are kernel related right? they were released 2 days ago i think.

https://developers.google.com/android/nexus/drivers#crespojro03r
[Nexus S Android Development] 309041291a:
With a 400 maximum setting (on SetCPU "Idle" profile) I get SOD. Weather I be using smartassv2 or ondemmand. Even if I set the minimum to 200 I'll get a SOD in 5-10 minutes. 400 max setting has always given me the best idling time.

Can someone shed light on what SOD is and how I can prevent it? Don't be too basic I know it's the "Sleep Of Death" that occurs while your phone is idling, preventing it from waking up.

Nexus S (GSM i9020a)

Paranoid Android (2.1.3 - 4.1.1)

Marmite Kernel (4.7 - Bedalus)

Ondemmand (Screen On) (800/100)

Ondemmand (Screen Off) (400/100)

Deep Idle (N/A - Deadline)

BLX (98 - Inverted Apps)

Black Exodus (Stock Voltage)
[Nexus S Android Development] caliban2:
Here you go, 35 hours and 2 minutes. It never did anything funny.

I'll update to nightly 0927 and normal marmite 4.7.4 now. (damned ORD... ^^)
[Nexus S Android Development] :
Yes, one for everything works well. That's no excuse for bad code though. It's next on the to-do list.
[Nexus S Android Development] :
You have the animation though? I'm uploading a new version now, v4.7.5 (all variants), try that and see. App drain is not a kernel isssue
[Nexus S Android Development] :
Sorry, no. These are for the ROM cookers
[Nexus S Android Development] :
SOD seems to be a feature of deadline. Use CFQ. I am serious considering axing deadline anyway. CFQ arguably tested better, and google set it as default (there's probably a reason for that...)

I do not recommend screen off profiles either.
[Nexus S Android Development] :
Looks like you posted this a few minutes ago. Gimme a short while and v4.7.5 will be available.
[Nexus S Android Development] migueldbr:
sorry, forgot to mention that. I do have the animation, and if i have it on it works just fine but i always have it disabled, and when its disabled the flickering occurs. Not a serious bug, but annoying to those who dont usually have the animation on! But your kernel in not the only one with this, matrix and thalamus( not 100% sure) also have this. No hurry though...when you have the time;)
[Nexus S Android Development] caliban2:
Nice. :)

Btw, the difference in speed between debug on/off is a big one. It really flies now. Maybe that's it - if it starts to crash-reboot again, it's simply because it can't keep up with itself... :p
[Nexus S Android Development] :
I'm not trying to be funny, but can't you just enable the animation?
[Nexus S Android Development] :
v4.7.5 is up now. If you got the previous iteration, get this one instead!

If v4.7.5 crashes, I'll make a new debug version for you.
[Nexus S Android Development] caliban2:
No, it won't crash. Have a good feeling about this. Now stop it with them negative waves! ^^

EDIT:

Well, as soon as it flashes, that is. Accidentely flashed 4.7.4 first...

4.7.5 CM doesn't install, aborted installation and "(bad)".
[Nexus S Android Development] :
v4.7.5 is here: http://goo.gl/HvUrp

Changelog

-Stability fixes

-55 files modified and maybe a hundred odd individual fixes

-Most compiler warnings were meaningless, but some genuine errors solved

-Hopefully no reboots reported any more! (Jinx)

Thanks for everyone who has provided their last_kmsges after reboots, big thanks to everyone who downloaded the debug version, even though no reboots were reported, especially Caliban2 who deliberately rebooted for old-times-sake.
[Nexus S Android Development] Randomwalker:
What ROM are you on? Not some JB port by any chance...? What is your ro.build.type?
[Nexus S Android Development] alexdemonumber3:
No sir, crossbones, latest imm76l build. Working well, but the red frame is slightly annoying lol but I want to know the specifics on battery saving for this kernel! What's the potential and how do I get it?
[Nexus S Android Development] Randomwalker:
About the red frame, did you check build type in build.prop? Should be user or userdebug.
[Nexus S Android Development] JokerAce:
Thanks Sir.. Did my own unscientific test

[B][U]CFQ[/U][/B]

Benchmark: 3115
RAM: 311
CPU Integer: 566
CPU Floating Point: 147
2D Graphics: 322
3D Graphics: 1137
Database IO: 375
SD Card-Write: 80
SD Card-Read: 176

[B][U]Deadline[/U][/B]
Benchmark: 3176
RAM: 312
CPU Integer: 573
CPU Floating Point: 143
2D Graphics: 323
3D Graphics: 1143
Database IO: 382
SD Card-Write: 116
SD Card-Read: 185

Overall Deadline seems to perform better than CFQ.

So Sir, can I say that "Single file operation" is the same as "single app operation"? And if so, for instance, games that have massive resources, thus require good database IO and SD read, right? So Deadline in this case fits my purpose?

How to use init.d script? Tick the box in nstools?
[Nexus S Android Development] xjerlzx:
SO hows this kernel? has it become the most battery savings one already?
[Nexus S Android Development] Articudos:
When Is screen off- it's excellent.

Screen on- have no Idea. I'm using it now.

V1.0, Ondemand, deadline, deepidle off

Battery consumed 2% while I'm sleeping
[Nexus S Android Development] alexdemonumber3:
ANY ideas how to get rid of that red flashing frame?

Edit: nevermind, clean install and the problem is gone.
[Nexus S Android Development] sdhanjal15:
Anybody getting good battery?

What does mtp do?
[Nexus S Android Development] 309041291a:
MTP is faster USB transfer, in a nut shell. Doesn't the Gnex use it?
[Nexus S Android Development] xjerlzx:
how isit compared to matr1x?
[Nexus S Android Development] sdhanjal15:
AHHHH!!! Charging limit won't change....
[Nexus S Android Development] morfic:
Why are cfq and slub listed as items added? They exist in the kernel to begin with.
[Nexus S Android Development] Articudos:
I never used matr1x because I don't like beige color..

I'm too lazy to configure color presets using voodoo:p
[Nexus S Android Development] Articudos:
I think color is much different comparing to trinity muenchausen..:confused:
[Nexus S Android Development] :
My kernel code is based off kalims, as far as I can tell, the DI code is identical in all kernels, so I imagine AnTuTu has the same effect everywhere.

What I do is add

echo test > /data/local/tmp/test.txt

...to the bottom of an existing script to make sure init.d is working. It works on mine, so I'm sure it's fine for any ROM. What I did was create and save settings in NSTools, then navigated to /data/data/mobi.cyann.nstools/settings and copied the settings from there. The reason for this was because checking the "Use init.d script" option within NSTools didn't seem to work. There's probably a reason why, but I couldn't be bothered to find out.

MTP reads the OP

Uh, I mean, they weren't enabled, so I enabled them.

I wondered about this. I think one time I saw it go past the limit I set. But I wasn't sure if it was because I set the limit after it was already charging. I'll find out for sure today. If I missed something in the BLX merge, it's probably an easy fix.

I think it's because of voodoo, you may need to reset voodoo to default settings.
[Nexus S Android Development] Articudos:
Can I have presets?

:)

Edit: just found great combination..:)
[Nexus S Android Development] :
Here's what happens when DI breaks. If you look at the final down-slope, that's after a reboot with DI working (with music playing on mute).

If you look at the slope before that, that's with broken DI, so the frequency is fixed at 800 MHz. It's easy to see that would drain your battery faster.

Obviously, if you're not doing anything with your screen off, it won't matter if DI breaks.
[Nexus S Android Development] pan1980:
Just for information, i have mtp enabled with slimics and matrix v22.
[Nexus S Android Development] :
Hopefully mtp will become standard. We've suffered too long!
[Nexus S Android Development] :
You know it breaks USB debugging in Windows though? Well, it does when you use that switching app anyway, dunno about using the CM method.
[Nexus S Android Development] :
haha, there had to be some issue... let me see what I can do...
[Nexus S Android Development] caliban2:
Yeah... You see what sending out them negative waves did, bedalus?! :silly:
[Nexus S Android Development] migueldbr:
yeah i guess i can have the animation enabled. Probably isnt worth fixing this. Btw do you plan to include OC over 1.2?
[Nexus S Android Development] :
If you can't already OC to 1.2GHz, reboot into CWM and fix permissions. If this doesn't work, you may have flashed somebody else's kernel, or failed to read the OP

EDIT: :o looks like I failed to read your question properly. :eek: No, I'll not include any further OC beyond 1.2GHz
[Nexus S Android Development] :
Hmm. Rebuilt and uploaded no problem. I think either you or me had a bad upload/download respectively. Sometimes also it's possible for the file not to copy to the nand properly if you eject USB too early (in the case that you're using a computer to download) in CWM
[Nexus S Android Development] caliban2:
All of them are possible. Doesn't matter, version b flashed fine. Now let's see.
[Nexus S Android Development] polobunny:
I think you misread him, he asked if you planned to include overclock over 1.2GHz. You know, like 1.3GHz, 1.4GHz and over 9000GHz. :D

Caliban not getting a crash. Weird day. :silly:
[Nexus S Android Development] :
Oops. Thanks. Edited. Time for me to go to bed. (How can I sleep when I fear I will wake up to a crash report? :p)
[Nexus S Android Development] polobunny:
The same way I sleep without unbroken BLN. Oh the tragedy! :silly:
[Nexus S Android Development] infernalMan:
why CM version on 4.7.5 got "b" after the version number ??
[Nexus S Android Development] qu3becker:
There was an error while uploading so he re uploaded

Sent using Kirby's Warp Star.
[Nexus S Android Development] antrobi3:
Infinite bootloop with Marmite 4.7.5bCM on Rasbeanjelly 2012-9-26 !
[Nexus S Android Development] xjerlzx:
Could u just format everything and reinstall ,? Re download all files needed also.
[Nexus S Android Development] infernalMan:
you've just flashed the wrong kernel.

rasbeanjelly is not CM based rom.

use 4.7.5.zip kernel

---------- Post added at 11:00 AM ---------- Previous post was at 10:58 AM ----------

oh i thought it was something beside that name :D
[Nexus S Android Development] antrobi3:
I was wrong,thanks.
[Nexus S Android Development] beppegg:
I've installed the 4.7.5 version you posted yesterday, givin'it a try! ;)

Thank you!

Inviato dal mio Nexus S con Tapatalk 2
[Nexus S Android Development] linuxxp:
With 4.5.7 I have random reboots. I'm using ondemand, now testing with smartassV2

From Slim Beam thread:
[Nexus S Android Development] Mario Christian Oquias:
I have paranoid android.. i believe its cm based. So do i use the cm specific mermite or for other roms
[Nexus S Android Development] deani77:
For PA 2.15 use CM based kernel. For PA 2.13, use any ROM kernel...
[Nexus S Android Development] Athhar:
+1

For me too...thank you bedalus .

You are the man.
[Nexus S Android Development] sidnoit22:
Wow 4.7.5! Its so smooth!
[Nexus S Android Development] Jamalsid:
Bedalus

Do you think it might be a good idea to add a list of all possible settings that can be set via init.d in your kernel to the OP?

Just a thought.
[Nexus S Android Development] leap_ahead:
on 4.7.5 problem with Fc Gallery when finish recording video

back to 4.7.4
[Nexus S Android Development] :
That's because Rascarlo doesn't base his ROM on Cyanogenmod nightlies. Use the 'All Rom' version.
[Nexus S Android Development] :
The governor won't make any difference. How many have you had?
[Nexus S Android Development] :
In the OP there's already a guide on how to set things written by JockerAce. I also included a post on setting my BLN tweaks. There are no other settings.
[Nexus S Android Development] linuxxp:
A lot. Yesterday about 10 minutes - 4 restarts. Today - 2. There are times when the phone does not respond to pressing the Power button and then restarts. If there is a new restart I'll pull last_kmsg.
[Nexus S Android Development] :
If v4.7.4 works, v4.7.5 should work. I haven't altered any RAM settings. Can you confirm v4.7.4 works properly? If so, try v4.7.5 again. Are you on an unstable ROM? CM based?
[Nexus S Android Development] :
Are you on the deadline governor?
[Nexus S Android Development] leap_ahead:
i flash 4.7.5 i get Fc... After 4.7.4 no problem ...

Rascarlo Rom ....

on 4.7.5 after recording is freeze for some second and then get Fc ...
[Nexus S Android Development] :
I'll comb through the changes I made and see if I can find the culprit.
[Nexus S Android Development] leap_ahead:
you can check if you get Fc after video recording ??
[Nexus S Android Development] :
Confirmed. No FC for me, but cannot playback the video.

I think I found it:

drivers/media/video/samsung/mfc50/mfc.c

Made a change to this one. Will revert and re-upload.

EDIT: Oops,

The line was: if (mfc_init_hw() != true) which gave a compiler warning

I changed it to: (!mfc_init_hw() == false)

Should have been: (!mfc_init_hw() == true)

Pretty embarassing logic error for a mathematician. (In C, '!' means 'not')
[Nexus S Android Development] leap_ahead:
ok i will wait for patch or fixed version
[Nexus S Android Development] :
Aha, fixed: http://d-h.st/Y5P (non 4g All ROM)

Will upload all other versions now.
[Nexus S Android Development] leap_ahead:
ok now is working !!! thanks
[Nexus S Android Development] infernalMan:
i have the same.

thanks for reporting.

hope bedalus could fix this.

---------- Post added at 03:48 PM ---------- Previous post was at 03:47 PM ----------

wooww so quick !!

thanks !!
[Nexus S Android Development] :
No problem! Thanks for reporting the bug!
[Nexus S Android Development] :
Haha yes, I'm glad it was discovered so quickly. But it was an obvious error. After modifying so many files in one update, there was bound to be some problem. There may still be others... That's why we have testing releases. But I think we are close to v4.8 (still need to check BLN)
[Nexus S Android Development] :
v4.7.6 is here: http://goo.gl/HvUrp

-v4.7.5 no longer available, had a bug in video

-Bug due to logic error introduced in trying to silence a compiler warning

-Fixed now!

Any users of v4.7.5 strongly encouraged to update!

Thanks to leap_ahead for first realising this bug! :D
[Nexus S Android Development] towelboy:
No wonder, I had the problem but I thought it was a rom problem and reported it to the rom thread :p

Thank you for the update, works good!
[Nexus S Android Development] leap_ahead:
thanks for me because i found the bug :P

hahah just joke !!
[Nexus S Android Development] :
Credit given :D
[Nexus S Android Development] linuxxp:
No, CFQ
[Nexus S Android Development] :
I'm on Slim too, but I'm not having any issues. Are they completely random, or do they happen under certain conditions?
[Nexus S Android Development] sperelli:
I'd like to report that

terminal emulator commands related to bln are not working on Miui 2.9.21
[Nexus S Android Development] linuxxp:
The reboots are completely random.
[Nexus S Android Development] wujiyu305:
the difference CM version has made

Bedalus, Will you tell me what the difference between the CM virsion from the Allother? and what should be done if I wanna compile a CM version from the codes. I compiled one using your .config in the root of your git, but it works as a allother version.

Really thanks for your kernel and your guides!!