So, there is logging, of a sort, and I think I can now confirm the random display sleep I've been observing is indeed due to a software bug.
First off, the logging (and current status) of events and states related to system and display sleep can be found by running:
pmset -g assertionslog
Yesterday my screen stayed on for the rest of the day. However on returning to my computer this morning I found the display off. Pressing a key lit it up and the login window was there, as if I had not told it to keep the display on (but I still allowed it to lock the screen -- seems the screen saver still managed to turn off the display eventually).
About five to ten minutes later the screen went black again while I was scrolling. It continued to go black moments after being turned on again.
After experimenting for a while to see if there was a recognizable pattern in the
pmset output, I decided to try killing the processes that seemed to be changing state (i.e. with a plain
The first one I tried was
/usr/libexec/hidd, which was promptly restarted by
launchd. This made no difference to the screen going dark every few moments after being re-awoken.
The next one I tried was
useractivityd. This had immediate, positive, effect. The screen has not gone black since. Interestingly this process did not die -- it's still running and has been using CPU, but it is no longer being mentioned in any
The ongoing saga...
Today after an hour or so of normal use, the screen went black again, and again, and again, often only a second or so after waking it up. Sending
useractivityd again didn't do much so I sent it a
SIGKILL. It was immediately restarted by
launchd, but the battle to keep the display on continued.
Finally things have settled down again, but I'm not sure what I did to make it so.
Things get worse, then maybe better again
Yesterday I couldn't keep the display on for more than a few seconds, then managed to lock something up so the login screen wouldn't activate, and I ended up shutting the system down from an SSH session, powering off completely, and rebooting, only to have the problem begin again soon after.
Today it was OK for a little while, then started blanking out again and being basically unusable.
I was almost beginning to think it was a hardware problem.
Then on a whim I disabled and uninstalled f.Lux. Since then it went blank while unattended, then once more while in use, but otherwise has been much better than before.
NOT a software problem: Now the computer is basically unusable
Now the computer is basically unusable (at least from the keyboard and screen).
If the machine is really cold then the screen will stay on for a few minutes, at most. However if the machine is at "normal" operating temperature (according to all sensors and past history of all sensors), the screen may even blank out during the very early stages of booting (i.e. while the console boot messages are still scrolling during a verbose boot).
The interesting part is that the screen can be turned on by the OS (i.e. by pressing and then generating "activity" with keypresses or wiggling the mouse cursor, etc.), only to be turned off again moments or seconds later by whatever hardware and/or firmware that is failing.
If I can figure out how to programatically turn on the screen (e.g. by generating the same keyboard events that I use manually), then I may be able to continually re-light the screen with a daemon to make it possible to limp along until I'm able to replace the whole machine.
A Reprieve, of sorts....
So just after making the last edit I stumbled upon an article by someone describing this same problem. After the usual amount of entirely useless mis-directed pontification about the possible causes of the problem (all entirely impossible) and the regular raft of pointless suggested actions, there was a tiny hint that turning down the brightness might help.
I hadn't thought of that earlier because I had no luck improving the situation by running all the fans at full blast.
However I dropped the brightness to the minimum and left the screen activated all night -- and what do you know! It had not gone blank by the next morning!
I have now been using the machine, albeit with some eye strain, for a few days, including today with the room temperature climbing slightly (despite air conditioning -- it's 43C outside), with no blanking of the screen. I'm able to run the brightness at 5 bars shown on the on-screen control, or 0.33 with https://github.com/nriley/brightness