A new server (part 1)

Posted by Scott Laird Sat, 20 Oct 2007 04:56:19 GMT

A few days ago, I mentioned that my home NAS box had failed, and that I was considering replacing it with a PC server running OpenSolaris and ZFS. I’ve read a pile of ZFS docs, and it looks like the best option available to me today, so I decided to order some suitable hardware.

At that point, pretty much everything broke down. I have a hard enough time keeping track of which hardware works with Linux this week, and OpenSolaris is completely new to me. Sun’s list of officially-supported hardware is pretty sparse, and digging through their mailing list archives gets frustrating quickly. From what I can tell, it boils down to:

  • Current Intel and AMD CPUs are all fine.
  • Most of Intel’s chipsets are fine.
  • Most of nVidia’s AMD chipsets are fine.
  • nVidia and Intel video chips are good.
  • Most common Ethernet chipsets are either supported natively or have drivers available.
  • The only SATA controllers that work are Intel’s ICH southbridges, Silicon Image’s PCI and PCI-E chips, Marvell’s PCI chips, and nVidia’s southbridges. It’s not clear that Marvell’s PCI-E chips work. Most motherboards with additional, non-southbridge SATA ports probably won’t work.
  • Venturing too far outside of this list will probably result in problems.

I was looking for a motherboard with 8 SATA ports, and was hoping that the Intel D975XBX2 (“Bad Axe 2”) would work, but 4 of its 8 SATA ports belong to a Marvell PCI-E SATA chip that doesn’t appear to be supported. I went through every single 8-port motherboard in Newegg’s (the ‘WS’ is important–the P5K is a different board). It only has 6 on-board SATA ports, but it includes a PCI-X slot. That’ll let me use the Supermicro AOC-SAT2-MV8, which is far and away the cheapest 8-port SATA card on the market. That’ll give me a total of 14 SATA ports, which should be enough for a whatever I want to throw at it. The Marvell PCI-X chip at the heart of the Supermicro card is the same one used in Sun’s Sun Fire x4500 48-drive server, so it’s safe to assume that Sun has put a lot of effort into the driver.

Most of the test of the system is fairly generic–a cheap nVidia 7200GS video card (the cheapest PCI-E card that NewEgg carries), a nice case and power supply, RAM, and a boatload of drives.

The one odd component that I’ve added is a Gigabyte GC-RAMDISK with 1 GB of RAM. The GC-RAMDISK is a battery-backed SATA ramdisk; it looks like a hard drive to the system and can survive up to 18 hours without power. I’ve had my eye on this thing for years, and it looks like it’ll be a perfect external log device for GFS. I had to ask to see how ZFS will behave if the device fails, and it looks like manual intervention may be required after an 18+ hour power outage, but it should be pretty minimal. I’m planning on posting some benchmarks here once I’ve had a chance to try it out.

Assuming that I’m able to get this whole mess to work at all, I should have lots to write about here over the next week or so. I’m going to start by explaining why I want to use Solaris instead of Linux or *BSD, and why I’m building something instead of buying a pre-build NAS box.

Tags , , , ,  | 3 comments

Lightweight Home Security with Indigo and Asterisk

Posted by Scott Laird Wed, 15 Aug 2007 16:16:00 GMT

I mentioned last week that I’ve been working on building sort of a lightweight home security system for my house so my 4-year-old daughter won’t be able to sneak out of the house again.

I spent about a day researching possible solutions, to see if there was something simple that I could buy that would make me happy, and I couldn’t find anything on the market that was cheap and would tell me which of my 6 exterior doors had been opened loudly enough to hear from across the house. There’s no point in putting a door buzzer on the basement door if you can’t hear it from the master bedroom. The only solutions that I found were from professional alarm companies, and they probably would have charged me a couple thousand for installation plus $30-$50 per month for monitoring. I’m just not willing to pay that much, and it’s not really what I was looking for–it’s gross overkill for my problem.

So, I decided to build it myself. After a few hours’ searching, I decided to use Perceptive Automation’s Indigo home-automation software for the Mac. It’s commercial software, but I like its user interface and capabilities better then any of the open-source solutions that I’ve seen. It’s under active development, supports just about everything that I need, it’s client-server so I can access it from any Mac I own, and it comes with a nice web interface that I can get to via my phone. I figured that it’d be cheaper to pay the money for Indigo then to spend most of a week hacking away at one of the open-source packages to get them to do what I want. Plus, er, pretty much every open source home automation program that I could find was written in Perl, and I’ve been successfully avoiding Perl for almost 5 years now. The last thing I really want to do is spend a week modifying someone else’s Perl. That kind of thing gives me nightmares.

So I fired Indigo up on an old Powerbook that I had laying around and bought a bunch of hardware from MacHomeStore and SmartHome.com. The important bits are a W800RF32A wireless reciever and a whole bunch of $12 DS10a door and window sensors. The sensors broadcast their state over the air, and the receiver feeds them into my Mac.

That took care of the input side of the equation, but I still needed some relatively cheap way to play audio around my house. I poked around for a while looking at random X10 hardware and radio solutions before I realized that most VoIP phones support audio paging. Since my house is full of VoIP phones and I run my own Asterisk server, all I’d really need to do was write a couple dozen lines of Asterisk dialplan code, and everything should just work. I ended up ordering two new VoIP phones (Grandstream GXP-2020s) because two of the phones that I have are too old to be usable for paging. I probably could have used $45 Budgetones, but I have future plans for the GXP-2020’s big displays, so I decided to spend a bit more for them.

