Wednesday, April 16, 2014

perchance to dream


Do Intel chips dream of Facebook updates ?

Yes, they do. Install that Intel Smart Connect driver and your PC will wake itself up repeatedly to check for email, Facebook and Twitter updates; lathering itself into a frenzy, seeking hopelessly for validation. This is a problem if you'd rather have the machine sleep peacefully and cheaply through the night, waking cool and refreshed to do useful work.

When building my latest desktop I carefully did not install the suggested Intel Smart Connect driver. Still, there was something whispering in its ear to give it unquiet dreams. Gently put to sleep, tucked in with a comforting word each night, in the morning it would be up and humming busily. Maybe the NSA unleashed its robot crawlers to inspect my digital fewmets - questing, perhaps, for traces of renewed allegiances to those foreign princes and potentates whom I was supposed to renounce and abjure during the oath of citizenship.

It turns out there are many imps and daemons that are empowered to cause wakefulness, almost as many as hover about my own bed each night. Here's a swift trot through the ways to a better night's sleep, for your Windows 7 computer at least.

Deep in the bowels of the Windows install is a handy command-line tool powerfcg. Look for it in the folder Windows/system32.

Open a command prompt, run it with the -LASTWAKE flag, to see who it was the last time.

C:\Windows\system32>powercfg -LASTWAKE
Wake History Count - 1
Wake History [0]
  Wake Source Count - 1
  Wake Source [0]
    Type: Device
    Instance Path: USB\ROOT_HUB20\4&449fe53&0
    Friendly Name:
    Description: USB Root Hub
    Manufacturer: (Standard USB Host Controller)
Quite a few USB drives will install their own proprietary little driver, which wakes itself up periodically to see if there is any data to be moved around. Just plugging in a new USB can cause a sequence of sleepless nights.

Check to see who is empowered with the -devicequery wake_armed flag.
Wake armed ? like that bunch of lawless criminal deadbeat welshing rebels in Nevada ? No, these devices are innocuous in comparison with the America-haters.

Thus,
C:\Windows\system32>powercfg -devicequery wake_armed
HID Keyboard Device
ASMedia XHCI Controller
USB Root Hub
HID-compliant mouse (002)
Atheros AR8151 PCI-E Gigabit Ethernet Controller (NDIS 6.20)

Off we go to go to Control Panel, Device Manager, expand each node looking for something that matches the device name as listed above, rightclick on that device name and select Properties, then on Power Mgmt tab for each of these, uncheck 'allow this device to wake'.

Looks like this,


 and then after the right-click, properties etc,


The keyboard was left allowed to wake, so a keystroke will awake it, but all other devices are disarmed.

Programs can also goad the exhausted boards back into action. See the Windows FAQ on sleep,
To prevent programs from waking your computer
    Open Power Options by clicking the Start button, clicking Control Panel, clicking System and Security, and then clicking Power Options.
    On the Select a power plan page, click Change plan settings for the plan that you want to change.
    On the Change settings for the plan page, click Change advanced power settings.
    On the Advanced settings tab, expand Sleep, expand Allow wake timers, choose Disable for both when your computer is running on battery and when it's plugged in, and then click OK.

All our computers run a nightly backup job in the wee hours, to save data to a NAS drive. So I didn't disable the wake timers, as we need the backup tasks to wake up and run.

Similarly to the above, the power plan can be set so the computer will automatically go to sleep after some set minutes of idleness. If only this worked as well for my monkey mind.. but I wander. The problem now is sometimes it doesn't go back to sleep after running the backups.

To fix this, run the horrible new Windows 7 Event Viewer. Start, Control Panel, Administrative Tools, Event Viewer. Wait patiently for the immense gobs of .NET code to load and initialize. Then expand Windows Logs, select system, on RHS select 'Filter Current Log', pick 'Event Sources', pick 'Power Troubleshooter' to show all the wake events and their causes. Scroll through these to look for culprits.



Or, use the powercfg again:
powercfg -waketimers
shows everything with a wakeup,
powercfg -requests
shows what's keeping it up at night.
In this case,
DISPLAY:
None.
SYSTEM:
[DRIVER] \FileSystem\srvnet
An active remote client has recently sent requests to this machine.
AWAYMODE:
None.

There should not be any remote clients for this machine.
Who is out there requesting things I cannot deliver ?
Trolling through the dismal swamps of online forums suggests:
- Go to Services and disable "Windows Media Player Network Sharing Service".
Disabled, no change.
- Start, Control Panel, Network and Internet, Network and Sharing Center, Advanced sharing settings
Check under media streaming to block all sharing.
Nope, that wasn't it either.
- look for the Server service. I do loathe it when Windows names its services with these multivalent signifiers, so they look more like infections than reputable services. Apparently the Server service serves up a delectable dish of heaven-knows-what from my computer to random queries from heaven-knows-where. I can't think of a good reason for it to do that. Start, Control Panel, Administrative Tools, Services, locate the Server service, rightclick and disable.

