Wednesday, June 24, 2015

The Truth About Kernels and Battery Life by flar2

When it comes to Android kernels, the number one topic of discussion these days is battery life. But there are many myths about the relationship between kernel and battery life. At one extreme, there are those who make outrageous claims about radical changes to battery life minutes or hours after installing a kernel. At the other extreme are those who think the kernel makes absolutely no difference at all to battery life. The truth lies somewhere in the middle.

Before we get to the “truth” of the matter, I want to clarify a few things.

First, the kernel does not “drain” battery. Many times, a user installs a kernel and then reports back soon after that the kernel has caused massive battery drain (and probably also something to the effect that the kernel is crap and the dev should burn in hell for his efforts). To prove it, they post screenshots from battery monitoring apps showing “kernel” as the major source of drain. This is very misleading. On Android devices, the kernel provides a mechanism for keeping the phone awake, called a wakelock. Processes running on the device (e.g. apps and services) can ask the kernel for a wakelock, and the kernel will oblige. So yes, the kernel is technically keeping the phone awake, but only because an app or service has asked it to. It is these apps and services that are misbehaving and causing drain, not the kernel.

But that is not to say the kernel does not cause any battery drain. It still uses memory and does work, but the amount it uses is exceedingly small compared to the Android system, apps and services. There are also special hardware cases, such as the sweep2wake feature on the Nexus 5, which requires that the LCD panel remain powered on in order to work. This drains more battery than if the device were suspended normally, but still does not cause “massive” drain. On the Nexus 5, sweep2wake adds roughly 2% per hour drain while the screen is off. Not insignificant, but far less than the phone normally uses while the screen is on. Because of this, a strong myth has developed, claiming that sweep2wake and doubletap2wake cause battery drain. Except for the Nexus 5, it is just that, a myth. On the vast majority of devices, the battery drain from sweep2wake is negligible, usually something zero and 0.5% per hour, which would “cost” no more than 5% battery usage over the course of a workday. A perfectly acceptable trade-off for the convenience.

The second thing I want to clarify pertains to measurement. How do we measure battery life? I like to look at percent usage per hour. Many battery monitoring apps can give you this statistic, but you have to pay attention and set custom time points if you want to distinguish the stats further and really understand battery usage. If you do want to measure and compare, make sure you do so under similar conditions. And you must do so over a reasonable time period, which means days rather than hours. If you have some routines where you use the same apps every day, this would be a good way to test and compare. The battery monitor in EX Kernel Manager automatically provides the two statistics I will now talk about: idle drain and active drain.

Idle drain is battery drain while the screen is off. During screen off, the phone spends most of its time in “deep sleep”. Sometimes, it wakes up to do some background work, like syncing email or checking for updates. These would be examples of the system, apps or services “asking” the kernel to stay awake while they perform their tasks. If all is working correctly, when they finish, the device goes back to sleep. Idle drain should be measured over several hours to get an accurate picture. A good time to measure it is overnight while you aren’t using your device (if you are not a dev and actually get to sleep). On most devices, idle drain ranges from about 0.2% per hour to 0.8% per hour on a stock setup with default options (i.e., with no battery saving measures in place) on a normal WiFi connection. On some devices, kernel optimizations can shave a bit off this number. But only a tiny bit, generally in the range of 0.1% to 0.3% improvement over stock. This is not going to make a huge difference to battery life. As already mentioned, sometimes hardware features like sweep2wake can eat up about the same amount. So as we can see, a kernel offers relatively little improvement here, but then again, every bit counts. Another factor that influences idle drain is your network connection, particularly cellular connection. A poor signal will often result in a bit of extra drain. But this should not cause excessive drain during idle, and will mostly make a difference while you are using the data connection. I should add that many of the battery saving measures people take also make little difference here. As long as your idle drain is below 1% per hour, don’t even worry about it. If it’s more than 1% per hour, look at your apps and services. Occasionally, there will be a big batch of updates that cause a bit of extra drain. It happens.

Active drain is the amount of battery used while the screen is on. That is, while you are using your device. Active drain is obviously much greater than idle drain. The phone is on, the screen is on, and it is doing work using the CPU, GPU, memory, modem, wifi, disk, etc. Active drain varies quite a bit from device to device. A lot of times we hear about “screen-on time”. Active drain, measured in % per hour can be translated easily into screen-on time. Active drain of 12.5% per hour is extremely good and will equate to about 8 hours of screen time. Drain of 25% per hour will get you about 4 hours of screen time. See how that works?

Screen-on time (hours) = 100 / Active drain (% per hour)