It took me about 30 minutes to unpack everything, install Indigo, and have it receiving data from a test sensor. Each sensor assigns itself a random 8-bit ID when it’s powered up, so the first problem was mapping semi-random sensor IDs onto logical names. Indigo comes with a blob of sample AppleScript for doing this, and it only took me 5 minutes to modify it so that one of Indigo’s internal variables changed state to reflect the state of the door sensor–true when the door is closed and false when opened. Five more minutes and I had a nifty web page with a green blob that turned red when the door opened. A half-hour after that, I had a PNG floorplan of my house that I could use as a backdrop for a bunch of little red/green blobs:

After this, it’s all just a matter of plumbing. First, I modified Indigo’s sensor-handling AppleScript example into something that knows how to talk to Asterisk, using one of the Asterisk/AppleScript integration examples on the voip-info.org Wiki. Here’s I ended up with:

(*
    Door sensor tracking code for Indigo and Asterisk.
    By Scott Laird <scott@sigkill.org>
    http://scottstuff.net

    This code handles incoming security events, maps each numeric
    device ID onto a logical name, and then tells Asterisk to page all
    VoIP phones with a device-specific message.

    Net effect: opening the front door causes "Front door opened" to echo
    throughout the house.

    I'm calling doDialOut directly rather then using an Indigo trigger for 4
    reasons:
      1.  I have the extension name handy here, while I'd have to parse it back out of the variable name if I used triggers.
      2.  Creating an identical trigger for each of 10+ sensors is a pain in the neck.
      3.  We need to do *something* with unknown sensor events, but creating variables for them is pretty clearly wrong.
      4.  My AppleScript is lousy, and I can't get triggers to call doDialOut correctly.
*)

using terms from application "IndigoServer"
    on receive security event of eventType with code devID
        set extension to "unknown"

        -- Map sensor IDs onto logical names.  In a real language,
        -- I'd use some sort of hash and skip the if ... else if ... code,
        -- but I don't see anything suitable in AppleScript.  Sigh.  I'm
        -- stuck writing code in blub.
        if devID is 95 then
            set extension to "frontdoor"
        else if devID is 175 then
            set extension to "deckdoor"
        else if devID is 99 then
            set extension to "stairs"
        else if devID is 201 then
            set extension to "backyard"
        else if devID is 55 then
            set extension to "upgarage"
        else if devID is 155 then
            set extension to "downgarage"
        else if devID is 253 then
            set extension to "slider"
        end if

        -- If we get a request for an unknown devID, then send it on to Asterisk 
        -- so we get an audible indication that *something* happened.  Since batteries
        -- falling out of DS10 modules can cause the ID to change, I'd rather not ignore
        -- these.  YMMV, however.
        if extension is "unknown" then
            my doDialOut(devID)
        else
            -- Indigo variable names are derived from Asterisk extension names.

            -- In retrospect, doorClosed_ is a great name for doors, but not so hot
            -- for doorbells or motion sensors.  Feel free to change this.
            set var to ("doorClosed_" & extension)
            set seen_var to ("lastSeen_" & extension)
            set change_var to ("lastChanged_" & extension)
            set timestamp to (current date) as string

            -- Figure out if it opened or closed.  There are actually 4 different
            -- results that the sensors can return (normal/active X min/max),
            -- but we only care about normal/active.
            if eventType is sec_SensorNormal_min then
                set val to "true"
            else if eventType is sec_SensorNormal_max then
                set val to "true"
            else
                set val to "false"
            end if

            -- Create the Indigo variables if they don't already exist.
            if not (variable var exists) then
                make new variable with properties {name:var, value:val}
            end if

            if not (variable seen_var exists) then
                make new variable with properties {name:seen_var, value:timestamp}
            end if

            if not (variable change_var exists) then
                make new variable with properties {name:change_var, value:timestamp}
            end if

            -- Did the value of this variable just change?
            if not (value of variable var is val) then
                set value of variable change_var to timestamp

                -- If it just changed and it's now false, then send an alert.
                -- The DS10a sensors send a signal once per hour, even if nothing's changed.
                -- So we don't want to alert *unless* something's changed.
                if val is "false" then
                    my doDialOut(extension)
                end if
            end if

            -- We need to keep track of the time that each DS10 was last seen.
            -- This way we can spot bad batteries.
            set value of variable seen_var to timestamp
            set value of variable var to val
        end if
    end receive security event

    -- doDialOut tells Asterisk to dial a specific extension using
    -- Asterisk's management interface.  This doesn't require that Asterisk
    -- runs on the same machine as Indigo.
    --
    -- To get this to work in your environment, you'll need to change the IP
    -- address, username, and password, and possibly the contexts and/or 
    -- extension names used at the bottom.
    on doDialOut(extension)
        log "Paging extension " & extension using type "Dialer"
        set expectscript to "set timeout 20;
spawn telnet 10.0.0.1 5038;
expect \"Asterisk Call Manager/1.0\";
send \"Action: login
username: my_username
secret: secretsecret

