Zit Seng's Blog

A Singaporean's technology and lifestyle blog

Building Nexus One ROMs

You probably already know that I’m building my own ROM. Nothing really fancy. It’s just building from other people’s sources, picking things I like. There are two main things I want to make better on my phone: Improving battery life, and improve user responsiveness. Battery life is easy to understand. Just make the phone last longer without recharging. User responsiveness, on the other hand, is often confused with performance. I don’t need a fast phone (but fast, of course, is not a bad thing). What I want is an ultra smooth and fluid user interface experience. Like how it is on the iPhone and iPad.

For some time, I’ve been using intersectRaven’s HAVS kernel, primarily because of the Adaptive Voltage Scaling patch from CodeAurora that has been merged in. Also, the option to use BFS scheduler was nice. BFS seems to work better for not-so-heavy interactive workloads. That’s the kind of workload seen on a phone.

I made some simple tweaks to let AVS scale voltage down to 825mV. The Nexus One, it seems, is quite happy to let the CPU operate with 825mV @ 245MHz, and often even @ 384MHz. Compared with the standard CM6 kernel’s 1000mV @ 245MHz, this was a significant savings in power. The phone, after all, is mostly idling at 245MHz anyway if you are not actively using it. My “testers” have reported like 20% improvement in battery life.

The next thing is about changing the CPU frequency scaling governor. It turns out the default “ondemand” governor wasn’t, at least in my opinion, as good as “interactive”. Here, my goal is improving smoothness and fluidity. The Interactive governor makes the CPU ramp up to maximum speed when it comes out of idle. Generally, the Interactive governor is more aggressive at satisfying CPU performance requirements of interactive workloads.

But alas, I discovered the cm-kernel-exp repository. There are plenty of interesting commits in there. No HAVS, unfortunately, but still very interesting nonetheless. I gave it a shot… compiled and tested, and so far I’m quite pleased with it. I wished HAVS would be merged in some day. But anyhow, it’s still pretty darn good.

The cm-kernel-exp source repository has a number of important (at least to me) enhancements: AXI frequency scaling based on screen on/off, many scheduler tweaks (better latency), simplified preempt-capable RCU (better performance for interactive workloads), many wireless fixes, improved low memory killer, and… well, just so many other things.

So… from today on, my automated ROM builds are using cm-kernel-exp instead of ir-kernel.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

View Comment Policy