<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>L337Tech &#187; extended</title>
	<atom:link href="http://www.l337tech.com/tag/extended/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.l337tech.com</link>
	<description>Overclocking - Computer Hardware and Software Reviews   How To Videos - Advice - and much more</description>
	<lastBuildDate>Sun, 05 Feb 2012 13:34:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Palm Pre Hack To Significantly Extend Battery Life</title>
		<link>http://www.l337tech.com/tips-and-tricks/palm-pre-hack-to-significantly-extend-battery-life/</link>
		<comments>http://www.l337tech.com/tips-and-tricks/palm-pre-hack-to-significantly-extend-battery-life/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 18:04:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips And Tricks]]></category>
		<category><![CDATA[battery]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[extended]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[overclocking]]></category>
		<category><![CDATA[palm]]></category>
		<category><![CDATA[pre]]></category>
		<category><![CDATA[save]]></category>
		<category><![CDATA[scaling]]></category>

		<guid isPermaLink="false">http://www.l337tech.com/?p=309</guid>
		<description><![CDATA[Okay, we at L337Tech have replace our iPhones out of sheer bordem (had iphone for 2 years and am now bored with it). We now have Palm Pre&#8217;s. I love my Palm Pre but was not happy with the battery life. Luckily the Palm Pre is the easiest phone to hack ever. Heck, to access [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, we at L337Tech have replace our iPhones out of sheer bordem (had iphone for 2 years and am now bored with it).  We now have Palm Pre&#8217;s.  I love my Palm Pre but was not happy with the battery life.  Luckily the Palm Pre is the easiest phone to hack ever.  Heck, to access developer mode you type in the konami code, come on thats awesome!!  I wrote some code that uses power saving features built into the linux operating system used by the Pre.  This has literally increased my battery life by 40%.  It is only a matter of time before Palm sees this and writes their own power saving script.  But as of right now the Pre has now power saving features so use my code.  </p>
<p>This is basically a repost of the work i did in the forums of <a href="http://www.precentral.net" style="text-decoration: underline"target="_blank">PreCentral.net</a></p>
<p>Okay i have been doing extensive testing.  I believe i have solved most of the problems related to cpu scaling.</p>
<p>noted problems:<br />
1.  Video playback flickers and can be choppy<br />
3.  Phone freezes usually in standby or some other low state like listening to pandora in standby.<br />
2.  Can force the phone to have a 250mhz minimum instead of 125Mhz minimum</p>
<p>Fixes:<br />
Two new scaling schemes.  The first uses 1 second sampling rates and an 11% cpu utilization speed up threshold.  The second method uses powersave_bias to turn on the 250mhz minimum (this will cause the phone to quit going down to 125Mhz, it goes down to 250Mhz instead during standby or other lowly states)</p>
<p>The fist scheme fixes video playback and phone freezes during lowly states, but does not fix the 250Mhz minimum problem so you phone will use 125Mhz for its lowly state.</p>
<p>The second scheme fixes phone freezes during lowly states like standby and Pandora, and makes 250Mhz the minimum cpu frequency.  This method does not fix video playback flickering issues.</p>
<p>Here is the code:</p>
<p>First scheme (my favorite and the one im currently using)<br />
assumes you are at root@castle:/#</p>
<p>echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor<br />
echo 500000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq<br />
echo 250000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq<br />
echo 11 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold<br />
echo 1000000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate</p>
<p>Second scheme (not my favorite because of video flicker and other reasons i will explain latter but it does utilize the 250mhz low state which is a little snappier than 125Mhz)<br />
assumes you are at root@castle:/#</p>
<p>echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor<br />
echo 500000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq<br />
echo 250000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq<br />
echo 11 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold<br />
echo 10000000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate<br />
echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias</p>
<p>The main problem with the methods people were doing before is that the chip was switching between low and high state several times over the course of a few second no matter if they were playing a video or pandora.  The first scheme above fixes that issue.  The second scheme still suffers from this but i tried to lessen its severity by changing the sampling rate to 10 seconds (in reality it seems like 2 seconds durring testing).  10 seconds was the lowest i could go without it wanting to change states from low to high several times in a few seconds.  There is something wrong with the powersave_bias function that makes it switch states faster than the sampling rate.  I am looking into possible workarounds.  </p>
<p>I would have liked to make the speed up threshold 5% but the lowest the up_threshold function would let me choose is 11%.  5% is usually low enough to have the phone running full power during pandora.  Your phone is almost always lower than 5% during standby or when not doing anything on your phone.</p>
<p>If you want these codes to stick after a reboot then you will need to prepare a script in vi editor inside you pre&#8217;s linux system in the format similar to how they did it at pre dev wiki <a href="http://www.webos-internals.org/wiki/CPU_Frequency_or_Voltage_Scaling]CPU Frequency or Voltage Scaling - WebOS Internals" style="text-decoration: underline"target="_blank">here</a> </p>
<p>scroll down the page till you see how they made it stick.  Just change the code to the codes in the post, but you need to change the format slightly.  If you dont know how to do this then you do not need to be trying anything mentioned in this post.</p>
<p>And as always i am not responsible for any damage this may cause you.  But the consensus is that the ondemand scaling function is pretty harmless to your phone.  Freezes are fixed by unplugging you battery.  If you want to be extra careful then just run these codes without making a script.  That way when you reboot everything goes back to defaults from palm for the cpu.</p>
<p>If anyone can get powersave_bias stable let me know what you did.  I was using trans_table in the /cpufreq/stats folder and also time_in_state within the same folder.  Another usefull tool is cpuinfo_cur_freq within the /cpufreq folder.  Also use top command to monitor your cpu utilization, this command can be executed anywhere within linux.</p>
<p>I have decided to include some code that will help anyone if they decide to do their own testing of cpu scaling and power save bias.  Here is the code I use for testing:</p>
<p>current speed<br />
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq<br />
time in different frequencies<br />
cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state<br />
number of switches between power states<br />
cat /sys/devices/system/cpu/cpu0/cpufreq/stats/trans_table<br />
current sampling rate<br />
cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate<br />
current up threshold<br />
cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold<br />
current power save bias<br />
cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias<br />
current max freq<br />
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq<br />
current min freq<br />
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq</p>
<p>turn off power save bias<br />
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias</p>
<p>overclocking<br />
echo 550000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq<br />
echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq<br />
echo 1500000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate </p>
<p>good luck</p>
<p>-L337Tech</p>
]]></content:encoded>
			<wfw:commentRss>http://www.l337tech.com/tips-and-tricks/palm-pre-hack-to-significantly-extend-battery-life/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

