Xfce Volstatus Icon 0.1.0

Yesterday I released the first version of my Xfce Volstatus Icon. It's a pretty simple little app; all it does is sit quietly (and invisibly) in your system tray until you plug in a removable device (like a USB flash disk or an iPod), and then it turns into a little icon that you can click to easily and safely unmount and/or eject the device so you can physically remove it.

The code for the icon itself is relatively simple; it's all less than 2000 lines of C. Another 2000 lines resides in 'ghal', a library I've written to act as gobject bindings for libhal and libhal-storage. Currently it's not documented at all, and it's not released as a separate library dependency, but included in the xfce4-volstatus-icon source package. I first wrote the libhal bindings for Airconfig, and then extended them for volstatus to include libhal-storage.

The upshot is that you can create a GHalContext object, and connect to gsignals on the object such as device-added and device-removed. You can enumerate devices (GHalDevice objects) on the system via their UDIs. Now ghal also knows about 'special' devices, which are subclasses of GHalDevice: GHalDrive, GHalVolume, and GHalVolumeDisc. The cool thing is that you don't have to know what they are explicitly. ghal_context_device_from_udi() will create the right kind of device and return it to you cast to a GHalDevice; you can use e.g. GHAL_IS_DRIVE() to determine if it's also a GHalDrive, etc. Currently you can use ghal_context_find_device_by_capability() to find devices of particular types if you know the HAL capability strings, but I plan to add convenience API to abstract the capability strings.

I'd also like to add more objects, like GHalComputer (the root computer object), and support for performing actions on particular devices (like mount/unmount for volumes, suspend/hibernate for the power management interfaces, etc.). I'm also debating including some parts of Airconfig in there as well (mainly the interface control stuff), though I'm not yet convinced that that's necessary or useful, especially since it currently relies on a custom HAL addon and method-invocation scripts. At any rate, I think it's pretty useful for people who want to use HAL just like any other glib/gobject-type services, and I'll turn it into a standalone library Real Soon Now[tm].

(Yes, I know about libhal-glib, written by Richard Hughes for gnome-power-manager. However, I don't really like the API that much, and it obviously has a decidedly power-management-slanted focus that I don't need.)

Jerry Springer + Congress = Awesome

If US Congress was more like Taiwan's Parliament, I think many more people would be interested in politics.

Stupid Motherboard

Ok, this is retarded. About 2 years ago, I bought a DFI K8M800 MLVF motherboard to act as the foundation for my HTPC/PVR box. This was before I had my 6.1-channel sound system, so at the time, I was ok with the onboard VIA 8237 sound chip, which, without buying an extra connector bracket, would more or less just give me 2 channels.

However, after setting stuff up, I had no sound. I was not pleased. I googled and googled, and found that the ALSA driver for that chipset (snd-via82xx) was a little messy, and sometimes you had to pass special parameters to the driver to get it to work for your particular hardware. I tried a bunch of combinations, but had no luck. Eventually I gave up, and bought a cheap Turtle Beach card. By that time, I'd bought my surround sound system, and wanted something that could do digital S/PDIF out (though this card only does coaxial, not optical, but whatever).

Lately I've been thinking about reducing power usage on the HTPC, with the possible intent of retiring my desktop machine and moving all the data to the HTPC on a RAID array that I'd build and put in an external box using something like eSATA. I'd also need to free up a PCI slot: even though I'm only using 2 of the 3 slots, the 3rd slot is effectively blocked by the large fan on my AGP video card. So, I thought it would be a good idea to try to get the integrated sound working again.

So, I resumed googling, and messing around, and still, no luck. Tonight, I decided to google my specific motherboard. This led me to the ALSA bug tracker, where I put in a broader search query for all bugs related to the via82xx driver where there was no sound. With a little luck, I came across a post that said something about having disabled the rear outputs in favor of the front outputs on their multimedia-oriented case.

This rang a bell.

I dug out my motherboard's manual, and, sure enough, connecting the front in/outs on a case to the appropriate header on the motherboard will disable the rear outputs. Of course, I'd never done this, as I hadn't cared about the front audio jacks. But I thought I'd look anyway. Apparently, two pairs of pins on the header need to be shorted if you don't intend to use the front outputs. Otherwise the rear outputs still get disabled. You'd think that DFI would ship the motherboard with these pins already shorted, since you'd want to get some sound out of the box if you don't go and connect anything to the front outputs. But no, I see the header, plainly sitting there with its pins un-shorted. So, I dig out some jumpers, short the pins, boot the box, load the driver, unmute the mixer channels, and... voila... I have sound.

I can't believe the amount of time I wasted on this, and it turned out to be a hardware problem in the end! I was so afraid that it was a Linux software issue, and it was actually hardware. Sigh.

Time to go order that S/PDIF bracket...

Patented Farts

Those guys over at United Aircraft really take their flatulence seriously.

Stupid Words

I'm very curious as to where the words "orientate" and its opposite, "disorientate," came from. They sound incredibly stupid. What was wrong with "orient" and "disorient?" Fewer letters, and you don't sound like a retard when you say them. Dictionary.com even says that the longer versions just mean "to orient" and "to disorient." Everybody wins when you use the shorter form. Using the longer form means you like to kill puppies.

Rejection

From The Examiner:

Lots of schools are vying for the “most emphatic rejection” prize. Cornell is leading the race, informing students in consecutive sentences that the electronic rejection they are reading will be confirmed in a follow-up letter that will make the rejection official. We don’t want you. Get it? We really don’t want you. The “snuff out all hopes” double rejection strategy appears to be colleges’ latest attempt to improve their U.S. News & World Report selectivity rating. Two rejections for the price of one. What tipped the scale in Cornell’s favor is that they even include an invitation for you to visit their Web site to get information about applying to transfer to Cornell after your freshman year, so they can reject you again.

Awesome. Absolutely awesome. My alma mater never stops entertaining me.

Open Phones

Screw you, iPhone. I want one of these.

I stumbled across a blog post about the OpenMoko platform today. I'd heard of it before, but never really looked into what it was.

I'm not sure I'm quite ready to give up my insistence on a small flip-phone in favor of a more multi-function device, but if I did, this would be what I'd want. Sadly, I'm afraid it won't gain much traction in the US without some kind of deal with a major wireless carrier. US cellular customers aren't used to buying a phone, and then later finding service for it. Hell, most US cellular customers aren't used to buying a phone, period: the phone comes free (or at a very low cost) with a service contract.

And the carriers won't like this phone. The end-user can modify any aspect of the software that runs on it? That's a big no-no. The carriers love their closed systems, and love controlling what you can and can't run on the phone.

But still, I remain optimistic. It might start out as a geek toy, but that's how most popular tech advancements begin to enter the mainstream.

I'll definitely be keeping tabs on OpenMoko to see where it goes.

Airconfig Screenshots

By popular demand, here are a few Airconfig screenshots. Note how the signal strengths are all 100% in my menu; part of the blame lies with the bcm43xx driver's inability to report proper quality values. (But hey, I'm just thrilled I can use wireless on my PowerBook under Linux with a nice set of free [as in speech] drivers. Yes, consider that a middle finger tossed in the direction of Broadcom.)

« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 next »