Monday, January 28, 2008

Amazon to the Rescue

This weekend, my father came to visit us in Massachusetts from New York. We spent hours playing Rock Band for the PS3. Rock Band combines singing, guitar, and drums into a great musical game. The karaoke and drum pad are my favorite because they are a more realistic approximation of actually performing. The guitar is more abstract since buttons take the place of strings. I wish Nyko or another after-market guitar controller company would create a real electric guitar for Rock Band, I would easily pay $200 for it.

I learned how to play acoustic guitar a long time ago, and I have been hoping one of the children would develop and interest in guitar and we could play together. Rock Band looks like it is helping them develop the interest, because they can better visualize the payoff. Let's face it, most people start playing as a teenager because they start going to concerts and want to be a part of the music, but younger children often just see practice as a time when everyone wants to leave the room :-)

Another great stepping stone is http://www.ivideosongs.com/ where you can watch free instructional videos on how to play guitar, and there is a large library of paid content for videos with either instructors, and in some cases the original artists who performed the song. Alex Lifeson has a video on how to play the guitar part of Rush's "The Spirit of the Radio", and John Oates shows you how to play "She's Gone". They also have videos for drums and piano.

The videos and the PS3 can be played on my Samsung LNT5271F 52" LCD HDTV, that I bought from Amazon last month. The family room in my house is getting heavier use these days, partially due to the social gaming and music enjoyment. Which brings me to my Amazon rescue story.

When I bought the TV in December, and I debated whether to buy it from Amazon or Circuit City. This hesitation was not typical, because I buy almost everything from either Amazon or eBay. It's just that for such a large purchase, there is some comfort in a local store.

For one thing, I was debating whether to buy the 120Hz model or the 60Hz model, since there is a significant price difference between the two. I was excited by the 120Hz, because my eyes resolve changes very quickly, and sometimes video motion looks stuttered to me, or I notice lights flickering when other people don't.

So I thought I should take a trip to Circuit City and compare the two side by side to decide which one to get, but since I wanted to buy it in time for Christmas, I would have to buy it there. When I noticed Amazon selling the 120Hz for less than Circuit City sold the 60Hz, I decided to read about the experiences other people had with Amazon in buying HDTVs. While there were some negative stories, they mostly concerned items damaged in shipping and the delays with getting a new one. In all, Amazon handled things well, so I was ready to take the plunge.

The low point of my weekend was when I noticed three large strips of bad pixels in the middle of the screen, which is $2500 worth of disappointment. These are over an inch long each, so definitely not something I could live with. So I wrote an email to Amazon customer service yesterday, and received an email today telling me to work with Samsung, and to contact Amazon if Samsung didn't make things right. I expect this is a stock response due to the number of times people call about one bad pixel, which is not considered a defect by some manufacturers.

I prefer working with retailers over manufacturers, so I decided to call Amazon customer service to accelerate the process. The customer service representative listened to what I had to say and scheduled the delivery of a new TV. So in a week or two a new one will be dropped off, and they will remove the old one. I couldn't believe it - they have made exchanging a defective HDTV even easier than at the local electronics store. They have raised the bar for value and service. Thanks Amazon.

Wednesday, January 23, 2008

MP3 in the House

A few years ago, I converted all of our CDs to 320kbps MP3 files. I considered using a lossless codec instead of 320kpbs, but I read about a very interesting blind test where 256Kbps MP3 files could not be discerned from the original CDs. What made this study special was not the number of participants but the fact that they were sound engineers from famous music studios, symphonies, and hifi manufacturers. So I bumped up the sampling rate to 320Kbps, just to be sure since I didn't want to rip 1000 CDs twice. I also decided to use constant bit rate (CBR) instead of variable bit rate (VBR), because the greater compatibility of CBR was more important to me than saving disk space.

We have more laptops than people in my house, so I set them all up on the kitchen counter, and the ripping went pretty quickly. By the time I loaded the CD into the last one, the first one ejected because it was finished.

The next decision was the best way to playback the music. First I connected one of my old laptops to the stereo using the line out from the laptop to the line-in of the receiver. The music collection is over 80GB, so the old laptop didn't have enough disk space, so I tried to store all the files on my file server, and connect to the file server over the wireless network.