Now at least my PC has quiet nights. With Windows 8.1 you are back on your own, have not attempted to debug its insomnia. Time for my tryptophan.. 

Update for Windows 10: 
all of the above still works. 
There's a new cause for failing to sleep, though. 

powercfg -requests 
shows 
EXECUTION:
[PROCESS] \Device\HarddiskVolume2\Windows\System32\MoUsoCoreWorker.exe 

This is the windows update service, running constantly in case I want to install optional updates. It's a bug introduced in Windows 10 fixes of April 2020 and again in September 2020. 
Stop and restart Windows Update Service which may work temporarily. Or, go and install the optional updates. At some point another Windows fix might resolve this, we live in hope. 

Update for Windows 10 in 2023: 
all the above still works. 
Newest caffeine pill for Windoze, no doubt introduced by yet another botched Windows fix - 

powercfg -LASTWAKE 
Owner Supplied Reason: Windows will execute 'NT TASK\Microsoft\Windows\Media Center\mcupdate_scheduled' scheduled task that requested waking the computer.

Start taskschd.msc from a Command prompt run as administrator. 
In the left pane of Task Scheduler, expand Task Scheduler Library, Microsoft, Windows, click on Media Center. 
In the middle pane, right click on mcupdate and select Properties. 
Go to Triggers tab and delete or disable all triggers. 
Go to Conditions tab and uncheck box for 'wake computer to run this task'. 
Go to Settings and uncheck all boxes related to starting. Leave the boxes for stopping the task and forcing the stop checked. 

Also go to Control Panel\All Control Panel Items\Power Options\Edit Plan Settings
Pick Advanced, expand the Multimedia, set When Sharing Media to 'Allow the computer to sleep' 



A poem by Charles Bukowski, for the ancestor of my Intel chip.

16-bit Intel 8088 chip

with an Apple Macintosh
you can't run Radio Shack programs
in its disc drive.
nor can a Commodore 64
drive read a file
you have created on an
IBM Personal Computer.
both Kaypro and Osborne computers use
the CP/M operating system
but can't read each other's
handwriting
for they format (write
on) discs in different
ways.
the Tandy 2000 runs MS-DOS but
can't use most programs produced for
the IBM Personal Computer
unless certain
bits and bytes are
altered
but the wind still blows over
Savannah
and in the Spring
the turkey buzzard struts and
flounces before his
hens.

Wednesday, January 29, 2014

science sings a lullaby


The Sciences Sing a Lullabye
  by Albert Goldbarth
  
Physics says: go to sleep. Of course
you're tired. Every atom in you
has been dancing the shimmy in silver shoes
nonstop from mitosis to now.
Quit tapping your feet. They'll dance
inside themselves without you. Go to sleep.

Geology says: it will be all right. Slow inch
by inch America is giving itself
to the ocean. Go to sleep. Let darkness
lap at your sides. Give darkness an inch.
You aren't alone. All of the continents used to be
one body. You aren't alone. Go to sleep.

Astronomy says: the sun will rise tomorrow,
Zoology says: on rainbow-fish and lithe gazelle,
Psychology says: but first it has to be night, so
Biology says: the body-clocks are stopped all over town
and
History says: here are the blankets, layer on layer, down and down.


Tuesday, October 29, 2013

late season

Preferred time to go fishing is late September or early October, when all the other fishermen have started hunting and the crowds thin out. What with one thing and another it's usually late October by the time we actually show up, leading to crisp mornings at best and full flight just ahead of an incoming blizzard in most years. We had to stop at Albany County Weed and Pest in Laramie on the way out, to have the canoe inspected for invasive zebra mussels. The cheerful young woman in charge of pests cleared us for import at 6am, with a side conversation about pocket gophers, methods and techniques in control of.


This year the rains came late and hard, so there was still water in the rivers. This is of course Big Lost Creek, with Little Lost Creek coming in on the right. The 4wd road in was a mix of ice, snow, greasy mud, and ice-crusted puddles of indeterminate depth. Fortunately Ken has an actual fishing truck which is quite at home in these conditions. Coming over the top of the hills we found a recent hunting camp with a fine stack of cut wood from the beetle-killed pines. We inspected camp to find the gralloching crossbar in the trees with some tufts of fur beneath; concluding the hunt had succeeded and they would not be back, we salvaged the firewood. The deer watched us carefully. 

I fished all the way down that beautiful riffle without seeing so much as a fin. Despite years of experience to  the contrary I still expect trout to move to the streamer in three feet of clear water. In fact you need a large BB shot on the leader to take the fly down to just above the cobbles and sand of the bottom. Ken took pity and corrected my rig so it started working.  