\";
expect \"Message: Authentication accepted\";

send \"Action: originate
Exten: " & extension & "
Context: security-paging
Channel: Local/all@paging
Priority: 1
Callerid: Security: " & extension & " <0>

\";

sleep 1;

send \"Action: logoff

\";
"
        set results to do shell script "/usr/bin/expect -c  '" & expectscript & "'"
    end doDialOut
end using terms from

In addition to simply monitoring the current state of the sensors, this also tracks their last change as well as the last time each sensor sent out a “nothing’s changed” report. Eventually I’ll add monitoring for this so I can spot failing batteries immediately, and not two months later when I discover that two doors aren’t monitored anymore. Indigo tracks each variable internally, and gives you a handy window for viewing and modifying them:

Once all of that was in place, it was time to add paging logic to Asterisk. I created two new contexts, security-paging to contain the messages that need to be played back and paging to handle the phones. The AppleScript above basically glues the two ends together, sending ‘deckdoor@security-paging’ to ‘all@paging’. Here’s the relevant bit of my Asterisk config:

[security-paging]
  exten => frontdoor,1,Playback(security/frontdoor)
  exten => deckdoor,1,Playback(security/deckdoor)
  exten => backyard,1,Playback(security/backyard)
  exten => stairs,1,Playback(security/stairs)
  exten => upgarage,1,Playback(security/upgarage)
  exten => downgarage,1,Playback(security/downgarage)
  exten => slider,1,Playback(security/slider)

  exten => _.,1,SayNumber(${EXTEN})

[paging]
  exten => all,1,Page(Local/203@paging&Local/204@paging&Local/205@paging&Local/206@paging)

  ; Cisco 7940; no Call-Info support, but you can create a new line and turn on auto-answer on the phone.
  exten => 203,1,Dial(SIP/203aa)

  ; Sipura 841.  It needs a semicolon before answer-after.
  exten => 204,1,SipAddHeader(Call-Info: \;answer-after=0)
  exten => 204,n,Dial(SIP/204)

  ; Grandstream GXP-2020s, although the same config will work for most modern phones.
  exten => 205,1,SipAddHeader(Call-Info: answer-after=0)
  exten => 205,n,Dial(SIP/205)

  exten => 206,1,SipAddHeader(Call-Info: answer-after=0)
  exten => 206,n,Dial(SIP/206)

Then I just had to record some audio files to use for annoucements. The easiest way to do this is just to call yourself up and leave voicemail, and then copy the VM files over into Asterisk’s sound file directory, usually /var/lib/asterisk/sounds. You could get better quality recordings with a good microphone and audio-processing app, but I’m not sure that there’s really a point, given the quality of most speakerphone speakers.

All told, it took me about 8 hours of research to put this all together, and maybe 10 hours to implement it all, including learning a bit of AppleScript. Now I have a programmable system for monitoring my house, and all of the pieces in place for adding X10 or Insteon components as they make sense. It’s all under my control; if I can code it, then I can make it happen.

So, does it all work? Yep–Monday morning it caught my daughter trying to sneak into the garage. Mission accomplished.

Tags , , , ,  | 12 comments

Backyard Flowers

Posted by Scott Laird Sun, 22 Apr 2007 06:27:37 GMT

I spent most of today trying to catch up on the three weeks’ worth of yardwork that I’d missed while I was in California. I didn’t make all that much progress, but along the way I spotted a few photogenic wildflowers growing in the middle of my back lawn. I still don’t own a real macro lens, but I bought a Canon 500D close-up lens last month before my trip but never had a chance to use it. So took a break from the yard work, slapped it on the 100-400, grabbed a couple flashes, and headed out into the yard. Here’s my favorite:

Flower

All in all, I’m pretty happy with the pictures. The 100-400L plus 500D gives roughly 1:1 magnification at the long end, with way more working distance then I’d expected. It may actually be too long for this sort of photography–I kept having to back up to give myself more room between the lens and the flower, especially at the long end of the lens. Fortunately, my 7-year-old assistant was able to keep the light on the flowers, even as I kept backing further and further away. Good help is hard to find :-).

Tags , ,  | 2 comments

A whole new office

Posted by Scott Laird Fri, 05 Jan 2007 07:03:15 GMT

When my wife and I moved into our house almost 7 years ago, I claimed one of the bedrooms as a home office. I crammed a desk, an 8’ folding table, and 2 big bookshelves into the room, filling it up with Linux systems, big CRT monitors, 2 or 3 printers, a couple scanners, and other big, heavy bits of hardware. I wanted to maximize my desk space, so I put the desk and table up against the walls and worked with my back to the door most of the time, never quite understanding why I didn’t enjoy working in there as much as I’d expected.

In 2002, I bought a PowerBook and discovered that I could work from any room in the house; I wasn’t tied down to big chunks of glass and 30 lb computers anymore. So I mostly stopped using my office for anything but storage. There are a couple servers in the corner, but most of the space is full of hardware that I don’t really need.

I finally realized a month or two ago that I actually want a quiet place to work, and that most of the problem with my home office is that the layout is designed to maximize the number of big CRTs that it can hold. That’s irrelevant now, and has been for years. What I really want is a quiet, comfortable room with one or two LCDs, a place to read, and some place to plug in my laptop.