Unfortunately the wireless network was just too unreliable for long stretches of listening to music, and there was no easy way to install a wired network to the audio cabinet. Larger hard drives are pretty cheap though, so I upgraded the laptop for less than $100 and stored the entire collection locally. The sound was picking up obvious interference, so I added a PCMCIA soundcard with optical output to the laptop (Creative Sound Blaster Audigy 2 ZS Notebook sound card). This completely eliminated the interference problem that was caused by either the cheap DAC in the laptop or the interference picked up by the line-level signal on the way to the amplifier.

For portable music players, the 320Kbps is a bit much, so I downloaded Easy CD-DA Extractor from download.com to run as a batch to down sample the music to 160Kbps. I have to admit ignorance of the inner workings of the MP3 algorithm, but in most codecs downsampling by a factor of two produces a cleaner result than fractional downsampling.

Now that I am in a house with a wired network, I am using the Playstation 3 as the MP3 library interface instead of the laptop. The PS3 connects to the server, which uses Windows Media Player 11 music sharing to send the music on demand over the wired network, and the HDTV is the interface for selecting the music instead of the laptop on top of the audio system. The ease of use, the HDTV interface, the wireless controllers, and quality audio make for the perfect setup.

The next challenge was to get the audio to the speakers in the ceiling. The new house had five pairs of speakers in the ceilings on the first floor, with a Niles VCS100R volume control in each room. I decided I could avoid buying a new piece of audio gear since my Model 7700 7-channel Balanced Amplifier has 7 channels and I only use 5 channels for my surround system (Axiom 4 x M80, 1 x VP150 v2, 1 x EP500 v2) in the living room.

The speakers in the ceiling are 8 ohms, and the amp can easily drive 4 ohms (it is designed to work at 2 ohms for head room according to the engineers at Outlaw Audio). However, when you attach five 8 ohm speakers in parallel to a single channel, you are left with a 1.6 ohm load, which would kill the amp. The VCS100R volume controls have a switch to double (or more) the impedence, which makes the load 3.2 ohms - well within the capabilities of the amplifier.

If you are connecting ceiling speakers, the heavy gauge wire required for the long runs won't fit in an off the shelf solution like the Niles VCS HUB8. I used two six-speaker wall plates in a 4 gang j-box to connect the heavy gauge wire together in a parallel circuit (you could also use one larger unit like the Niles HTP-7.1 ). The binding posts can be be jumped together on the rear using stripped speaker wire, and all of the speakers can be connected to the binding posts on the front, along with the 2 pairs that connect to the 2 amp channels.

The ceiling speakers are configured as a second zone in the receiver ( Model 990 Preamp/Processor ), so they can either play the same thing as the living room, or they can play music while the sound system in the living room is used for watching a movie.

Now we've got MP3 in the house.

Tivo for HD using Comcast

I started using Tivo when it first came out, but when I upgraded to HDTV, I couldn't imagine spending the $700 for the Series 3 at that time. So I decided to use the Comcast HD DVR purely because of the cost. It couldn't compare to the Tivo, but it was HD and it didn't cost anything up front. Eventually the limited space, terrible lag time on the user interface, and general lack of features was too much to tolerate, so I started looking for another solution.

Next I setup a PC with MythTV, the opensource DVR software, using the Mythdora distribution for Redhat linux. Mythdora is an excellent distribution, and makes trying MythTV pretty painless (like Trixbox for Asterisk). Unfortunately MythTV itself is not so easy to use, and there is a fatal flaw: the cable interface adapters such as the pcHDTV 5500 card can only tune unencrypted QAM256 signals, whereas Comcast was encrypting almost everything except channels available over the air. The firewire port on the Comcast Cable boxes also had 5C encryption, so I couldn't get premium content that way either.

As I looked for ways to capture HDMI, decrypt QAM256, or Cablecard tuners, I realized these were either too expensive or not yet tackled by the opensource community. While researching these options, the Tivo HD came out, which is a far better deal than the Tivo Series 3. I paid $250 each for them, and they have two cablecard slots, so you can use either 1 Multistream cablecard (a.k.a. M-Cards) or 2 Singlestream cablecards (a.k.a., S-Cards). Get the M-Cards if you can, because you pay a service charge per card per month.

