Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
Dark_Balor
Old
(Last edited by Dark_Balor; 22nd June 2012 at 09:48 AM.)
#1  
Dark_Balor's Avatar
Member - OP
Thanks Meter 48
Posts: 64
Join Date: Oct 2008

 
DONATE TO ME
Post [KERNEL][CWM] TerraSilent 1.3.5 for Galaxy 4.0 (YP-G1) INTL & USA (22/06/2012)

TerraSilent 1.3.5

After a lot of testing I can release it

Quote:
Well sorry for the /data partition, I don't know why, but it's stuck at RFS. I format it, I tried everything, everytime you relaunch the recovery and try to mount the partition, it mount it as RFS and wipe it out.

I advice you to let it as RFS or, change it to ext4 when you are sure you won't need to do further change in it from the recovery.
THIS IS ONLY FOR THE INTL AND USA VERSION OF THE GALAXY PLAYER 4.0 (YP-G1).

The kernel is based on the R3 version of Klin1344.

Current features :
  • All features of R3 of Klin Kernel (see below)
  • Battery life improvement using the patch of Entropy512
  • Jhash3
  • Optimized CFS (process scheduler)
  • A lot of memory tweak
  • TinyRCU
  • New Governor created for the kernel (based on smartassV2) : TerraSilent (I recommend you to use it)
  • CleanCache (using zCache) (see below for explanation)
  • zRam (see below for explanation)
  • Updated crc32 algorithm (that is quite used everywhere in the kernel)
  • Using optimized Sha1 algorithm
  • Lzma compressed initramfs
  • Swap enabled
  • New Boot logo (same image (but bigger) as the one in the begin of the Thread)
Feature Coming from based kernel :
  • V(R), BFQ, SIO Scheduler
  • OC to 1.2GHz
  • ClockWorkMod (recovery)
  • interactiveX, smartassV2, ondemandX, and the default governors.
  • Netarchy/coolbho3ks SoD patch from Entropy512's source (allows you to use screen off profiles of under 800Mhz)
  • Ext4 support
  • Voodoo Sound
  • etc ... see http://forum.xda-developers.com/show....php?t=1601773

Changelog
Version 1.3.5
  • [RECOVERY] Optimization of the recovery with better use of the busybox
  • [RECOVERY] Can save the /dbdata partition in nandroid
  • [USA] Added VOODOO FM
Version 1.3
  • [CHANGE] Zram built-in not a module anymore
  • [BUSYBOX] Updated busybox to last version 1.20.1 meaning any init.d script will be launched with that version.
Version 1.2
  • [MAJOR BUG FIX]Corrected a bug with the recovery that wasn't able to mount correctly the /data partition, it was leading to a complete wipe of data when applying ZIP that needed that partition to be mounted
  • [OPTIMIZATION]Using LZO Compression for ZRam also, after some test, I discover that Snappy compression is not really optimized on our device.
Feature Explanation :

Quote:
Originally Posted by faux123
CleanCache (via ZCache backend)

ZCACHE is a new technology I introduced to Sensation Kernel. ZCACHE is a compressed cache similar to ZRAM but the similarity ends there. ZCache is meant to provide as many "cleancache" pages (non-dirty or untouched "virgin" memory) to apps that request for new memory. CleanCache is very easy to allocate and no additional penalty are required to hand them out, so having more CleanCache pages will improve performance. Under heavy memory pressure, often times the kernel will NOT have enough CleanCache pages, so the kernel has to do EXTRA work to reclaim dirty cache pages and clean them for the new apps that's requesting for them. The described process creates a performance hit for the kernel and the app, so the idea is to use compression to create more CleanCache pages available for use. Of course there's a penalty to pay for using compression, but the trade-off between compression penalty and the penalty for reclaiming dirty cache pages and allocating them after cleaning is smaller for compression, so in the end, CleanCache should add more performance.

Source : http://forum.xda-developers.com/show....php?t=1359951
Quote:
Originally Posted by faux123
ZRAM (aka CompCache aka RAMZSwap)