This does not take into account the small amount of battery use while the screen is off. Assuming idle drain is about 0.6% per hour, you would lose about 6% in ten hours, or around 14% in a 24 hour period. You can subtract that from 100 in the equation above.

Now we’re getting into the truth of the matter. What influences active drain? Many
things. Network (especially cellular) connection makes a difference. Poor signal means it has to work harder to transmit and receive data. The type of apps you are using makes a difference. Obviously playing a graphics-intensive game will use far more battery than reading some email. Using the camera, especially flash, will cause more drain than texting. The point is, what you do with your device has, by far, the biggest influence on battery life. Something like changing your web browser could have a significant impact on battery life, perhaps a greater impact than any kernel or battery saving tweaks floating around on the Internet. Bottom line: Active drain will vary from user to user, even with the same device!

There is, however, one part of the kernel that has a significant influence on active drain, and therefore can have a big impact on screen-on time. This is the CPU governor. This is why kernel developers spend a lot of time tweaking governors. It’s about frequency usage, which you can measure with an app like CPU Times. The CPU governor controls frequency scaling according to system load. While not busy, the CPU will stay at its lowest frequency, which uses the least energy. When there is work to do, the CPU governor ramps up the frequency so the work can be completed faster and the user can enjoy a smooth experience. A good governor is responsive, quickly responding to changes in system load, to prevent lag, but also quickly returning to the lowest frequency to save energy.


There is an idea called “race to idle” which suggests the governor should immediately ramp up to the highest frequency so tasks can be completed as quickly as possible, and consequently, the CPU can more quickly return to a lower power state. This logic is generally sound, but with modern processors, there may be a negligible time difference for completing a task using the highest frequency available compared to a frequency somewhere in the middle. In other words, it may be a waste of energy to ramp up to the highest frequency when a somewhat lower frequency may complete the task in essentially the same amount of time, and return to an idle state. The highest frequency will use more energy than the moderate frequency, and there may be very real battery savings when this is repeated thousands or millions of times per day. The trick is to find frequencies that are “fast enough” to create a feeling of snappiness for the user, without constantly ramping up to the highest frequency. I could write a whole other essay on governors, so for now I will leave it at that. It will suffice to say that different governors will behave differently, and have different battery use characteristics. Therefore, the kernel really does have an impact on battery life.

There are other aspects of the kernel that impact battery life too. Chief among these is task scheduling, particularly the aspect where tasks are assigned to one CPU core or another. This means a CPU may be “woken up” to perform a task, or tasks may be packed onto the same core. Another is hotplugging. There is an energy cost to put CPU cores on or offline. On many devices, you will hear about the evils of mpdecision, a closed-source binary from Qualcomm that controls hotplugging and often includes a “touchboost” feature that overrides the CPU governor. Many custom kernels disable mpdecision and implement a custom hotplugging driver. My own testing has found that mpdecision and its excessive touchboosting generally do not have a major impact on battery life, and I have left it enabled in most of my kernels. In some recent devices, such as the Nexus 6 and the HTC One m9, there is no hotplugging during normal use. All CPU cores are online. It can’t be said that task scheduling, hotplugging and touchboost have no impact on battery life. They clearly do. It’s just not going to make a huge difference. If we think of the impact of these optimizations in terms of active drain (% per hour), the change will be relatively small, probably less than one percent per hour, which would be measured in minutes of screen-on time over the course of a day. I think the impact of these optimizations is more apparent on older devices that are less power efficient and have smaller batteries.

I will mention quickly one more topic that always comes up in discussions of battery life: undervolting. Again, undervolting probably made a bigger difference on older devices. Devices released in the past year or two have become considerably more power efficient, some even have automatic fine tuning and scaling of voltages. I remember working on msm8960 devices that used the same voltage for every CPU frequency. In a case like that, undervolting could make quite a difference. Recent devices run with much lower voltages, and chips are binned with tighter tolerances, leaving less headroom for undervolting and reducing the battery impact of undervolting. On some devices I offered automatic undervolting, but only for the lowest frequency, which is the most-used frequency.

Much more could be said on this topic, but the main point I wanted to make is that the kernel does, indeed, make a difference in battery life, but the difference is often not as dramatic as some like to think. From the kernel’s perspective, the CPU governor will have the biggest impact on battery life. Many of the things that people obsess about do not make a big difference in battery life. Finally, if you want to judge battery life, take a scientific approach. Try to use the same conditions when making comparisons, measure carefully, and give it some time.

- flar2

This article was originally posted by its author on elementalx.org and Android Revolution blog has been given a permission to re-publish the article.

Do you have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!


For latest news follow Android Revolution HD on popular social platforms:

Wednesday, April 8, 2015

