Wednesday, August 21, 2013

Ubuntu 12.04 and Wireless Not Playing Nice... When on Battery.

Wrong place, wrong time. Story of my life.

I ran into this problem when, in one of my insomiac states, was writing some code on the Linux side of my laptop. In my vantage point it appeared I really broke something. When I booted up, Ubuntu would connect to my Wireless network. At least it said it did... but I couldn't reach the internet. So after a few profanities, I resigned myself to the fact that i wasn't going to sleep just yet. And started the investigation.

First I looked to see what did go right and typed the ubiquitous:

ifconfig -a

This returned and showed that I indeed did have an IP Address leased from my router. It also showed errors on transmit and receipt. Uh-oh. I then tried to ping my router... no dice. I found that if I turned off wireless through my laptop button and turned it back on it worked! But when I rebooted, and it automatically connected, I was back to the problem state.

Head bowed down, I then went off down the troubleshooting-bricked road. Restarted the router. Nope. Checked resolve.conf. Nothing in there. Checked to make sure software and hardware firewalls were behaving. Nice try. and then...

I noticed that the signal strength dropped and was very weak. Even though I was a few feet from the router. "Odd," I thought. But it had to be something to do with what I was working on. Right? Right?!?

It then dawned on me that at my home I'm never on battery power... could it be... could it possibly be an incompatibility with Ubuntu power management on battery and my wireless card (Intel 5100 AGN, for you keeping track at home)?

I began an internet search on this and found that there were indeed issues for some wireless adapters when on battery. I couldn't find a setting to change, but I did find that there was a work around. Basically you create a blank file called "wireless" and copy it to:

/etc/pm/power.d

This is because this blank file is read first and that other power management wireless file located
in /usr/lib/pm-utils/power.d is ignored.

I then rebooted, and low and behold, my problems went down the drain. Get it? Drain? Like battery drain? Ah, never mind.

Of course this might mean shortened battery life, but who cares if you can get some sleep?


Wednesday, August 7, 2013

The Strange Case of Creative's X-Fi Randomly Uninstalling Itself

Flashback to January of 2012. That's when I first put my old Creative X-Fi platinum into my office PC.  Although, like most (if not all) modern Motherboards, mine had on-board audio, I still wanted to install the X-Fi. For one, I liked the fidelity. For another, I liked the break-away box I could install in the front of the case; it gave me a wider variety of connections. Stereo aux-in RCA jacks, MIDI-in and MIDI-out connectors, a quarter-inch headphone and stereo mic/line-in jacks with volume control, plus coaxial and optical S/PDIF inputs and outputs. Oh my.

I've had this setup for awhile and eagerly installed it into the new PC. Everything seemed to install fine (and due to past experiences with Creative drivers causing BSOD, this was a good thing), when, a day later, I noticed that I had no sound. Looking into Sound properties of Windows 7 I could plainly see the "speakers" output was missing. I uninstalled the X-Fi from device manager, rebooted, and everything was back. Besides my settings, of course.

And so began the vicious, frustrating cycle. Well, maybe not vicious... but definitely frustrating.

I tried to figure out what was going on to no avail. Installed the latest drivers, etc. Still from time to time (and with seemingly greater and greater frequency) a reboot would mean I was in the soundless Gulag. Granted, I got a little smarter and, instead of rebooting, I just right-clicked Sound, Video, and Game Controllers in device manager and selected Scan for Hardware Changes. This circumvented the rebooting step but still amounted to a major pain.

I gradually learned to live with it. Occasionally, I'd scour the internet in nerd rage to find some seemingly sensible answer, and time and time again I'd end up (eventually) with no sound. As time rolled on,  my attempts became fewer and fewer; my resolve less solvent. I had regulated my self to the cold, bitter winters of creative re-install land. I had given up.

So almost a year and a half later it happened again. Nothing new there. But something bubbled up within me. Perhaps because it was late. Perhaps because I was sick of being bullied by this hunk of silicon. Or maybe a little of both. I screamed, "Enough!" and decided that I was going to solve this once and for all or relegate the card (and break-away box) to the bin. Either way, I had no plans of letting this cycle continuing any further.

Well unlike my previous searches, I found more info on it. First that I was not alone. And second, it seemed to have something to do with the Creative driver (yeah, not surprised) and  having an SSD. Wow. Leave it to Creative to party like its 1998 with an outstanding driver issue on new but not so new hardware.

 I worked through every post on the Creative thread. All 560 of them. Within were a lot well meaning community provided answers which included different drivers, different uninstall procedures, and even programs to change the driver load order. Nothing worked. I thought I'd try one last thing, and then throw the white flag. I figured I'd move the windows swap file from its place on the SSD to one of my mechanical HDD data drives. I don't know what made me think of that -- probably because it was 4am -- but I figured why not. So I moved the swap file from my SSD to my mechanical HDD.