So, I’ve started on a quest to fix my office. My long-term goal is to repaint, replace the nasty old carpet with something more livable, and maybe even pick up a couch to fit along one wall, but for now I’m starting by moving the desk around so my back is away from the door and getting rid of the big folding table. Then I’ll add a bit of extra lighting so it doesn’t feel like a cave anymore, and replace the two big bookshelves with someplace to cleanly store cables, random camera gear, CDs, and a couple dozen books.

I moved the desk around last night, then moved my 24” LCD onto it. Then I dug the speakers that I bought in 2001 and have never really been able to use out of the mess, plugged them into a nice little surround sound decoder, and wired my Xbox 360 and Wii into the LCD and decoder.

I’m only half-done with the “clean the room up” phase of the plan, but it’s already drastically better. Getting the desk away from the door made a huge difference. I don’t know why I didn’t do it years ago.

Tags , ,  | 6 comments

The sysadmin's home office

Posted by Scott Laird Tue, 06 Sep 2005 22:48:00 GMT

It’s been an interesting experience setting up my home office over the past few days. I remember my parents going through a similar experience when I was in high school–they bought a copier, a fax machine, a new business phone, waited for the telco to install a new line, dealt with the yellow pages people, and spent a couple days in the car dealing with all of the paperwork and supplies required.

So fast-forward to the modern sysadmin-turned-consultant’s home office:

  • Computer: have several. Can produce more from spare parts if needed.
  • Copier, fax: have one of those already.
  • Office phone line: 5 minutes via the website of my VoIP provider.
  • Office phone: dug an old phone out of a box and plugged it into my Asterisk server. It’s nice having a home PBX.
  • Advertising: this blog, networking via friends, releasing newer and more exciting open-source software.
  • Business email and web server: I already have those. I can create more accounts and sites as needed.
  • Business licenses: they’re all available online now, although Washington State’s site requires either IE or Netscape 4, and putting Safari into “lie about your User-Agent string” isn’t good enough.

It’s amazing how easy it is to set up a small business office when your house is already higher-tech then most companies.

Tags , , ,  | 3 comments

Tree Removal for Fun and Profit

Posted by Scott Laird Wed, 25 May 2005 18:16:07 GMT

I’m still recovering from this last weekend–we ripped a 60 foot maple tree out of our back yard. One of the tree’s three main trunks was rotting, and it’d been dropping branches onto our yard and fence for years. It had to go. The problem was that the tree was less then 10 feet from our fence, only 20 feet from our garage, our neighbor’s garage, and the road, and 25 feet from our house. The hard part was getting the tree down without destroying anything.

We mostly succeeded–our garage’s gutter has two little dings, and we cracked one panel of our fence, but we managed to reduce the tree down to a 4-5 foot wide stump. We hauled 5 pickup-loads of branches to the city’s yard cleanup station, and hauled 2 dumptruck-loads of logs and firewood to friends and family. We’re left with a small mound of branches and leaves, but we’ll be able to stuff that into our yard waste can over the next few weeks.

Next up, I need to rent a stump grinder and get rid of the stump. That’ll probably take a few hours–it’s a lot of stump. Once that’s done, we’ll be ready to level things out, add a bit more topsoil, and then re-plant our back yard. It’s been ailing for years–the combination of the tree’s shade, damage from my sister-in-law’s dogs, and neglect have reduced it to a sea of moss and dandelions.

I keep forgetting how much I enjoy large-scale yard work. It’s a nice counterpoint to the week’s computer work, plus it gives me an excuse to play around with heavy equipment every now and then. How can you argue with that?

Posted in  | Tags , ,  | no comments

Traffic

Posted by Scott Laird Tue, 08 Mar 2005 07:23:21 GMT

It’s sort of an axiom of programming that features that aren’t continually used or tested won’t actually work. A similar rule holds for system administration–any feature that hasn’t been tested since the last upgrade is probably broken. An obvious corollary suggests that systems get more reliable as their user load increases–more users means more features are used more frequently, and broken features will be spotted sooner. And the corollary to that is that any server wedged under a desk in someone’s home office is probably flakier then hell because it’s probably just sitting there collecting dust and not getting used.

I’m not convinced that that applies to my home gateway box. It’s a busy little beaver:

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes  prot opt in out source           destination     
 234M   75G  all  --  dsl0   *   0.0.0.0/0        0.0.0.0/0       
  47M 1001G  all  --  eth0   *   0.0.0.0/0        0.0.0.0/0       

In the 25.75 days since I last rebooted this system, it’s received over 75 GB via its DSL link and around 1 TB over its main Ethernet link. If my math is right, that’s an average of 3.6 Mbps on the Ethernet link and around 270 kbps over DSL. I wasn’t keeping outgoing traffic stats when I first booted this box, but more recent estimates make it look like there’s almost as much outgoing traffic on dsl0 as there is incoming.

CPU load is similarly heavy–the box has averaged 51.9% idle since it was rebooted. My rule of thumb for years was that any production box that was under 80% idle was due to be upgraded soon, because it was probably pegging the CPU during peak times during the day. If the box was under 70% idle, then it was time to start scrounging for an immediate upgrade. By those metrics, this box is way overdue for a major upgrade. Fortunately for my wallet, those metrics don’t really apply to this box–it’s spending a lot of its CPU time on tasks that aren’t particularly critical. Also, Linux 2.6 made some changes to /proc/stat that procinfo doesn’t seem to have picked up on; once you factor those into the equation, the box is really closer to 75% idle. Subtract off the non-critical usage, and the system is probably only 10% busy. I’ll probably upgrade it later this year if my virtual-server project works out, but that’s more for security and reliability then pure performance.