HTC Sense 7.0 - Internet Browser


HTC has just started rolling out the new HTC Internet app update. Newest version is tagged as 7.1.2514183160 and it brings some Material Design touches. This HTC Internet browser is a part of the HTC Sense 7.0 interface. Let's take a look at some of the HTC Internet app features, but keep in mind that most of them were already available in the older version of the browser. The new HTC Internet is mostly about new design.

View mode

Within few clicks you can choose if you want to browse the Internet with the status bar on the top of the browser, or in the "fullscreen" mode with the status bar hidden. The status bar won't show up until you swipe down from the top of the screen. However, it will not appear and stay like in the regular mode, but it will cover up the URL bar (immersive mode).


Quick Controls

With Quick Controls the URL and 3 dots bar are gone. Anything you want to do (go back or forward, enter Settings, bookmark page etc.) you need to slide with your thumb from the left or right edge of the screen to open quick controls. Pretty hard to learn at start because it's very easy to slide over wrong option, but I'm sure it's possible to master it after short time of use.


Bookmarks

Well known place, where you can manage bookmarked pages. You can choose the view mode between "Thumbnails" (first screen) and "List" (third screen). By editing bookmarks you can also change the order on the list, change the bookmark's labels and addresses or add particular bookmark to the created custom folder.


Tabs and Incognito Mode

HTC Internet app allows you to work with multiple tabs - either regular ones or "Incognito Tab" The incognito mode drastically increases your privacy level because the site you view in that mode won't appear in the browser or search history, and it won't leave other traces (like cookies) on your device. You can have maximum up to 16 tabs open at the same time.


Menu

The 3 dots menu offers some typical features like "Go back" and "Go forward" arrows or "Add to" button, which you can use to create new bookmark, add certain site to the home screen or Reading List. With the "Share" option you can share current site via different social channels, Dropbox, bluetooth, mail and more.


With the "Saved" option you can view a list of sites you decided to read later (Reading List) or videos you decided to watch later (Watch List). To add a site to the Reading List click on the 3 dots menu ---> + (plus) icon ---> Reading list.

"History" and "Find on page" options don't need to be explained.


The "Downloads" takes you to the HTC Downloads app, where you can see all downloaded files, not only via the HTC Internet app. You can also choose to view certain pages in the "Desktop View" mode. The last position on the 3 dots menu is Settings.


Settings

Here you can adjust various privacy and security settings (such as cache, history, cookies, passwords and more), as well as accessibility options (text size, scaling and zoom), advanced settings (search engine, JavaScript, pop-ups), bandwidth management and Labs, where you can enable Quick controls.




Conclusion

The new, re-designed HTC Internet app matches the new HTC Sense 7.0 UI style as well as it looks a bit more "materialized" now. Can it compete with the Google Chrome browser? No, but I don't think it is suppose to. It is just a solid, stock browser with a common features browsers on the market have. It looks good and works as it should.

The HTC Internet app is available in the Google Play.

Do you have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!


For latest news follow Android Revolution HD on popular social platforms:

Introducing the HTC One M9+


The most anticipated phone after the HTC One M9 is finally here! Let's take a closer look at what HTC offers in the M9's "big brother":

Luxurious Design – The HTC One M9+ leverages HTC’s iconic, all-metal design and combines it with significant enhancements including a 5.2” 2K display with Fingerprint authentication, HTC BoomSound with Dolby Audio surround sound, new-and-improved Duo Camera, and support for up to 2TB of microSD storage.

Sense 7: An Extension of You – Your smartphone should make a statement about who you are, and HTC Sense 7 puts you in control of everything. HTC Themes puts you at the center of your smartphone experience; Sense Home reinvents the home screen to deliver the most useful apps to your homepage based on your location; and a more intelligent HTC BlinkFeed makes it easier to uncover the hidden gems that surround you by using location data to recommend points of interest, news and information.

Immersive Viewing Experience – The HTC One M9+ comes with a new 2K display wrapped in a 5.2” WQHD (1440 x 2560) screen. Even with a larger display, the size of the phone rests comfortably in the palm of your hands. With the new MediaTek Helio X10 processor, you will experience smooth movie playback and sharp photos.

Incredible Imaging – The HTC One M9+ comes with a 20-megapixel rear Duo Camera wrapped in a sapphire glass lens cover that protects it from scratches. For vivid video that looks like the latest blockbuster, the camera also shoots movies in 4K resolutions. For low-light, front-facing selfies, the HTC One M9+ comes with the new and improved HTC UltraPixel front-facing camera.  And to take creative pictures to the next level, the HTC One M9+ comes equipped with the HTC EYE Experience software for easy editing and the new HTC One Gallery to access all of your photos, wherever they’re stored.