This is the last legal pool on public land, with fiercely worded signs hedging the lower end, "Trespassers will be violated" or some such sentiments. Every year we contemplate tossing the canoe on the pool to take advantage of the strange water laws of the West, under which a legally navigable waterway cannot be closed and private: every year the fishing in this pool is good enough that we never quite take the trouble. 


That's the last grip-and-grin picture, I promise. The rest have only the beautiful fish and scenery unspoilt by some grinning ugly mug. Up on Little Lost Creek, Bucky and his friends had constructed a fifty-foot wide beaver dam across the lower end so the usual fall run of spawning browns up from the main river was blocked. Bloody engineers. 


There were still fish up there, but just the smaller resident browns and a few rainbows. This fine spotted fellow was in a small run, a sort of miniature steelhead pool, strong green currents folding into a deep obscurity at the bend from which he rose to savage the streamer.


Private property begins about a mile up this creek, beyond which is an industrialist's fortune invested in good solid Western land, plus cows. We fell back to the main creek in the late afternoon. 


This riffle always looks promising but it is quite shallow. Fished it at a hazard, hoping the good water year would provide some cover. By golly there they were, several strong silver red-spotted browns quickly, before I tangled the leader around the splitshot and broke everything off. It was late and we'd caught enough by then. 


An hour after dark the tent had between an eighth and a quarter inch of frost layered on, both inside and outside. Getting into the tent was accompanied by a sort of snowstorm as the frost showered down on my inadequate sleeping bag. That is the first time in my life I've had cold toes in a sleeping bag, even after wool socks. In the morning we left quickly, to drive up the greasy mud slopes while they were still frozen hard. Shortly after dawn back on the hills it was very Wyoming. 


Breakfast in a Riverside cafe, or was it Encampment ? One side of the river is Riverside town, the other Encampment. The prospect of uniting as a single town gives them something to argue about during the long winters. There are two establishments in the combined towns, one is better for eating, the other for drinking and fighting. We chose eating, with a comfortable table in the sun, where the nice waitress Rusty served us and a couple of hunters. 

On through Saratoga, once more surrounded by private property. On a bluff above the river a huge newish castle hangs over the waters, its copper roof now a subdued verdigris. The builder died recently leaving his acreage to a family indifferent to its prospects: the future's uncertain and the end is always near. In the old days the cowboys and ranch hands worked for wealthy cattle barons, now it is wealthy software barons, which is which. The Saratoga airport in July is choked with private jets up to and including Boeing 737s for which the runway had to be extended. We visited the Hot Springs free pool, but neither of the fools on this trip had thought to bring a towel, planning instead to cut our long underwear off just in time for the spring bath. 

Out on the plains the pronghorn mooned us, knowing full well the season was over. 


We made camp out at the implausible plains lake with the salvaged wood arranged for maximum sun and drying effect. It looked like we were preparing for a convivial evening with plenty of seating, instead of the two misanthropes grumbling like old dogs at the cold that in fact ensued. 


Fishing here was slow but good, fat happy rainbows swimming hard in the cold water. 


In the upper pool some huge brook trout were contemplating on spawning, insensible to anything we could offer. A fly tied for carp brought the biggest fish of the evening, 20" or so, lost near the boat when attention was not paid and I wrenched the fly out of its hold. 

Ken built a fire buttressed with the large damp logs. The breezes funneled through the cracks between the logs to create a sort of blast furnace effect, all Halloween orange and chimney red under a band of stars. 

In the morning both sage grouse and  pronghorn wandered by. The grouse crossed the road ahead of us with that 'who, me ?' look about the eyes to show they weren't really there, just sauntering by actually, we were just leaving.. 


Private land again, here opened to the public via an easement which does not allow for driving to the reservoir. Instead we have to hike the canoe through sagebrush. While I hiked back to fetch the anchor, Ken dealt with two huge slab-sided rainbows,  the second on a #22 fly and 6x leader in among willow bushes, for extra credit.

The brookies here were smaller but more willing fortunately. Please to forgive my blurry one-handed picture, I just like the colours.



The sun down, the light in the water dies and turns a hard flat grey. It is time to leave before winter closes on us.

If you should dip your hand in,
your wrist would ache immediately,
your bones would begin to ache and your hand would burn
as if the water were a transmutation of fire
that feeds on stones and burns with a dark gray flame.
If you tasted it, it would first taste bitter,
then briny, then surely burn your tongue.
It is like what we imagine knowledge to be:
dark, salt, clear, moving, utterly free,
drawn from the cold hard mouth
of the world, derived from the rocky breasts
forever, flowing and drawn, and since
our knowledge is historical, flowing, and flown. 
- Elizabeth Bishop, The Fish Houses