Jump to content

  1. 0
  2. 0
  3. 0/5

Rate this Topic

* * * * *
17 votes

Timur's Kernel - USB ROM - Most popular thread on Rootzwiki

  • This topic is locked

OP Timur

Timur

Android Master

Posted 26 January 2013 - 05:33 PM #391

If I understand the FI kernel correctly, it is designed to NOT provide any power (out) from the USB port upon AC/USB power removal (so the N7 battery is saved) AND to place the N7 into a deep sleep state (after a certain time).
-Is this correct?


Yes, it is. But a fusspot like me would prefer to phrase it this way: The FI kernel is designed to NOT provide any power (out) from the USB port upon AC/USB power removal, (not to immediately prevent battery draw, but) to allow the power management system to place the N7 into deep sleep state, after a certain amount of time, in order to then prevent lots of battery draw over longer periods of time. While supplying battery power to slave devices, a N7 will never transition to deep sleep.

-How long after power is removed should the N7 take to go into the sleep state?


This is a good question. First: the individually configured screen timeout. The screen needs to go off, before we can even talk about deep sleep (but you can also bypass the timeout and shut the the screen off manually). The device is now in light sleep mode. What happens next, is a little difficult to say, because some not so apparent rules will come into play. The transition to deep sleep can start as quick as 10 seconds later, but it can also take up to 300 seconds to start. It's a bit like with quantum mechanics. As soon as you try to really witness the process, you are likely to manipulate it. Wake locks can prevent all attempts to transition a device to deep sleep. Creating an adb-over-wifi session will raise a wake lock, which will prevent the device from going to deep sleep. In fact, every installed app can do this. Unfortunately, from the outside, it is not possible to say, whether your tablet is in light sleep or in deep sleep mode. One way to judge, is to check the amount of battery drain after some time. As mentioned earlier, the amount of battery drain in deep sleep mode should be very, very low. If you loose more than 4% in 12 hours, your device is not going into deep sleep and you may want check your list of installed apps and services.

If you really want to find out more, you can search your kernel logs (fetched afterwards) for the following entries: "suspend: enter suspend" and "Exited suspend state LP0". The latter is usually followed by two interesting entries: "Resume caused by ..." (for instance "tegra-otg", which would indicate, that wake was caused by someone unplugging the OTG adapter) and also "Suspended for nn.nnn seconds". The former MAY be followed by "active wake lock PowerManagerService" and "Freezing of user space aborted". Which would indicated, that an attempt to transition to deep sleep has failed. Which may or may not be reasonable, depending on what apps are trying to do.

With this information you may be able to find out what apps are preventing deep sleep mode. And any such finding could be beneficial to other users.
  • 2 Likes

iceman_jkh

iceman_jkh

Android Lover

  • 150 posts

Posted 26 January 2013 - 06:39 PM #392

Thank you for your very informative reply :)
I'm not having an issue at the moment. I was more so curious as to the expected behaviour. Now I can determine if my device is working correctly or not :)

Side question: Would it be possible to have the Fixed Install kernel (or some kind of mod) operate in Mobile Installation mode momentarily (say 15 seconds) and then switch over to FI mode? This would allow the N7 to gracefully 'tidy up' (eg: close, pause, unmount, etc) all the devices in use, and then cease power to all downstream USB devices and then finally go into its deep sleep state (as above).
  • 1 Likes

b0bd

b0bd

Member

  • 66 posts

Posted 26 January 2013 - 06:58 PM #393

Side question: Would it be possible to have the Fixed Install kernel (or some kind of mod) operate in Mobile Installation mode momentarily (say 15 seconds) and then switch over to FI mode? This would allow the N7 to gracefully 'tidy up' (eg: close, pause, unmount, etc) all the devices in use, and then cease power to all downstream USB devices and then finally go into its deep sleep state (as above).


That is a great idea. I wonder if we could make a Mobile Installation mode but with a /proc interface to allow you to turn off the power (go into FI off mode), then you could gracefully power down what you need with bus power and then turn off the power (with Tasker for example)

Edited by b0bd, 26 January 2013 - 06:58 PM.

  • 0 Likes

bmakk205

bmakk205

Android Apprentice

  • 80 posts

Posted 26 January 2013 - 07:43 PM #394

I can't get my device to boot using the latest cm10.1 nightly.

Sent from my Nexus 7 using Tapatalk HD
  • 0 Likes

OP Timur

Timur

Android Master

Posted 26 January 2013 - 07:54 PM #395

I can't get my device to boot using the latest cm10.1 nightly.


Dude, we're not on Twitter.
  • 1 Likes

bmakk205

bmakk205

Android Apprentice

  • 80 posts

Posted 26 January 2013 - 08:12 PM #396

Dude, we're not on Twitter.

alright thanks :D

Sent from my SAMSUNG-SGH-T989 using Tapatalk 2
  • 0 Likes

OP Timur

Timur

Android Master

Posted 27 January 2013 - 01:46 AM #397

CM 10.1 nightly working fine. Your welcome.

Nexus 7 / 2x Galaxy Nexus (1x Firefox OS, 1x Ubuntu for Phones) / 2x Nexus S (one actually used as a phone)





Edit: One thing comes to mind: http://timur.mobi/funstuff (content replaced)

Edited by Timur, 27 January 2013 - 01:42 PM.

  • 1 Likes

OP Timur

Timur

Android Master

Posted 27 January 2013 - 02:48 AM #398

...allow the N7 to gracefully 'tidy up' (eg: close, pause, unmount, etc) all the devices in use, and then cease power...


Sorry, but this will not work the way you want it to, as a way to cope with sudden power loss situations. This is because a power loss still needs to be detected. And by the time it is, it is already too late to, say, unmount an external filesystem.
  • 0 Likes

iceman_jkh

iceman_jkh

Android Lover

  • 150 posts

Posted 27 January 2013 - 03:06 AM #399

So how does the mobile kernel work in that scenario ?
Or does that simply not matter, as the unplugging is always intentional and therefore the devices are expected to be getting unplugged/unmounted before hand anyway?
  • 0 Likes

Kookie_Monster

Kookie_Monster

Android Master

  • 593 posts

Posted 27 January 2013 - 04:07 AM #400

Edit: One thing comes to mind: http://timur.mobi/funstuff


LOL. Poor guy! XD
Sent from my Transformer TF101 using Tapatalk 2
  • 0 Likes
In-Dash Nexus 7 Project | Mod Shop

Samsung Galaxy SIII LTE 16Gb »» ROM: Stock Android 4.1.2 (Root) »» Kernel: Stock
Asus Transformer TF101 16Gb »» ROM: EOS4 Nightlies »»»»»»»»»»» Kernel: KATKernel
Google Nexus 7 32Gb »»»»»»»»»» ROM: Timur's USBROM »»»»»»»»» Kernel: Timur's Kernel