Exhilarating Audio – The M9+ comes with a larger-than-life soundtrack courtesy of HTC BoomSound combined with 5.1 channel Dolby Audio surround sound simulation. This gets you even closer to the action, delivering extraordinary, multidimensional cinematic listening.  

Connect Your World – Smartphones are fast becoming the central hub for home entertainment and HTC Connect makes it easy to enjoy your multimedia experience beyond your phone. A three-finger swipe on the screen connects the phone to compatible TVs or external speakers from leading manufacturers including Harman Kardon. For the ultimate connected smartphone-powered TV experience, the HTC One M9+ comes exclusively preloaded with the Peel Smart Remote app.

Security at a Finger’s Length – The HTC One M9+ comes with a new fingerprint sensor. Located at the front of the phone for easy access, just one touch unlocks your phone. With the multi-directional sensors, all you need to do is to place your finger on the sensor in any direction to unlock your phone.


Full device specification:

Size: 150.99 x 71.99 x 9.61mm
Weight: 168g
Display: 5.2 inch, WQHD (1440 x 2560)
Platform: Android™ 5.0 (Lollipop) with HTC Sense™
CPU: MediaTek helio™ X10 octa-core CPU, 8 x 2.2GHz, 64-bit processing
Memory: Total storage: 32GB, available capacity varies
RAM memory: 3GB
Expandable: microSD™ expansion supports additional memory cards up to 2TB 
Network:
2G/2.5G - GSM/GPRS/EDGE: 850/900/1800/1900MHz
3G UMTS: 850/900/1900/2100MHz
3G TD-SCDMA: 1900/2000MHz
4G LTE: FDD: Bands 1, 3, 5, 7, 8, 28; TDD: Bands 38, 39, 40, 41
Sensors:
• Ambient Light Sensor
• Proximity Sensor
• Accelerometer
• Compass Sensor
• Gyro Sensor
• Magnetic Sensor
• Sensor Hub
• Fingerprint Sensor
Location:
• Internal GPS antenna + GLONASS
Connectivity:
• 3.5 mm stereo audio jack
• Bluetooth® 4.1 with aptX®
• Wi-Fi®: IEEE 802.11a/b/g/n/ac (2.4 & 5 GHz)
• HTC Connect™
• DLNA®
• HDMI MHL 2.0
• CIR
• micro-USB 2.0 (5-pin) port
• NFC
Sound:
• HTC BoomSound™ with Dolby Audio™3
Camera:
Main camera
• 20MP Duo Camera with sapphire glass lens
• Auto-focus, BSI sensor
• f/2.2, 27.8mm lens, 4K video recording
Front camera
• HTC UltraPixel™
• BSI sensor
• f/2.0, 26.8mm lens, 1080p video recording
Multimedia:
Audio supported formats:
• Playback: .aac, .amr, .ogg, .m4a, .mid, .mp3, .wav, .wma, .flac
• Recording: .aac
Video supported formats:
• Playback: .3gp, .3g2, .mp4, .wmv, .avi, .mkv
• Recording: .mp4
Battery:
• Capacity: 2840mAh
• Talk time: Up to 23 hours for 2G / 13 hours for 3G
• Standby time: Up to 598 hours for 2G / 626 hours for 3G 5
AC adapter:
• Voltage range/frequency: 100 ~ 240V AC, 50/60Hz
• DC output: 5V and 1.5A
Additional features:
• Dual-tone metal unibody
• Themes
• HTC Sense Home
• One Gallery
• Photo Editor

The HTC One M9+ is currently available in China only and will be ranged in other markets, to be confirmed locally at a later date.

Do you have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!


For latest news follow Android Revolution HD on popular social platforms:

Monday, March 9, 2015

Android 5.1: Unwrapping a new Lollipop update

It seems that Android 5.1 is finally out! The Android team just posted on their blog that new update is ready and it brings quite a lot of changes, including stability fixes, performance improvements and offers a few new features like support for multiple SIM cards, Device Protection and high definition (HD) voice on compatible phones. 

"Whether you want to share your phone with a family member or better manage your mobile costs, Android Lollipop 5.1 now lets you use more than one SIM card on a device with multiple SIM slots."



"With Device Protection, your lost or stolen device will remain locked until you sign in with your Google account - even if someone resets your device to factory settings. This feature will be available on most Android phones and tablets shipped with Android 5.1 in addition to Nexus 6 and Nexus 9."

