Does anyone know how to modify/disable the blinking power LED when OS enter into sleep mode? - sleep

Does anyone know how to modify/disable the blinking power LED when OS enter into sleep mode?
Or is it feasible to do this by using OS?
Does the power LED only controlled by hardware?
Or OS could modify it?
Thanks,

I just removed the wire for the power led from the motherboard...
Not a nice solution, but the f***g led is not blinkg anymore.

To my knowledge, it is generally controlled by hardware, though this is not standardized. Hardware control is definitely the most simple, although that hardware could be a BMC or microcontroller that could be accessed from the host. Long story short though: no, I don't think you can modify it.
That's my two cents, anyhow.

Related

Dynamic frequency scaling

I would like to adjust the CPU frequency , in other word, looking for an API or c++ code for frequency scaling in windows ?
In Windows, you can call SetPriorityClass to set the priority of the process
You can also set the priority of a thread by calling SetThreadPriority
The CPU clock speed is not something for which there are just some simple instructions to execute. The clock speed is controlled by the motherboard chipset, and that in turn is controlled by a motherboard-specific device driver.
You can get some control over the clock speed by using the Windows settings for power management. The usual way to slow things down and save energy is to choose a setting on this basis. Modern laptop, tablet and phone computers have extremely sophisticated algorithms but you can hint them in the direction of less power.
You may be able to automate the operation of these Windows programs, if that's all you need.
Many motherboards come with the ability to overclock, and a utility to control it. If you have such a motherboard you may be able to find a way to automate its control program, or it may provide an API. It will not be a generic solution, but one highly specific to the motherboard. Check with your motherboard supplier.
Is there a general Windows capability to do this? Not so far as I know, but there could be something hiding in there somewhere. It will be privileged call to a device driver requiring admin rights, if it exists. My be is that it doesn't.
You can use: PowerWriteDCValueIndex(); / PowerWriteACValueIndex(); with PowerSetActiveScheme(NULL, pwrGUID);

Mouse cursor freezes in Windows LabView

I'm developing an application in LabView on Windows. Starting a week ago, one test machine (a ToughBook, no less) was freezing up completely once every couple days: no mouse cursor, taskbar clock frozen. So yesterday it was retired. But just now, I've seen it on another machine, also a laptop.
This is a pretty uncommon failure mode for PC's. I don't know much about Windows, but I'd expect it to indicate that the software stopped running so completely and suddenly that the kernel was unable to panic.
Is this an accurate assessment? Where do I begin to debug this problem? What controls the cursor in the Windows architecture — is it all kernel mode or is there a window server that might be getting choked by something? Would an unstable third-party hardware driver cause this, rather than a blue screen?
EDIT: I should add that the freezes don't necessarily happen while the code is running.
I'd certainly consider hardware and/or drivers as a possibility - perhaps you could say what hardware is involved?
You could test this by adding a 'debug mode' for each piece of hardware your LabVIEW code talks to, where you would use e.g. a case structure to skip the actual I/O calls and return dummy data to the rest of the application. Make sure it's a similar amount of data to what the real device returns. You'll find this much easier if you've modularised your code into subVI's with clearly defined functions! If disabling I/O calls to a particular bit of hardware stops the freezes it would suggest the problem might be with that hardware or its driver.
Hard to say what the problem is. Base on the symptoms I would check for a possible memory leak (see if your LabVIEW app memory usage is growing overtime using "windows task manager").

How do I subvert computer idle detection on Windows?

In order to detect user absence GetLastInputInfo() can be used.
I want to make GetLastInputInfo() return that I've just used keyboard/mouse all the time - as I've been actively using the computer so that whoever relies on GetLastInputInfo() thinks I'm actively using the computer.
Can I use any Windows API functions to achieve that?
You're looking for the SendInput function.
Have you tried to simply move the mouse up and down a bit (15 pixels or so) with SendInput()?. I can't remember if NT6+ only resets the timeout for real hardware input or not.
The other options are:
Hook GetLastInputInfo with something like Detours
Generate real hardware input
What is this for? Do you just want to disable the screensaver? If that's the case, then you're probably better off looking at the SetThreadExecutionState function.

How can I programmatically stop a notebook battery from charging?

There is some easily available information on finding the status of a battery, or whether it's charging or not. (GetSystemPowerStatus API or System.Windows.Forms.SystemInformation.PowerStatus).
I want to be able to stop a battery from charging based on some criteria, e.g. battery power > 20%.
Is there an API to do this?
I think it's impossible, because you have need some API for battery or battery charger.
And this API can provide to you manufacturer of notebook and battery or battery charger support this.
I honestly don't know, but I'd have a look at the APM or ACPI APIs.
Other than that, the only option I can think of right now is a USB controlled robotic arm that ejects the battery when you need to stop charging, but that's probably not what you are looking for, and borders on the complicator's glove in terms of level of over-engineering. :)
I would just get a UPS and programatically tell it to cut all power... most should have an interface for doing this. Otherwise, as someone already said - a computer-controlled power strip would do it ^^
I've actually played with this idea when I was testing/writing about way too many new laptop models a while ago and the battery testing was annoying to set up, monitor and analyze.
I wrote an app that would do exactly everything (setup, listening, measuring, reporting) except unplugging the power and then replugging it and starting the computer again...
One of the options is to get hold of the device(I) for battery (Microsoft ACPI-Compliant Control Method Battery).
Listen for PowerNotification events forever. On each notification check the PowerStatus of the battery.
There are APIs for all of the above purposes in .Net and win32
Keep the device(I) disabled as long as the powerstatus is >threshold. Enable it as soon as goes below that or when you are not on AC power (i.e. before removing AC power, your continuously monitoring software should enable that battery device - or you manually enable it).
hmm,...this is a very buggy solution, but it can achieve what you want, although you have to be very careful.
Actually I use such a charge limiter. There is the control software - a Python script that monitors the battery level (psutil module) and controls external hardware - i.e. a switch that can be software controlled. I have Energenie and TP-Link homeplugs plus my own hardware contraption.
As it is for home use the software it's not polished at all, but with minimal effort can be adapted to any OS or hardware.
Let know if interested. The software lives here: CCC

Taking use of laptop custom buttons

I have a Lenovo Y550 laptop which has a nice looking touch sensitive strip with led lights on top of keyboard. The usage for this is however quite useless (it can be used to start 4 different Lenovo programs) so I started to think if I could program something of my own for it.
However I don't have any experience with this kind of thing.
First of all I'd like to know if it's even possible to use it on my own program in any way (capture touches or even control the lights).
Second, where should I start researching about this? I checked Windows Device Manager to see if I could spot anything helpful there, but no success. I can only see many kind of HID devices there.
One thing that is on my mind is to use some kind of hooks to take usage of this. Could that work? I don't really mind what language I'll have to use, learning new ones is a useful anyway.
If it is possible to totally control the touch sensitive strip it would be nice to light up the led lights as I will on it (now led light lights up where my finger is).
I did something similar for my Logitech keyboard. I had to hook the low level keyboard hook, and I modified the Logitech specific key codes into a Windows generic one. All in all a very simple, short and limited tool, without any configuration, but it did its work reliably and only used a few kb or memory.
Get a low level keyboard hook working, set a breakpoint and see what key codes you get. Don't know about the LEDs though.
Edit: Found it. It's been quite a while since I wrote this.

Resources