Unlike the Comcast DVR, you own the Tivo, so you can easily upgrade Tivo to 1TB disk storage using WinMFS. With two Tivos (with 4 tuners total and a total of 2TB of storage) I can record thousands of hours of SDTV or hundreds of hours of HDTV on four different channels at the same time. On my older SD video Tivos, I can use the Tivo multi-room-viewing (MRV) transfers and thereby get rid of all of my cable boxes, which saves me the box rental fee each month. There are service fees for the Tivos, but I am happy to pay Tivo for a service that is vastly superior and costs less. I don't have video on demand anymore, but I can get on-demand content over my broadband connection from Tivo partners, like Amazon unbox or Jaman.

The most difficult part was getting the Cablecards installed in the Tivo. The first thing that caused difficulty was I hadn't unboxed my Tivos before Comcast arrived, so I didn't have the most up to date version of the Tivo software, and you need it. Then I could only get the OTA channels because the cards weren't properly paired (For MCards, Val: ? is displayed on the Cablecard pairing screen on the Tivo) with the head end servers at Comcast. There are some great support articles in the Tivo knowledge base, so I would be sure to print them for your installer. In particular, I recommend this article: http://tivosupport2.instancy.com/TiVoCollection/f8f40dc6-5fb6-4ed8-ac41-d8cd0d5c0824/ins_Content.html


There are a few myths you might hear from the cable company that you should be aware of:

1: "I can't hit your box, it will damage your Tivo" - completely untrue. There are three different kinds of signals your cable company can send to a cable box or cable card and the Tivo is fine with all three.

2: "Your system is fine, don't worry that it isn't receiving any channels, it will take a few hours for the channels to come in." It might take time for the program guide to appear, but the channels should tune right away, don't let your installer out the door telling you this.

3: "We don't support Tivo." Cable companies have to support Tivo and other cablecard devices. If you get this from a stubborn customer service rep, remind them they are supporting the cablecard, not the Tivo, and while it may be inconvenient, the FCC requires this.

When you schedule the appointment, you should ask for someone with cablecard and Tivo experience. Tell them to write it in the notes for your appointment. And if you live in the Boston metrowest area, ask for Rob Wheeler, he is the best contractor they have.

Saturday, January 19, 2008

Tired of nagging about the Lights?

Home automation pays for itself. When I was a boy, I remember the constant refrain of "turn off the lights" - red faced rants on learning about the other direction that a switch could flick for some reason did nothing but amuse me. That was probably because I wasn't paying the bills.

Now I have four energy wasters of my own, pay the bills, and worry about the impact of our collective energy squandering on the world. I still remind them to turn off the lights, but now I have an energy warden: my HAI home automation system. It runs security, smoke alarms, thermostats, and lights in a completely programmable and coordinated way.

The first step was installation of the security devices. I prefer wired items for the core security system, because there are fewer things that can go wrong. My favorite security device is a motion detector with both infrared and radar: the GE Precision RCR-A. There are no false alarms and nothing escapes the watchful eye of this detector. Doors and windows need sensors to detect opening and closing. I suggest you skip the sonic glass break detectors, they create way to many false alarms to be useful.

Special thermostats replace the existing ones so they can be controlled by the central system, smoke and carbon monoxide can be wired to the central system, and you can add any other sensors you would like, such as humidity or other temperature sensors.

The lights are replaced with special switches that can report their status and be controlled by the central system. I use UPB switches because they are extremely reliable, and don't require any changes to your house wiring. I have tried X10 switches in the past, but they are slow, not reliable, subject to interference from many appliances, and can actually cross-talk with a neighbor who is also using X10. I considered wireless switches like Z-Wave, but they didn't have the selection or tight integration with the HAI that I was looking for. Now that HAI has Z-wave support, I would consider Z-wave if it is competitive on price and switch selection. Even though Z-wave is wireless, it could be faster and more reliable than UPB since UPB has to coexist with the power signal and there is the added expense of bridging your two 120V lines using a UPB coupler. The ideal solution is hardwire control of your light switches, where the switches all have a dedicated low voltage control line back to the panel, but that isn't practical unless you are building a new house and plan for this before the sheetrock is installed.