"High Definition voice calling is now on your mobile phone. Get crystal clear calling with HD Voice between compatible Android 5.1 devices like the Nexus 6 on T-Mobile or Verizon."
"Android 5.1 Lollipop also provides enhancements such as the ability to join Wi-Fi networks and control of your paired Bluetooth devices directly from Quick Settings."


Do you have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!


For latest news follow Android Revolution HD on popular social platforms:

HTC Sense 7.0 - Priority Ringtones

Continuing observations regarding the new HTC Sense 7.0 features it's time to take a look at another very interesting aspect of the new HTC user interface - the Priority Ringtones. Priority Ringtones probably replaced the "DND" (Do Not Disturb) function as I can't find it any more in the Quick Settings menu. So how does it work?

To configure the Priority Ringtones you need use volume buttons. The volume slider UI is similar to the one known from the HTC Sense 6.0, however at the bottom of the box you can find 3 new buttons - "NONE", "PRIORITY" and "ALL". Volume settings menu after clicking the settings icon on the right part of the box looks exactly the same as in previous Sense version.


None

Using the first option - "NONE" simply means you will receive absolutely no sound notifications. Not even the alarms. In that mode your device is not allowed to give any sound. You can set this mode to be active for a particular time (15min, 30 min, 45 min, 1h, 2h, 3h, 4h, 8h) or indefinitely, meaning it will be active as long as you disable it.


Priority

In Priority mode you can basically choose what type of events, reminders, calls or messages (and from who) are allowed to interrupt you. You can choose to receive calls or messages from everyone, contacts only or favourite contacts only. You can also configure the days the priority mode is enabled by default (from Monday till Sunday) and hours - start hour and end hour.



All

The "ALL" mode simply means you will receive every kind of notification. In this mode everything gives a sound - alarm, phone call, message, notification, reminder etc. This mode is enabled by default.

If by any chance you haven't yet read my previous HTC Sense 7.0 related articles here's a short reminder:

Do you have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!


For latest news follow Android Revolution HD on popular social platforms:

HTC Sense 7.0 - Photo Editor


When you look at the HTC Sense 7.0 UI you might think it's not very different from the HTC Sense 6.0. In fact - apart from a few very obvious features like Sense Home with Smart Folders - most changes are either under the hood or are a part of extended functionality of a particular system component. One of such new extended functionality is HTC Photo Editor, which doesn't come as a separate, standalone app, but as a part of the HTC Gallery app (com.htc.album). And it has some really nice features!

HTC Photo Editor replaced bundled camera effects and you can enter it either from the app drawer (Photo Editor) or from inside the camera app or gallery app by clicking the "EDITOR" button.


After opening the HTC Photo Editor for the first time you can see a sliding images with a short descriptions, giving you a basic idea about the main features. These are:
  • Shapes - Add colourful shapes to a photo
  • Photo Shapes - Add a shape filled with a photo to another photo
  • Prismatic - Add a kaleidoscopic effect to a photo
  • Double Exposure - Blend two photos together
  • Elements - Add animated effects to a photo


On the top left side you'll find a sliding menu with a following options:
  • Home (Photo Editor main screen)
  • Recently Used (pictures from recently used albums)
  • Essentials (main effects such as Filters, Tools and Red Eye Removal)
  • Flair (Frames and Draw)
  • Effects (Shapes, Photo Shapes, Prismatic, Double Exposure, Elements and Face Fusion).


Essentials

As listed above, one of the Essentials feature are Filters. However, Filters were available in previous HTC Sense version too. You can choose between following filters: Muiro, Noirin, Jardinia, Satura, Windmere, Losdales, Minneland, Islandia, Swellington, Foreston, Rosala and Custom, where you can set your own values such as White Balance, Levels, Exposure, Contrast, Brightness, Saturation, Sharpness, Grain and Vingette.

With Essentials Tools you can rotate, crop, flip and set the straighten of the image. Red Eye Removal is a typical tool to remove the red eyes effect.


Flair

In Flair mode you can choose between various frames and make some drawings on the picture using pen, pencil, highlighter and more. You can also change the colour and thickness of each tool.



Effects

This section is quite extensive, offering you pretty interesting features, and not all were available in the previous HTC Sense version.

Shapes

Photo Shapes

Prismatic

Double Exposure

Elements

Face Fusion

Camera Menu UI

In the camera menu you can choose the content you use frequently. Defaults are "Selfie", "Camera" and "Panorama". You can also add "Photo Booth", "Zoe camera" and "Split Capture" - all already available in the previous HTC Sense 6.0.



If by any chance you haven't yet read my previous HTC Sense 7.0 related articles here's a short reminder:

Do you have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!


For latest news follow Android Revolution HD on popular social platforms: