cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AcE-Krystal
Token Ring
Posts: 49
Registered: ‎06-22-2015
Location: Netherlands
Views: 633
Message 1 of 8

Request for change: Prevent frying laptops in bags by reading current screen lid status

I want to request a change/update.

 

I noticed a few times now that I come into an important business meeting with empty mattery's. I set out to find the origen and found that the laptop does not recodnise if the screen lid is closed or not. It only reads the actions when you close or open it, but does NOT read the current state of the lid.

 

This causes the laptop sometimes not to go in sleep mode while the lid is closed. Resulting in people putting running laptops in there bags without knowing it is still on, causing the maschines the fry themselfs in peoples bags.

 

To Reproduce this problem:

1. start up the laptop.

2. close the lid and wait for it to go in sleep (you will see the i of "thinkpad" starting to "breath".

3. Open the lid of the laptop as if you want to work, but instead of keeping it open directly close it again.

== The laptop should wake up, but as it is still bussy waking up it does not read that you closed it agian. The laptop does not do any checks afterward to check if the lid is closed or open en will keep running as it still thinks its open.

 

This should be fixed soon as it has a huge effect on productivity and hardware failure and fastly decreasing battery live. My new laptop has lost already almost 6% capasity since I recieved it this month. I clearly see drops of about 1.5% every time I find out the laptop did not go in sleep again.

Former Administrator
Posts: 8,592
Registered: ‎11-19-2007
Location: US
Views: 614
Message 2 of 8

Re: Request for change: Prevent frying laptops in bags by reading current screen lid status

Ace-Krystal,

 

We can look into your observations... to help us understand your particular situation, we will need some additional information.

 

What model system do you have?  What version of BIOS and power management driver do you have installed?

 

Could I also ask you to check Windows and power management settings for how laptop behaves when lid is open or closed?  It can be set to run with the lid closed as some people do that at the office when connected to external keyboard and display.

 

There have been occasional quirks in power management that have prevented laptops from properly going to sleep (suspend) or staying in suspend from time to time - interactions with other applications, or glitches in particular versions of power management.  Ususally, these are addressed with version updates.

 

Best regards,

AcE-Krystal
Token Ring
Posts: 49
Registered: ‎06-22-2015
Location: Netherlands
Views: 610
Message 3 of 8

Re: Request for change: Prevent frying laptops in bags by reading current screen lid status

Hello Mark,

Thanks for your reply
I will make a post with all your requested information soon. At the moment I'm unable to do so..

I guess I will have it ready in 1 day.
AcE-Krystal
Token Ring
Posts: 49
Registered: ‎06-22-2015
Location: Netherlands
Views: 589
Message 4 of 8

Re: Request for change: Prevent frying laptops in bags by reading current screen lid status

To give you some information:

Lenovo Thinkpad T450s
Product nr: 20BXCTO1WW
BIOS: JBET49WW (1.14)

Windows 8.1 Pro 64 bit English last updates, power management:
All power profiles have following settings:
Lid closed (battery and plugged): sleep
Put computer in sleep(battery and plugged): 15 Minutes

The thing that I would think will most easily fix this problem is to let the laptop check on the current state of the lid, rather then only the "closing action" (going from open to close). I guess there is a magnetic switch that detects if lid is closed or not. So the hardware detects if it is closed or open all the time.
If a live action is not possible in the software, then at least it should check every 10 seconds whether its closed or not and decide what action to take every 10 seconds.

I think this is not a hard update to do Smiley Wink
Guru
Posts: 9,598
Registered: ‎12-26-2009
Location: CA
Views: 561
Message 5 of 8

Re: Request for change: Prevent frying laptops in bags by reading current screen lid status

This should also check for docking station status; it may be intentional to wake the machine with the lid closed in this configuration.

 

The easier way would probably to have a script that runs at resume to send the machine back to sleep if the lid is closed. This makes it backportable and removable by the user.


W520: 2960XM, Q2000M @ 1091/1380, 32GB RAM, 500GB&750GB HDD & 500GB SSD, FHD&MB168B+
X61T: L7500, 4GB RAM, 500GB HDD, XGA screen, Ultrabase
W550s: 5600U, K620M at 1164/1281, 16GB RAM, 512GB SSD, 3K touchscreen
X200s: SL9400, 6GB RAM, 64GB SD card, WXGA+ screen
TPT1: 1839-23U
Former Administrator
Posts: 8,592
Registered: ‎11-19-2007
Location: US
Views: 540
Message 6 of 8

Re: Request for change: Prevent frying laptops in bags by reading current screen lid status

Ace-Krystal,

 

Generally systems do have a sensor that detects when the lid is closed - it is magnetic.

 

So, that should be sufficient as the lid will be either be open or closed and the degree of open is not important in this particular case.   As the wake up and sleep are software based events, they need time to run and complete. Regardless of additional sensors that might be added, the system needs time to complete the process.

 

If you rapidly open and close the lid before allowing the system to complete fullying waking up, or fully going to sleep, you are inducing a condition that would not normally exist.   

 

Practically, I would recommend that you select sleep, close the lid and allow the system to complete this operation before you put it in the bag.  For increased security, you could change the setting to select hibernate with the lid closed which will ensure the system is effectively off.

 

I think your suggestion is to have another process that basically continually polls the lid close sensor and if closed will force the system to the defined state (sleep or hibernate), superceding other processes? 

 

If so, I will pass that along to our product team.   I am curious as to your thoughts how that would work when the system is set to continue to run with the lid closed ?     

 

While not related to your particular situation, we do have BIOS 1.15 available on our support site..

 

Best regards,


Mark

 

 

Guru
Posts: 9,598
Registered: ‎12-26-2009
Location: CA
Views: 512
Message 7 of 8

Re: Request for change: Prevent frying laptops in bags by reading current screen lid status

Here's a temporary workaround (that doesn't check for docked status, but will prompt for override).

 

http://www43.zippyshare.com/v/nWC2MHsj/file.html

 

Create a Task Scheduler event that runs the above file, set to begin "On an event", with a Log of "System", a Source of "Power-Troubleshooter", and an Event ID of "1".

This creates a task that runs on resume.

 

The program itself is an autohotkey script I threw together, with the lid detection code coming from here.

 

;Author: Linear Spoon
;Date: 9/3/2013

Start_LidWatcher()
{
  VarSetCapacity(guid, 16)
  ;GUID_LIDSWITCH_STATE_CHANGE
  Numput(0xBA3E0F4D, guid, 0, "uint"), Numput(0x4094B817, guid, 4, "uint")
  Numput(0x63D5D1A2, guid, 8, "uint"), Numput(0xF3A0E679, guid, 12, "uint")

  r := DllCall("RegisterPowerSettingNotification", "ptr", A_ScriptHwnd, "ptr", &guid, "uint", 0)
  if (!r || ErrorLevel)
  {
    ;MSDN says check GetLastError if the return value was NULL.
    Msgbox % "RegisterPowerSettingNotification failed with error: " (ErrorLevel ? ErrorLevel : A_LastError)
    return 0
  }
  OnMessage(0x218, "WM_POWERBROADCAST")
  return r
}

Stop_LidWatcher(r)
{
  DllCall("UnregisterPowerSettingNotification", "ptr", r)
  OnMessage(0x218, "")
}

WM_POWERBROADCAST(wparam, lparam)
{
  static fx := "LidStateChange"
  if (wparam = 0x8013 && isFunc(fx))
  {
    ;data = 0 = closed
    ;data = 1 = opened
    %fx%(Numget(lparam+20, 0, "uchar") ? "opened" : "closed")
  }
  return 1
}

r := Start_LidWatcher()

OnExit, cleanup
return

cleanup:
  Stop_LidWatcher(r)  ;Stop watching the lid state changes
  ExitApp
return

LidStateChange(newstate)
{
  if (newstate = "closed")
  {
	MsgBox , 4 , Resume Protection , The system was resumed with the lid closed and will return to standby in ten seconds. Override?, 10
	IfMsgBox Yes
	{
	  Stop_LidWatcher(r)
	}
	else
	{
	  Stop_LidWatcher(r)
	  DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)
	}
  }
  else
  {}
  Stop_LidWatcher(r)
  ExitApp
}

Caveats:

1) Not sure if this works reliably 100% of the time

2) Not sure if UAC will take offense at the program issuing a suspend

3) This is by no means an efficient program, and takes on the entire AutoHotkey binary to do a handful of things. Someone can probably rewrite this in a different language.