You know what? It worked. It's been two weeks and nary a re-install in Creative land. I've been basking in the warm glow of constant sound since.

Any repercussions to moving the swap you might ask? I don't think so. If anything, it will prolong the the life of your SSD drive (although the amount might not be too significant). Some people even suggest running without one with machines that contain large amounts of physical RAM -- though I didn't want to do that.

So without further ado, here is a step-by-step of changing your swap file location. I won't be going over how to uninstall/install the creative driver. If you are here, you know how to do that oh too well. And because I never. Want to. Do that. Again. Not even in my mind's eye.


  1. Install the Creative Drivers so they are installed and working. I'm using the SBXF_PCDRV_L11_2_18_0015A drivers for Windows 64-bit.
  2. Click on the Win 7 Orb -> Right-click Computer -> Properties...
  3. In the left pane, click the Advanced Settings link.
  4. Choose the Advanced tab, and in the Performance group box click the Settings... button.
  5. In the Performance Options dialog, select the Advanced tab. Click the Change... button located in the Virtual Memory group box.
  6. This is where the magic happens. (1)Uncheck the Automatically manage paging file size for all drives check box. Select your C drive from the list box (pictured). (2)Select the no paging file radio button. (3)Click the Set button.
  7. Still in the Virtual Memory dialog, select the mechanical HDD you have (in my case, E). Select the System managed size radio button. Click the Set button.
  8. Click Ok 3 times to dismiss all the dialogs. Reboot your machine and enjoy not reinstalling those freaking drivers and trying solutions as, Brian Fantana would say, "60% of the time works everytime."

Saturday, May 4, 2013

The Living Room PC, User Shells, and the Long Logoff Goodbye...

The Turing Box, my HTPC, lovingly named after mathematician
 and computer scientist Alan Turing

In a past post I mentioned that I was building an HTPC of which the lion's share of purpose was going to be towards living room gaming. One of my goals of the project was to create a device that was going to resemble more of a living room appliance (but of which I had full control) than a personal computer. To accomplish this, I removed the Windows branding, changed the login background screens to an image of my own choosing, and even created a custom startup animation (pictured above).

The last piece of the puzzle was removing windows explorer altogether when the user logged in. The visible effect of this is when logging in the user no longer sees the desktop, but instead only sees the application that runs as a shell. Why would one want to do this?

  • Performance - By having this program be the only one running (besides some windows services), it will have majority use of windows resources. This also cuts down on a lot of windows activity that comes along with launching explorer.
  • Start Time - The start time of the program (as a shell) is near instant.
  • Stability - As the only application running, the chance of conflicts decrease.
  • Clarity - When the user goes straight to the shell there isn't any discerning of purpose; you are up and running!
  • Cool Factor - It's just extra geeky cool to build your own appliance!

Now to accomplish this you have to substitute another program as a shell. In this you have a couple of options. You can replace the complete shell or on a by user basis. The complete shell wasn't really what I wanted to do, I wanted the logon screen to be present. I just wanted each user to have a separated shell or concern. Basically, on the Turing Box your "users" are nothing more than buttons to start an activity.

Some of the activities on the Turing Box

So next I'll explain how I setup one activity, "Play," on the box. I'll then talk about a nasty bug I ran into that took trial and error to figure out. Keep in mind this isn't a detailed tutorial, just a discussion about the major things I changed. I won't go into the customization of login background screens or startup animations... maybe in another post!


Setting Steam as the Alternate Shell

NOTE: This article talks about changing your registry. Only attempt if you really do know what you're doing (or could care less about wrecking your PC). Even then, proceed at your own risk. There really isn't anything in here that *should* be that dangerous, but I've seen people dazzle with how much damage they can dole out with seemingly no opportunity.

First things first, you should have one administrator account which is active and not part of these shenanigans. I make the other accounts, normal user accounts. This is to enforce the principle of least privilege for both security and consistency (each of these activities is a concern, or task, and none of them involve installing software). 

So, from within your "Play" account launch Steam and start it in Big Picture Mode (using the "Big Picture" button in the upper right hand corner of the Steam interface). Click the Gear Icon ("Settings") and then select the Account menu item. Finally check the "Start Steam in Big Picture Mode" option.

Setting Steam to start in Big Picture Mode

Note that I am participating in the beta. You don't have to but, at least currently, I'd recommend it. There is a Direct3D bug, causing frequent crashing of the steam client,  that was introduced to Windows 7 through the IE10 install (whether or not you use the browser) and the latest beta client corrects for that. Ok that's it for Steam. Now on to the registry!

It's important that you change the registry key while logged into the "Play" user account. You'll be changing the HKEY_CURRENT_USER key and you wouldn't want to change the wrong one! Go ahead and open regedit (WinKey+R -> type "regedit" without the quotes).

Obviously at this point you'll want to back up your registry. Browse to and export the following key somewhere safe.

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon]

In this key you will want to create a new string value and name it "Shell" (without the quotes).

Add the Shell String Value
Now, Double click on the "Shell" value and add the path to the Steam client. For example:

C:\Program Files (x86)\Steam\Steam.exe

And that's it! If you log off and log on as "Play"  it should go straight to Steam in Big Picture Mode. Now here are a couple of things to keep in mind:


  • Steam right now doesn't have a "Log off" feature from the GUI's power menu. To log off, Press CTRL+ALT+DELETE and select Log off from the menu.
  • To temporarily bring up a desktop (say if steam crashes and all you have is a black screen), simply press CTRL+ALT+DELETE, and start task manager. Click the "New Task..." button on task manager and type "explorer" (without the quotes) followed by enter. That will get you a desktop. Note: In newer versions of windows, this might not be possible to bring up explorer in this way. If you experience this, simply open regedit and change the key to "xShell" signout and sign in and you should see explorer. When done change back to "Shell" signout/sign in. 
  • At any time if you want to restore explorer as the shell, go to the key above logged in as the "Play" user (and be careful that it is the key above), select the shell key value (it should have that Steam path) and delete it. When complete there should not be a value called "Shell" at all there. Log off and log back on and you should be back to the usual Redmond experience!

Logging off is so hard to do...

And that brought me to the proverbial fly in the ointment. Everything was working swimmingly... until I logged off. It took forever. How long varied, but it took over an hour at one point! This behavior did not occur when I logged off with explorer as the shell.

I tried so many things to find out what this was. But every rain dance I tried yielded no, well, rain.

Finally I started from scratch and did a clean boot. This is where you launch msconfig.exe, hide Microsoft services and disable everything. It worked! The log off was under five seconds. I then proceeded to add back in the startup processes and then the services, one by one until it failed. It was the last service. I kid you not. The culptrit? The Broadcom Wireless LAN Tray Service. I disabled this and everything worked as expected!


Last Thoughts

And there you have it. For each user you want to add simply repeat these steps adding a different exe for the shell and you should be good to go. A word of advice if it is a browser: use Firefox and not Chrome. Chrome doesn't render pages properly without explorer running. Not only does firefox render fine, it is naturally written to behave as you would expect in a sort of "Kiosk" mode.

Hopefully this helps you on your quest for the perfect living room PC experience. Happy shelling!

Friday, April 26, 2013

Dealing with old Saves in Bioshock Infinite



I feel a little compelled to say some things myself about Bioshock Infinite, but for now I wanted to share this tip (which I learned the hard way). One thing that is painfully obvious is Papa Bear Levine went without Save Anywhere or Quick Save. What's worse is that you can only do one playthrough at a time. You can save off your current saves (in Steam) by turning off cloud sync in steam AND the game's options and copying off the folder:

[steam install folder]\userdata\remote\[Your Profile ID (a Number)]\8870\remote\savedata\

But what you might notice (when you copy these saves in) especially after a new install, is that when you start a game "Continue," in the gameplay menu, is grayed out. This has to do with the file dates being older than the current date. To get your save to work:

  1. Go to [steam install folder]\userdata\remote\[Your Profile ID (a Number)]\8870\remote\savedata\
  2. Copy off any files you want to save here and then copy in your old saves you want to use. Sort by date.
  3. The one on the top is the newest (or should be) memorize that file name.
  4. Open a command prompt (WinKey + R and then type cmd and hit enter).
  5. In the command prompt, change directories (cd) until you have found thesavedata folder above.
  6. Type copy \b [FileName memorized in step 3].sav +,, (This is sort of the DOS equivalent of the linux touch... and yes, the +,, is necessary)
  7. Hit enter.
  8. You should see that the filename you memorized in step 3, but with a more current date... and "Continue" should now be actionable. 
Now, find the girl and wipe away the debt.