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."