Installing the switches is very easy. You simply shut off the circuit breaker that supplies the switch you want to replace, remove the switch plate cover, remove the switch from the wall outlet box, and remove the wires from the old switch. Then you use the supplied wire nuts to connect the new switch wires to the house wires, and reinstall the switch and switch plate cover. The new switches use decora style rocker switches, so you may need to order new switch cover plates too. Sometimes it isn't obvious which wire is the supply line from the breaker and which is the line from the switch to the light fixture, so when in doubt use a voltmeter to check (the supply "hot" will always have voltage, but the fixture "load" will only have voltage when the light is on). It can get a bit cramped when you have three or more switches in a single box (this is called 3-gang or 4-gang), but it just take patience to carefully bend the wires toward the back of the outlet boxes.

When you have more than one switch that controls the same fixture, you use an auxiliary switch that sends control commands to the master over the "traveler" wire. There are several different ways to wire a multi-switch system, but the most common is for the supply line to come into one switch, a traveler line connecting one switch to the other, and the fixture load in the second switch box. Again, the voltmeter can really help here in understanding the wire layout. If you are confused and unwilling to research this, you can skip these fixtures or consult an electrician.

To interact with the system, you need keypads, which in addition to arming and disarming the system, can be used to control any feature in the house. You also can buy software to control the system from your PC, using a web browser, mobile phone, or windows media center.

Once you have this all in place, you have tremendous flexilibility and power to control the house. You can turn lights on slowly in the morning to wake up, and turn them off an hour after sunrise. You can turn off lights after no motion is detected for an hour. You can turn off all lights in the house (or most of them) when you arm the security system. You can turn off the HVAC automatically if the fire alarm goes off. You can turn off the HVAC when doors and windows are open for fresh air. You can turn up and down the thermostat based upon motion or other occupancy indicators. You can check to see if the kids still have the lights on in their room using your computer, or manually override anything using your computer or phone.

The switches cost about $50 a piece, so they pay for themselves after they save 250 - 500 kilowatt hours, which for a 500 watt fixture is 500 - 1000 hours. if you have lights staying on 12 or more hours a day because they aren't getting turned off, they can pay for themselves in a couple of months. The thermostats are $100 a piece, but can pay for themselves even faster. Saving yourself from getting worked up over the waste: priceless.

Friday, January 18, 2008

Cat5e plus Asterisk / Trixbox

I bought my current house after the sheetrock was put in, so I wasn't able to specify the wiring.

One thing I learned from the last house is that I didn't want to rely exclusively on wireless anymore. Neighbors had 2.4GHz cordless phones and microwaves that really-must-be-dangerous-they-are-so-RF-leaky. Aside from the mysterious drop outs for 10 minutes to an hour, the performance difference was too great for work or for large file transfers.

Fortunately I discovered that the electrical contractor used Category 5e (Cat 5e) wiring for the telephone jacks. They has become fairly common because you can have 4 telephone lines carried over this kind of cable. I was happy because Cat5e is capable of carrying Gigabit Ethernet instead of phone signals.

I had two problems to overcome. I did still want phone service, and the jacks were daisy-chained (wires went from one jack to another) instead of home run (all jacks connected to the basement using independent wires).

For the phone service, I decided to use a Voice over IP (VOIP) solution that sends phone service over the data network I would deploy on the Cat5e. To do this, first I took one of my old notebooks, and installed Trixbox.

Trixbox can be downloaded from trixbox.org as an ISO image that can be used to burn a bootable CD. I rebooted the notebook with this CD, and it reformatted the hard drive, installed Linux (CentOS a Redhat clone), and installed all of the additional software to turn the notebook into a phone switch that is probably more capable than the ones at most offices. The only questions the installer asks are the time zone, what the root password should be, and some optional questions about network address. There is no Linux knowledge required to use the product. If you don't already own an old notebook with a Pentium III processor and 256MB of memory, you can buy one for $100 - $200 on eBay.