ZRAM is an updated version formally known as CompCache and RAMZSwap. It was originally designed for 2.6.38.xx kernels, I have backported to our 2.6.35.xx kernel. ZRAM allows real-time compression of memory objects in RAM thus reducing memory pressure for the Linux kernel and can keep more apps in memory longer (more apps in RAM == better performance, less fetching from slower MMC or SDCard). Compression, however, is not Free. Some CPU cycles are required to do the compress/decompression, so there's a slight penalty for it. The original CompCache / RAMZSwap required a user space binary to control its behavior which adds additional penalty to performance, but the new version ZRAM eliminated the need for a separate dedicated daemon, thus reducing the overhead and increased performance from the old CompCache by 20%. Therefore, with the newer implementation of ZRAM interface, the performance penalty is almost negligible.

Source : http://forum.xda-developers.com/show....php?t=1359951
Quote:
Originally Posted by Dark_Balor
TerraSilent Governor

TerraSilent is completely based on the SmartAssV2 kernel with some improvement for the battery. When you are putting your device on sleeping/suspend, it's changing the frequency to 100Mz (if you set a minimum higher then that, it will be used instead) to avoid using too much battery when not needed, you can still listen to music without any lag. (if you experience some lag just change the minimum to 200Mhz).
It also less aggressive on ramp up the frequency, instead of always trying to reach the ideal frequency (400Mhz by default, I'll explain for tweaker all they can change if they want) it will try under frequency first (200Mhz if you were at 100Mhz before). Meaning using less battery.
By default when the load >= 85%, it will ramp up the frequency and if its lower than 35, ramp down it to an new frequency calculated using the current load.
How to tweak/activate special features
By default zCache and zRam are disabled because they can be unstable depending on the device.
By example, I don't have problem with zCache but with zRam yes, and Klin the exact opposite. The better is to try for your device and then choose which one you want, the 2 or none.

zCache :
To activate zCache, you only need to put a script in your init.d directory (in etc) or using ScriptManager to launch that line on boot :
Code:
insmod /lib/modules/zcache.ko
zRam:
To activate zRam, you only need to put a script in your init.d directory (in etc) or using ScriptManager to launch theses lines on boot :
Code:
mkswap /dev/block/zram0
swapon /dev/block/zram0
Changing by script the governator to TerraSilent
if you don't want to use (but I recommend noFrill Cpu to do that) an application to change the governator, you just need to do :
Code:
 echo terrasilent > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Tweaking TerraSilent
in /sys/devices/system/cpu/cpufreq/terrasilent you'll find these files :
Code:
debug_mask            --> for debug (possible value 0(disabled),1,2,4)
up_rate_us             --> µs to wait before ramp up
down_rate_us         --> µs to wait before ramp down
sleep_ideal_freq      --> Freq used when sleeping/suspend
sleep_wakeup_freq  --> Freq use when waking up
awake_ideal_freq    --> Freq ideal for daily usage
sample_rate_jiffies  --> DON'T TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING
ramp_up_step        --> step used when ramp up in Hz (to calcule the new frequency) (0 = maximum freq will be used when ramp up)
ramp_down_step    --> step used when ramp down in Hz (to calcule the new frequency) (0 = using heuristic to found the best new lowered freq)
max_cpu_load        --> max load that trigger the freq change for ramp up
min_cpu_load         --> min load that trigger the freq change for ramp down
Where you can put your own values. (You have to do that after every boot, the best is to create a script that change the governor to TerraSilent, and set the wanted values)

FAQ

How to create a script
With ScriptManager it's easy, just push the menu button -> New -> Script
Put the script lines you want
Menu -> save
That's done

Manually : create a file name my-script.sh
put as first line :
Code:
#! /system/bin/sh
and then what you want your script to do.
Don't forget to do a
Code:
chmod +x my-script.sh
to make it executable.
Download (ODIN PACKAGES) :
http://www.mediafire.com/?cf9aw48dnmiqi

Source Code
Kernel : https://github.com/Belphemur/Galaxy-Player-4.0-Kernel
Initramfs : https://github.com/Belphemur/initramfs_yp-g1

If you love my work, don't hesitate to click the thanks button

Thanks to
Steve for the first modded kernel of our device
Klin1344 for continuing, improving the work of Steves and testing my kernel for the USA version.
Entropy512 for the battery patch, and a lot of other tweak
Faux123 for all the patch he have backported to the 2.6.35 kernel (zCache, zRam, etc ...)
The Following 28 Users Say Thank You to Dark_Balor For This Useful Post: [ Click to Expand ]
 
klin1344
Old
#2  
klin1344's Avatar
Recognized Contributor
Thanks Meter 5154
Posts: 2,952
Join Date: Nov 2011
Location: Cerritos, CA

 
DONATE TO ME
THanks for your hard work in this kernel. You certainly know more about linux kernels than me.

But for some reason now enabling zram causes crashing and reboots but zcache does not. Oh well, at least one of them works!
Galaxy S III (SGH-T999) - CyanogenMod 10.1

My work on XDA:

If you appreciate my work, you can thank me by clicking 'thanks' or consider a donation!
The Following User Says Thank You to klin1344 For This Useful Post: [ Click to Expand ]
 
Dark_Balor
Old
#3  
Dark_Balor's Avatar
Member - OP
Thanks Meter 48
Posts: 64
Join Date: Oct 2008

 
DONATE TO ME
Quote:
Originally Posted by klin1344 View Post
THanks for your hard work in this kernel. You certainly know more about linux kernels than me.

But for some reason now enabling zram causes crashing and reboots but zcache does not. Oh well, at least one of them works!
I'm a Computer Sciences Student, and I already compile some kernel for my server, my computer ^^

It just my first kernel for an ARM device.
The Following User Says Thank You to Dark_Balor For This Useful Post: [ Click to Expand ]
 
ChaosChris
Old
#4  
Senior Member
Thanks Meter 134
Posts: 455
Join Date: May 2011
Location: Hamburg

 
DONATE TO ME
Thanks for your work the Kernel fixed the error i had with R2 and R3 ( the CPU speed was at 800MHz while the screen is off and music is on. SetCPU Profile dosent works too)

Sry for my bad english

Sent from my Nexus S using XDA
 
iJimaniac
Old
#5  
iJimaniac's Avatar
Senior Member
Thanks Meter 356
Posts: 1,244
Join Date: Oct 2011
Location: Douglas, AZ

 
DONATE TO ME
Quote:
Originally Posted by ChaosChris View Post
Thanks for your work the Kernel fixed the error i had with R2 and R3 ( the CPU speed was at 800MHz while the screen is off and music is on. SetCPU Profile dosent works too)

Sry for my bad english

Sent from my Nexus S using XDA
I just flashed, but it still runs at 800mhz constantly while playing music with the stock player!
I am using the terraslilent governor.

Sent using Tapatalk
Get R.E.D.D ->> Got R.E.D.D? <<- Get R.E.D.D

Asking an ETA for a rom is like asking for a hug from Chuck Norris. Moral: NO ETA'S!

Flashing CyanogenMod on a YP-G1 before backing up the EFS is like punching Chuck Norris before you're ready to die. Moral: ALWAYS BACKUP YOUR EFS!
 
daniel644
Old
#6  
Senior Member
Thanks Meter 184
Posts: 726
Join Date: Feb 2012
Quote:
Originally Posted by ChaosChris View Post
Thanks for your work the Kernel fixed the error i had with R2 and R3 ( the CPU speed was at 800MHz while the screen is off and music is on. SetCPU Profile dosent works too)

Sry for my bad english

Sent from my Nexus S using XDA
I'm sure this is a stupid question, but I don't know the answer and the only way to learn is to ask, but how do you tell what the CPU is running at with music playing and screen off?
 
iJimaniac
Old
#7  
iJimaniac's Avatar
Senior Member
Thanks Meter 356
Posts: 1,244
Join Date: Oct 2011
Location: Douglas, AZ

 
DONATE TO ME
CPU spy (search for it on the market).
My theory is that the music player is programed to run at the max CPU speed available, which is 100mhz (I think) with the stock kernal. So, when you up the Max frequency to 800mhz, than the music player runs at that. What I still don't get, though, is 1; why doesn't your terrasilent governor solve the problem for me like it did for others, and 2; why does flashing the stock kernal not solve the issue?

Anyway, I'm not entirely sure that it really is running at 800mhz, as I let it play music overnight for 8 1/2 hours, and it only drained 30% battery from 70% to 40%. That makes about 4% per hour, which seems alot lower than I would expect a device running at 800mhz constantly would get. What do you guys think?


Sent using Tapatalk
Get R.E.D.D ->> Got R.E.D.D? <<- Get R.E.D.D

Asking an ETA for a rom is like asking for a hug from Chuck Norris. Moral: NO ETA'S!

Flashing CyanogenMod on a YP-G1 before backing up the EFS is like punching Chuck Norris before you're ready to die. Moral: ALWAYS BACKUP YOUR EFS!
 
Dark_Balor
Old
#8  
Dark_Balor's Avatar
Member - OP
Thanks Meter 48
Posts: 64
Join Date: Oct 2008

 
DONATE TO ME
Quote:
Originally Posted by iJimaniac View Post
CPU spy (search for it on the market).
My theory is that the music player is programed to run at the max CPU speed available, which is 100mhz (I think) with the stock kernal. So, when you up the Max frequency to 800mhz, than the music player runs at that. What I still don't get, though, is 1; why doesn't your terrasilent governor solve the problem for me like it did for others, and 2; why does flashing the stock kernal not solve the issue?

Anyway, I'm not entirely sure that it really is running at 800mhz, as I let it play music overnight for 8 1/2 hours, and it only drained 30% battery from 70% to 40%. That makes about 4% per hour, which seems alot lower than I would expect a device running at 800mhz constantly would get. What do you guys think?


Sent using Tapatalk
After a lot of testing, I'm sure the application is wrong (or disabling the early suspend state).

When suspended the device have a freq of 100Mhz, you can check it with this command :
Code:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
using adb when the device is suspended. You'll see it's 100Mhz (or the min you set if the min above 100Mhz)

The other test you can do is checking the time in state
Code:
cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
You'll see that is passing more time in 100Mhz and 400Mhz then every other states.
(for the stats SetCpu or NoFrillCpu can read it for you)
The Following User Says Thank You to Dark_Balor For This Useful Post: [ Click to Expand ]
 
iJimaniac
Old
(Last edited by iJimaniac; 18th May 2012 at 02:09 AM.)
#9  
iJimaniac's Avatar
Senior Member
Thanks Meter 356
Posts: 1,244
Join Date: Oct 2011
Location: Douglas, AZ

 
DONATE TO ME
Well, setcpu says the same as cpuspy: constantly 800mhz. However, I just ran it for 1 hour, from 100%, and it drained 4%. While I used to get around 2% per hour, this still seems fairly low consumption to actually be at 800mhz. I guess I will just live with it.
One more question; is there a way I could "undo" the SoD patch, or whatever would be causing this? I thought it would be as simple as flashing stock kernal, but not so. Would a flash of a stock kernal AND factoryfs.rfs do the trick?

Actually two more questions, lol; you realize that this is only happening with the stock music app; all other apps work fine. (Just not sure if I actually made that clear)
Sent using Tapatalk
Get R.E.D.D ->> Got R.E.D.D? <<- Get R.E.D.D

Asking an ETA for a rom is like asking for a hug from Chuck Norris. Moral: NO ETA'S!

Flashing CyanogenMod on a YP-G1 before backing up the EFS is like punching Chuck Norris before you're ready to die. Moral: ALWAYS BACKUP YOUR EFS!
 
daniel644
Old
#10  
Senior Member
Thanks Meter 184
Posts: 726
Join Date: Feb 2012
got the kernel loaded up and since my primary use of my player is music playback i've used nofrills to underclock my cpu to max out at 400 mhtz, my question is can I and if so what app to use, to under volt my cpu to maximize my battery life?

 
Post Reply+
Tags
cwm, galaxy 4.0, kernel, terrasilent, zcache
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...