W520: 2960XM, Q2000M @ 1091/1380, 32GB RAM, 500GB&750GB HDD & 500GB SSD, FHD&MB168B+
X61T: L7500, 4GB RAM, 500GB HDD, XGA screen, Ultrabase
W550s: 5600U, K620M at 1164/1281, 16GB RAM, 512GB SSD, 3K touchscreen
X200s: SL9400, 6GB RAM, 64GB SD card, WXGA+ screen
TPT1: 1839-23U
AcE-Krystal
Token Ring
Posts: 49
Registered: ‎06-22-2015
Location: Netherlands
Views: 464
Message 8 of 8

Re: Request for change: Prevent frying laptops in bags by reading current screen lid status

 

Thanks for the reply's

 

Update: I wasn't entirely sure at first but now I know for sure. Part of the reason why I have/had this problem is because there was somehting wronge with my mainboard. This caused me to have 35 seconds extra boot time before the bios gets loaded (POST). This problem/mainboard also effected my wake up time by 11 extra seconds before the computer starts waking up. This makes for a time span of 12,5 second that I need to wait before closing the lid again. If I close the lid agian withing that time the computer wakes up with the lid closed and wil not check again if the lid is closed, even though the power plan is set to go in sleep when lid is closed.

What solved most of this problem: The mainboard has been replaced and the laptop now wakes up in about 1,2 seconds instead of the 12,5 I had before. I agree that opening and closing the lid within 1,2 seconds is a very uncommen situation.

Conclusion: So I guess the problem I reported at first is not so commen as I first thought because it only effects people with a faulty wake up time (like when you have a faulty mainboard as I had) or people who are able to open and close the lid within1,2 seconds. Stil, I think the laptop should be aware of its current lid state and should act once in a while (say after 5 minuts of waking up) on this state based on the power configuration.

 

@Mark_Lenovo: Thanks for you reaction. To give some answers:
"Quote: If you rapidly open and close the lid before allowing the system to complete fullying waking up, or fully going to sleep, you are inducing a condition that would not normally exist."

- Yes, I now agree that opening and closing within  1,2 seconds is not really a commen thing to happen. But I need to add (as a programmer) that it is rather ugly to see that the laptop is so easily fooled into a frying laptop in the bag and a dead battery the next day in a meeting or on the airplane. Even though chances are slim, I think I might be worth it to look into this since it has suche big effects on the laptop. It would specially prevent this situation when for some reason the wake up time is longer then expected. (like the 12,5 seconds wakeup time I had with my other mainboard)

 

"Quote: I think your suggestion is to have another process that basically continually polls the lid close sensor and if closed will force the system to the defined state (sleep or hibernate), superceding other processes? 

 

If so, I will pass that along to our product team.   I am curious as to your thoughts how that would work when the system is set to continue to run with the lid closed ? "

- Yes, some kind of driver, or rather bios program that prevents this situation. Some solutions I'm thinking of are:

 

Methode A. Windows aware
+ easy to make for windows

- windows OS dependent

 A script wil check the lid once every x times to see if it is closed or open. if it is closed use the appropriate action assigned in windows to "when lid is closed".

Methode B. Bios aware (prefered)

+ OS indipendent

The hardware/bios itself has a timer with "Y" delay. When this timer times out it wil do a screen lid check and present the OS with a normal screen lid status action, as it would when closing or opening the lid for real. The OS wil just trigger on this action, like it normally would, with the power configuration it has. If it it set to go to sleep when lid is closed, the laptop wil go to sleep at the first moment it recieves a "lid closed" message.. Whether it is from really closing the lid, or the timer Y that times out while the lid is closed. It then reads the current lid status and presents this to the OS. The OS then should see this as a normal "lid closed" action. If the user has set the system (OS) to go into sleep whe lid is closed, the machine wil go to sleep. If the system(OS) is set to do nothing, the bios wil not force the system into sleep. The bios just gives a status update to the OS, the OS then decides what action to take based on the user configuration.

 

I think this request has stil value to make the laptop more reliable and give it a more robust power management. It gives you the reliability that it wil still go to sleep even though it missed its initial "lid closed" event for what ever reason.

 

 

Now I'm also curious what would happen if:
- I power off my laptop.
- start it up

- for some reason boot into OS takes longer (for exampe updates, or external/netwerk boot device times out)

- and you close it before it boots into a OS with power management capability's

I guess that this wil result in the same situation. Missing its initial "lid closed" and wil not go in sleep at the moment the OS finally loaded because the OS does not get a "lid status" event anymore.

Will try this out soon and post results here Smiley Wink

 

@ColonelONeil:

Check out current deals!


Shop current deals

Top Kudoed Authors