Now that I had the phone switch, I needed phones that could use the data network. There are two options - either buy a data phone or buy an analog adapter that translates between the analog phones most people use at home and the data network.

I mostly decided to buy new phones. The Cisco 7960 can often be bought used on eBay for as little as $100, and it is a great phone. This way you can put calls on hold, transfer calls from room to room, use the phone directory, conference calling or other advanced features. Cisco ships most phones configured to use their proprietary data signaling, but you can download a firmware update for free from cisco.com that supports the SIP standard.

If you prefer to use an analog phone or fax, you can buy a box that translates from analog to data, such as the Sipura spa-3000 or spa-2002 (Sipura is now also owned by Cisco / Linksys). These are available for around $50 on eBay. These boxes are about the size of a deck of cards, and have both a data network and analog phone modular jack. They have a web based admin utility to configure the phones to connect to the VOIP phone switch.

The daisy chained wiring was probably the least desirable aspect of the wiring. Modern data networks are switched, not shared, so the jacks needed a network switch to connect the two segments. So rather than directly connecting the two wires in each wall outlet box, I terminated them as two Cat5e jacks. This is very easy - Leviton makes keystone Cat5e jacks that allow you to connect the eight wires from the cable into the jack without special tools or soldering. These jacks then snap into a wall outlet cover that replaces the phone jack outlet cover.

If you use a Cisco phone, it has a built-in switch so you can just connect the two jacks on the phone to the two jacks on the wall outlet using two network cables. If you use the spa-20002 you need to also use an inexpensive ethernet switch, like the Netgear GS605. You'll also want such a switch if you want to connect PCs or Tivos to the wired network. For some rooms you might decide to use a WIFI access point with a built-in switch (like the D-Link DIR-655 Xtreme N Gigabit Router) to bridge the wired and wireless worlds.

After the network is assembled, you can then configure your phones to talk to the VOIP switch running on your laptop. Each phone can get a separate extension, so no more yelling to call the kids downstairs - the phone is your intercom. Each extension is also private so we don't have to worry about kids picking up the phone while we're on conference calls with clients on snow days.

You then need to decide how you will call the outside world. You can either get another spa-3000 and connect your phone company analog line to your network, sign up for VOIP service from an enlightened provider that will let you use your own equipment (such as Inphonex or VoipStreet, not Vonage or your cable/phone company's VOIP service usually won't let you do this). We have both - 1 analog phone line from Verizon for critical calls, and two different VOIP providers. We use two VOIP providers because VoipStreet gives you extra phone numbers very cheaply but doesn't let you call international and charges for 800# minutes, and Inphonex doesn't charge for toll-free calls and does let you call international. You can have different phones ring on different extensions very easily through the web based configuration on the Trixbox/Asterisk VOIP switch.

We're very happy with this phone setup. We get advanced features for the phones, can have eight people dialing out at the same time, and our monthly phone bill is less than half what it used to be. The system is very reliable, and so is my data network. Now that I can plug in when I am doing a webcast, snow days are a lot less disruptive than they used to be. But I saved my favorite feature for last - wake up calls that I can schedule for any room in the house from my computer, playing the mp3 music my children request (currently it is "It's the Best Day Ever" from SpongeBob - did I mention their ages are 6, 8, 8, and 10?).

For futher reading on Asterisk, I suggest:
http://nerdvittles.com/index.php?p=137
http://asteriskathome.sourceforge.net/handbook/
http://www.voip-info.org/wiki/view/Asterisk+Cisco+79XX+XML+Services
http://www.cisco.com/en/US/docs/voice_ip_comm/cuipph/7960g_7940g/sip/6_0_7_4/english/administration/guide/siptrb60.html

Family Technology

My wife calls me Sysdadmin because now that we have 4 little geeks running around the house with laptops, ipods, cellphones, and game gear that all needs technical support.

Between the home network, the groupware server, the IP phone system, and the home automation system, I have a new appreciation for the corporate IT guys who support me.

I created this blog to share my experiences about technology for the family.