The OS Wars II: Bitten by Bluetooth, Seeing Double, and Talking To The Palm

During a chess competition a chessmaster should be a combination of a beast of prey and a monk. — Alexander Alekhine

I’m well known for being stubborn. Very stubborn. When I run into a problem, I pound my head against it until either my head breaks or the problem does. So far, it has almost always been the problem… my six-month attempt to compress random data streams is the only one that has out-stubborned me. Not surprising, since it’s impossible — something that I knew before I started — but doomed or not, I learned a heck of a lot from the attempt.

The latest irritations to get the cranial jackhammer treatment, and the reason this blog has been so quiet for the last little while, have all been related to Ubuntu Linux. The first of them was getting my laptop’s external monitor working.

I’ve used a dual-monitor setup for a long time. It’s very useful for software development, and even when I’m not developing software I generally keep a number of programs running simultaneously. But as mentioned earlier, after I installed the closed-source nVidia drivers to get the more advanced graphics working, every time I restarted Linux with the external monitor plugged in, the internal one would shut off, and if it was restarted without the external monitor, the external one would never be used. It seemed like I couldn’t get both of them working at the same time.

A little research showed that there was a way to do it, as expected. Something called Xinerama. I dug up a tutorial on how to do it (Hack #50 in O’Reilly’s Ubuntu Hacks) and set to work. And it worked!

Kind of.

Xinerama really slowed down the graphics. When I switched to a different side of The Cube, I could barely see any graphical change before I got to the new side. I’d grown fond of The Cube and all of the other advanced graphics, so I kept looking.

Further into that section of the book, there was a piece on how to use nVidia’s own multiple-monitor system, called TwinView. It was much easier to set up, and faster once it was. Still not fast enough to satisfy me when I had both monitors at their full resolution, but turning the resolution down a bit on the external monitor gave me everything I needed. It’s beautiful. 🙂

Next up: getting my Palm TX synchronizing with Linux. This turned out to be a lot easier than I expected… with a few exceptions. It seems that the to-do list conduit for the Evolution program is broken. Not a big deal, I mostly just wanted my calendar and contact book synchronized, but it’s an irritation. I considered moving to the J-Pilot program instead, but I decided it wasn’t worth the effort. Maybe later.

Of course, I still couldn’t get Note Studio working in Linux. After looking into running Windows under Xen, I decided to pass on that… it’s more work than I’m willing to put into it, and no guarantee that it will work properly afterwards. So I picked up the trial version of VMware Workstation for Linux, dropped a copy of this system’s Windows XP on it, and it happily accepted the Palm Desktop and Note Studio. I had to set the conduits such that most of them (other than Note Studio and BackupBuddy) only went from the Palm to the desktop, rather than two-way synchronization, but that isn’t a problem either.

Finally, the problem that I’ve spent the better part of the last week on: Bluetooth.

As I’d described previously, my Bluetooth keyboard and mouse worked under Linux, but they were temperamental. When I reboot the system, they only sometimes work; I’d usually have to manually reconnect to them, pressing the buttons on the bottom of each device and running “sudo hidd --search” on the computer itself. Possibly several times, because it didn’t always see the devices immediately.

I decided that wasn’t good enough. I wanted both of them to just work, from the moment the system booted up. Time for some research.

The first thing I turned up was that a lot of other people were having the same problem. Or rather, the same kind of problem… the fixes listed there didn’t work for me. After several days of trying various things to get it running properly, I had only succeeded in breaking it further — now it never connected automatically, instead of only rarely. Then I ran across this page.

Most of it was irrelevant, but there was a command I hadn’t seen before: “hciconfig -a“. I tried it, and compared my results to the ones shown there. Hm… my system didn’t have the PSCAN and ISCAN bits listed on the third line. A little further research showed that this was likely the source of the trouble, because one of those makes the computer “discoverable” and the other one makes it “connectable.” This page showed me how to set those manually (“sudo hciconfig hci0 piscan“), and as soon as I did so, the Bluetooth devices connected!

That wasn’t the full solution, I still had to delete all the files and directories under /var/lib/bluetooth/, add the “sudo hciconfig hci0 down” and “sudo hciconfig hci0 up” lines to the start_hid() section of /etc/init.d/bluetooth, and manually reconnect them one last time — but after all of that, they work, even after a reboot! Or at least they have so far. We’ll see whether it continues.

One slightly sore head, but three more problems down. 🙂