Posted in  | Tags , , , ,  | no comments

Success: My new DSL line is up and running

Posted by Scott Laird Thu, 10 Feb 2005 05:08:58 GMT

I can’t believe it. After months and months of trying to upgrade my DSL, everything is finally up and running on my new DSL line. The line wasn’t supposed to go live until Friday evening, but Verizon sent me mail today with my IP address and claimed that it’s up and running. And, indeed, it is.

Unfortunately, I wasn’t quite as prepared as I thought I was; I’d forgotten to change the DNS TTL on scottstuff.net, so people may have a hard time getting through to this site for a couple days. Oops. Other then that, though, everything seems to be up and running perfectly. The sample size is still kind of small, but smokeping suggests that my average ping time has improved drastically–I was seeing numbers from 25 to 800 ms before. Right now, the line looks flat at 30 ms. That’ll probably break a bit once traffic picks back up on the website, but I should be able to keep it under 100 ms, easy.

I’ll post more details later tonight or tomorrow, along with a review of the Sangoma S518 PCI ADSL card. I have to put the kids to bed first, though.

Posted in  | Tags , , ,  | no comments

DSL: 6 days and counting

Posted by Scott Laird Sun, 06 Feb 2005 00:43:01 GMT

I have a date now for my new DSL line: February 11th. My new DSL PCI card is in UPS’s hands, too. I’m starting to believe that my months-long DSL upgrade quest is nearly complete.

Posted in  | Tags , ,  | no comments

One step closer to faster DSL

Posted by Scott Laird Thu, 03 Feb 2005 00:36:10 GMT

My DSL upgrade saga took another step towards completion today, when Verizon installed a new phone line at home. Amazingly enough, it’s already in their DSL database, and Verizon’s DSL sales website allowed me to order DSL. I don’t have an install date for the DSL service yet, but I’m two steps closer to the finish line.

I was surprised that Verizon’s business DSL department gives you a choice of buying a new DSL modem ($99) or providing your own. I took the opportunity to order a Sangoma S518 PCI DSL card instead of an external box. Supposedly, their Linux drivers are solid (Sangoma has been involved with Linux practically forever), and there are a couple big advantages to native DSL interfaces, rather then DSL-to-Ethernet bridges. The biggest advantage is buffering–right now, my DSL modem has at least a couple seconds worth of buffers on it. If I send outbound traffic as fast as I can, I rapidly get to the point where nothing makes it out in under 2 seconds. So, even if I use extreme care in setting up QoS prioritization rules for VoIP traffic, the VoIP packets will still end up stuck in the DSL modem’s buffers. To combat this, I’ve been forced to rate-limit my outbound traffic to about 75% of the theoretical limit; even then it can really suck at times. Several people on Asterisk mailing lists have commented that their S518 has really made their VoIP performance shine.

In addition, since the S518 is directly talking to the phone company, it can tell exactly what speed I’m currently provisioned at and can log problems via syslog. My current nasty DSL box can’t do anything but blink lights at me when there’s a problem.

All in all, it looks like a decent improvement, especially since it’s only $115 or so online.

Posted in  | Tags , ,  | no comments

DSL Upgrade Saga: Act III?

Posted by Scott Laird Sat, 22 Jan 2005 16:22:18 GMT

I feel like I’m finally entering the third act of my DSL upgrade drama. This started over a year ago when I realized that I really wanted faster service then the 768/128 link that I’m paying $80/month for right now. Last June, I asked Verizon to turn up my DSL’s speed, with predictable results–they ran around in circles for over a month, with different departments giving me different answers, ranging from “we already turned it up” to “we lost the order” to “we can’t do that, you need to cancel DSL, wait for it to go dead, and then re-order.”

Amazingly enough, the “you need to cancel” camp was correct–Verizon is unable to increase the speed of my current DSL setup. I played as many cards as I could, pulled the few strings that I have inside of Verizon, had off-the-record conversations with installers, and concluded that I had three choices:

  1. Put up with my current service, as slow and expensive as it it.
  2. Cancel DSL, wait two weeks, and re-order.
  3. Order a second phone line, wait for them to install it, then order DSL on it, then cancel the old line and DSL.

I looked into cable modems, but there’s no way to get a static IP address out of Comcast around here, and I need to run a number of servers. I considered moving my mail, web, and Asterisk servers off onto a hosted system somewhere–that’d let me use Comcast with a dynamic IP, but the cost and complexity of it all just makes it impractical.

So, yesterday, I finally decided to go with plan #3. I ordered a new phone line. It ends up costing me $29 to get it installed and $20/month. Hopefully I won’t have to carry both lines for more then a month. It’s supposed to be up on February 2nd; as soon as that happens, I’m ordering new 1.5/384 DSL service on the line. I’ll cancel the old DSL the same day that the new one comes up–I just need to swing DNS over to the new IP and then wait for a few short timeouts. So, hopefully, this whole saga won’t cost me more then $100 up front. The nice thing is that it’ll end up saving me a few bucks in the long term–with 3x the upstream bandwidth, I can move more phone services over to VoIP, so I can turn off more features on the phone line. That could save me almost $10/month. It’s not a lot of money, but every bit helps sometimes. Besides, it’s mostly the principle of the thing.

Posted in  | Tags , , ,  | no comments

My Mac mini debate

Posted by Scott Laird Tue, 18 Jan 2005 01:22:03 GMT

So, I’ve been thinking about the new Mac mini. I could definitely use a couple new computers at home, and I’d be happiest with new Macs. They’d fit in well with my Powerbook and our dying old iMac. The Mac mini is certainly cheaper then older models, but the pricing is kind of deceptive. Yeah, you can get a model for $499, but by the time you bump the hard drive up to 80 MB, add a DVD burner, and add a reasonable amount of (third-party) memory, it’s pushing $1,000 all of a sudden. More specifically:

  • Mac mini, 1.43 GHz/80 GB model: $599
  • upgrade to Superdrive: $100
  • add keyboard: $29 (Apple total: $728)
  • 1 GB of Mac mini RAM from Crucial: $226.99

I’m sure I could get the memory for a few bucks less elsewhere, but I’ve had good luck with Crucial in the past, and I’d rather not monkey around with the RAM if I can avoid it. The initial rumors were that the Mac mini’s RAM wasn’t user-upgradeable; now it looks like it’s just sort of not recommended. It doesn’t require any special tools at the very least.

So, for $1,000, I can have a Mac with around 3x the CPU power of my aging PowerBook, enough RAM to do a bit of photo editing now and then, and a bit of disk space. I’d reuse the 22” CRT sitting on my desk at home and a Logitech optical mouse that I already own.

The problem is that I can’t afford a new Mac and a new Treo 650. Fortunately, no one seems eager to sell me a GSM Treo 650 any time soon, but sooner or later, Cingular is going to announce pricing, and I’m going to have to decide what I’m going to do about it. If they’d been shipping it 3 months ago, I probably would have ordered right off the bat, but its lack of memory and WiFi makes it look less enticing every month.

Oh, well–I should really wait until taxes are done this year before ordering any new hardware anyway.

Posted in , ,  | Tags , , ,  | no comments

New Years A/V cleanup

Posted by Scott Laird Wed, 05 Jan 2005 03:33:02 GMT

As part of the 4-day weekend that work gave us for New Year’s weekend, I spent some time cleaning and rationalizing the A/V system in our bedroom. Since we bought the projector a couple months ago, we’ve had 30-foot long audio and video cables snaking between the ceiling-mounted projector and the receiver and TiVo that were sitting on the floor right below the projector image. There had been a cabinet there that held them, but it got in the way of the projected image, and we couldn’t move them very far without running into the limits of our satellite cable.

The receiver wiring itself was a total rat’s nest, with TiVo, satellite receiver, and DVD player cables all tied together in a knot with a bunch of unused speaker wire. Since we cancelled the satellite and extracted all of the video from the TiVo, they could both be removed from the pile. Similarly, there was an old RCA DVD player–since we’re using MythTV for DVDs, we could remove it, too. Once we were done removing hardware, we were left with nothing but the receiver and the PC that runs MythTV. Since we weren’t tied to the cable jack in the wall any more, I moved the receiver closer to the projector, shortened the audio and video cables, and then re-ran longer speaker wires. Finally, I wired up rear speakers–the first time since 1997 that I’ve had rear speakers connected to any receiver I own. I also took the time to cable-tie the projector wires and discreetly stick them to the wall. That keep the projector from swiveling slightly ever time something bumps the cables, which makes for a more stable image.

Finally, I dragged the Xbox upstairs and wired it into the projector. Amazingly enough, in the whole time we’ve owned the projector, we hadn’t used it with the Xbox once. It works okay, but the interlacing is kind of nasty and the Xbox’s output looks fuzzy when it’s that big; I’m probably going to buy the Xbox component video kit, a component video to VGA cable for the projector, and a cheap 2-port KVM switch for switching the video input on the projector. That should give me a better image, plus the ability to use 720p on the handful of Xbox games that support it.

My one remaining job is to find a cheap IR transmitter for the PC and then program it to turn the projector off and on. Does lirc support any cheap USB IR transmitters? I notice that they have the IR codes for InFocus projectors on their web site. Given the codes and a transmitter, it should only take a couple minutes to get the PC to control the projector’s power.

Posted in ,  | Tags , ,  | 2 comments

A few days with MythTV

Posted by Scott Laird Mon, 29 Nov 2004 23:14:58 GMT

As I mentioned briefly before, I’ve been setting up a MythTV system at home. MythTV is a Linux-based open-source PVR system. Used properly, you’ll end up with something TiVo-like. Used improperly, you’ll end up with a massive headache and a sore throat from screaming at your computer.

I should start with a bit of background. I have two TiVos, and I love them, mostly. I loved them a lot more before the hardware on one box started flaking out, and before they started sucking up to the TV networks. What I really want is a way to record the TV shows that I watch and then share them between our two TVs, so I can watch the same show on either TV, and then delete it when I’ve finished watching it. With newer TiVos, you can copy shows between TiVos, but it’s just a copy–if I record it upstairs, then I can copy it downstairs and watch it, but I’ll need to delete it in both places once I’m done with it. I’d also like to be able to listen to music and watch DVDs on the same hardware; the ability to rip DVDs would be nice. I’d like the ability to expand my storage is critical–I have roughly 1 TB of disk space in my house, and I’d like to be able to use as much of that as possible for storing video. Finally, and really most importantly, I’d like to have the ability to fix things when they break–I haven’t had any luck with that with TiVo–one system crashes daily, and there’s nothing that I can do to fix it, short of spending hours sitting on hold with their tech-support system.

What I really want is the TV equivalent of iTunes–I want to be able to take the big mound of DVDs that I have sitting around, RIP them, and move them to the basement, next to the big mound of CDs that I used to listen to. I want to be able to pick and choose from upcoming TV events and add them to the library, just like DVDs. I want to be able to watch the movies on any TV in my house without remembering where it’s stored or worrying about the kids scratching the fragile little things. I’d really like it to Just Work, just like iTunes and the iPod, or like TiVo usually does. And I’d like it to work for *me*, not for network companies, record producers, or movie studios.

The closest that I can come to this today is MythTV. It supports recording TV, playing and ripping DVDs, playing MP3s, and displaying digital images. It networks nicely. It’s open-source and expandable.

It’s also a complete bitch to install. Once it’s installed, using it isn’t exactly a walk in the park, either.

I’m certainly not afraid of Linux in any of its incarnations, but I’d had a number of people tell me what a pain MythTV is to install, so I decided to try KnoppMyth, a Linux distribution customized for MythTV. It’s based on Debian, my favorite Linux distribution, and it comes with MythTV pre-installed and configured. I figured it wouldn’t be too hard to use KnoppMyth to take MythTV for a quick spin. I even had a spare small-form-factor system with a Celeron 2.4, a Bt878-based TV capture card, and a DVD drive sitting around.

Here’s a short list of what went wrong:

  1. The KnoppMyth installer locked up in the middle of the install when I told it to do an automatic install.
  2. When I tried again with a manual install, it didn’t default to installing onto any particular hard drive partition. I had to monkey with it briefly to tell it to install onto the boot partition that I’d just created. If I skipped through with just the defaults, I got an error later on when it tried to format a drive named ‘’.
  3. Once it had finished installing, even though it had formatted two partitions for /myth and /cache, it failed to mount them. This resulted in errors that I had to fix by manually editing /etc/fstab.
  4. The MythTV setup procedure consists of an xterm that asks a handful of questions. Without a mouse, it’s non-obvious how to select the xterm so you can type into it (Alt-Tab, space, if I recall correctly), and then it’s not obvious what to do–I had to re-run the installer repeatedly to get my channel listings correct, for example, because nothing said that I needed to go to http://labs.zap2it.com/, register, and get a username and password.
  5. Once MythTV was running, I was still unable to access the DVD drive at all–putting in a disk and hitting ‘Play DVD’ would cause the menu to flicker slightly, but it didn’t play the DVD or return an error. A bit of digging showed that the /dev/scd* devices weren’t owned by the cdrom group, so MythTV couldn’t access them. Once that was fixed, DVDs played correctly (plus or minus CSS problems, but we’ll ignore that little issue–it’s political, not technical).
  6. DVD ripping complained about the transcoding daemon not running, and never seemed to actually do anything.
  7. Dropping video files into /myth/video didn’t seem to make videos visible to MythTV.
  8. Live TV video worked, but recording TV produced files that were way too dim to view. Live TV audio didn’t work, even though it should have been available directly from the Bt878 decoder chip, but loading the btaudio driver doesn’t seem to produce any effect that I can see.

Most of these are just stupid integration issues; there’s no reason for them to exist in any even slightly polished product. KnoppMyth is at version 4r5; you’d think the CD ownership settings would have been fixed by now, right?

At this point, it had taken me about a half day to get MythTV to work, and all I could do was watch broadcast TV via rabbit ears and play DVDs. I could have accomplished the same thing by plugging the rabbit ears into a TV and buying an $18 DVD player (that was the cheapest “black friday” ad that I saw this year).

I probably would have dropped the project if an InFocus X1a projector hadn’t fallen into my hands. The InFocus is a 800x600 DLP projector that works with composite, svideo, HDTV, or VGA sources, but it’s happiest with VGA. So I had a project–mate the MythTV box to the projector. A few quick tests with MythTV’s DVD player shows that it looks way better then the same DVD via NTSC from my old RCA DVD player. Finding Nemo was gorgeous.

So, here’s all that I’ve had to do to get this to work right:

  1. Go to Fry’s on Black Friday to find a 25-foot stereo 1/8” plug to RCA cable.
  2. Pick up the cheapest USB remote control gizmo they had there.
  3. Recompile LIRC to support the StreamZap remote that Fry’s had sent me. This required re-creating KnoppMyth’s patched kernel so that the StreamZap patches would build.
  4. Figure out how to debug LIRC problems. Hint: use irw, because strace on lircd is pointless.
  5. Set up key mappings for MythTV and mplayer for the new remote. Half of the keys aren’t mapped to anything right now, because I can’t find the right feature to map onto.
  6. Set up NFS so I can store videos and music on my home file server.
  7. Copy 15 GB of music out of iTunes and into MythTV.
  8. Point MythTV to my home picture library.
  9. Upgrade like half of the software on the box to get MythPhone and Torrentocracy to compile. I ended up hand-patching Torrentocracy, and it still crashes MythTV whenever I try to use it.
  10. Figure out how to import videos. It turns out to be trivial–just copy the file into /myth/video, then go to the “Utilities/Setup” menu, then “Video Manager,” and then edit the metadata so the video has a reasonable name. Once you’ve done that, it’ll show up in the menu under “Media Library”/”Watch Videos”. Yes, this *is* a new meaning of the word “trivial” that you haven’t seen before.

Things that still don’t work:

  1. Playing DVDs or DVD rips with AC3 audio produces really quiet audio.
  2. Ripping DVDs doesn’t always work right. Of my two test disks, one just fails silently in the middle of the process, while the other seems to work, but has video from the “making of” feature combined with audio from the main feature.
  3. Recording TV is still broken, I think.
  4. TV audio is still broken.
  5. Playing DVDs results in frame drops, which produces jerky video. Playing the same DVD ripped to the hard drive works fine, which leads me to suspect DVD read speed issues.
  6. I can’t skip chapters in DVDs, but I can fast forward and rewind several minutes at a time.
  7. DVD menus don’t work.
  8. Image gallery slideshows are weird–they overlay the image on top of the menu’s background, when a black background would make a lot more sense. The image gallery in general doesn’t look quite right, but that might just be a theme issue.

So, what does work?

  1. I can play DVDs with audio, if I turn the stereo up really loud.
  2. I can watch live TV, if I can lip-read.
  3. I can listen to MP3s.
  4. I can watch .avi files that have come from various sources.
  5. I can browse JPEGs.
  6. I can do all this using a remote control instead of a keyboard.

Not a whole lot in other words. But I’m making progress–I’ve had a couple suggestions that might fix the DVD audio problem, and I suspect that the DVD ripping problem isn’t much harder. Once that’s done, at the very least I’ll be able to import a handful of the kids’ shows and have something useful.

I have a huge usability rant to make here, but I’m going to put it off a few days–I actually have some hope for MythTV, ever though it’s proving to be a massive time sink. It’ll take a few days to get all of my ducks in order, though–I need to finish a couple minor projects and do a few little tests. Fundamentally, I want to believe that MythTV can be fixed, but it’s so far from usable today that I’m amazed that it has the number of users that it does.

Posted in ,  | Tags , ,  | 19 comments

The travails of a house owner

Posted by Scott Laird Sun, 21 Nov 2004 17:53:03 GMT

One of the problems with owning a 20 year old house is that it comes full of 20 year old appliances, and most appliances are designed for a 15 year lifespan. When we bought this house almost 5 years ago, our inspector told us not to expect the appliances to last much longer, and to be happy with whatever life we got out of them.

Since then, we’ve lost the dishwasher, hot water heater, garbage disposal (who knew they could die?), and we’ve had to replace a couple faucets, a bunch of toilet parts, one complete toilet, and an outside water faucet.

Sometime tomorrow, we’ll add a new refrigerator to the list. Our current one is an old side-by-side Whirlpool with lots of fun features–the shelves don’t go all the way back, so things are prone to falling off the back of the shelves and ending up wedged behind the drawers at the bottom, where we don’t find them until we pull everything out for a big cleaning. The drawers fall off their rails all the time. The door shelves fall off sometimes. The glass shelves in the fridge pop out of their holders at a whim. The kick-plate the covers the coils doesn’t stay on right anymore; Gabe has a big gash in his foot right now from stepping on it after it fell off. And, on top of that, for the past few weeks, neither the fridge or freezer door closes properly. We’ve pulled everything out, cleaned the seals, checked alignment, and it looks like something’s bent somewhere. Even when everything’s closed as well as possible, the fridge barely makes it to 42˚ F overnight, so food’s been spoiling. Even if the seal problem is causing the lack-of-cold problem, and they’re both fixable, when all is said and done, we’d still be stuck with an old fridge that doesn’t work right.

In short, we need a new fridge. Fortunately, we’ve known this day was coming, and we’ve done way too much research. So, we had a decent idea of what we wanted, what models were available, and what they cost. After an afternoon of fighting pre-pre-Christmas shopping traffic, we’re the proud owners of one of LG’s new ”french door” models. Most of the reviews online seem positive, and we get got a decent price on it. It’s supposed to be delivered on Monday, which is better then I’d expected; when we replaced our dishwasher, it took over a month for it to show up.

Of course, there’s a downside to the story. While I was waiting for them to arrange delivery details, I spotted a pile of open-box InFocus DLP projectors for sale. I’ve been lusting after one for a while, and $735 seems like a decent price. So, I’m the proud owner of not only a new fridge, but a new projector as well. For the moment, it’s sitting in our bedroom, projecting an 8’ TiVo image on the wall, but we’ve been planning on turning our basement into a media room. It’ll be a few months before we’re ready to move it, but this gives us a nice incentive to keep after things.

I’m also trying to set up a MythTV box to go with it, but that’s a whole other story that I’ll get to later.

Posted in ,  | Tags , , ,  | 1 comment

Older posts: 1 2