Thursday, January 1, 2009

T-47 days and counting

The digital transition at 11:59 PM 2/17 is in just a touch over 47 days.

It takes about 30 days to get your $40 DTV converter coupon.

I'd place your order right now if you don't want to be SOL when they switch them all off.

So, when is the new year, anyway?

Everybody wants to celebrate the instant that the new year arrives, which makes New Year's Day unique in the annals of holidays.

The problem has always been that the North American TV industry operates entirely on Eastern time. We West-coast denizens always get the celebration tape-delayed. But even folks who live in Eastern time aren't going to get a good cue from the TV, since the digital production chain introduces all sorts of delays, not all of which can be compensated for.

The conversion to digital TV broadcasting makes things even worse, because the decoders introduce their own delays, and the magnitude of the delay depends on the decoder, so they can't be compensated for by the broadcaster (this is even assuming that the audio and video maintains the synchronization intended by the broadcaster).

We watched Anderson Cooper on CNN-HD over DirecTV this evening. The ball drop was a full 15 seconds late as I measured it. It's entirely possible that CNN might have been on a (censorship) delay loop for the event, but it's clear that TV is no longer useful for time synchronized events anymore.

And the phone isn't much better. We have Vonage, and if you tune in to WWV on the radio and compare that to calling up WWV on the phone, there's a distinct latency delta between the two.

Never mind the fact that at 0000 UTC there was a leap second this year, so everybody who's been out of the loop on that one will be a second off. At the moment, the NTP server at clock.sjc.he.net is a second off, so apparently they didn't get the memo.

Sunday, December 28, 2008

GPT for FreeBSD!

A lot has changed since the PC was first introduced in the early 1980s. Unfortunately, a lot of legacy nonsense has remained behind that has to be hacked-around because of that history. In essence, a modern Intel based computer starts the boot process as an 8088 and, effectively, climbs up out of the primordial ooze stepwise, getting a little more advanced with each tweak.

One of those bits of legacy nonsense still with us is the old FDISK based partitioning scheme, which still has nonsense like cylinders, heads and sectors in it (which mean nothing at all to modern disks, which in essence are just single-dimensioned arrays of 512 byte blocks).

FreeBSD has existed within this framework by using the old BSD "slice" system to chop up a single FDISK partition. Linux, instead, has tended to use FDISK extended partitioning, but that has led, to some extent, to Linux systems living in a single filesystem. One of the benefits of the multi-partitioning that FreeBSD uses instead are that two of the typical partitions (/ and /usr) tend to be "read-mostly," while the other two (/var and /home) tend to have the majority of write activity. This is somewhat safer, since the volatility is kept away from important configuration data (in /etc) and system code (in /boot and /usr).

Macs have discarded a lot of the Intel legacy, since they don't have to boot 20 year old operating systems (instead, they boot Unix, which is a 30 year old operating system, but I digress). So the Intel macs have adopted GPT partitioning. GPT is great, since it can operate on disks with 2^64 blocks, which is ridiculously huge, and the number of partitions is unlimited (it's actually limited to the number of blocks allocated to the GPT itself, and by default it's 128 entries).

Well, with the advent of FreeBSD 7.1, support has been added to boot from a GPT partitioned disk. The way this works is that the legacy FDISK partition (which basically marks the entire disk as allocated to protect against FDISK based tools trying to do something to the disk) contains boot code that looks for a special GPT partition that contains the second stage boot loader. That partition and the FDISK boot sector is written with the 'gpt boot' command. That boot loader looks for the first UFS partition on the disk and loads the main FORTH-based loader, which in turn loads the kernel and so on.

Just to be on the safe side, I migrated my setup by buying a new disk (a 320GB disk for $55 - can't go wrong!), partitioning it and then copying all the stuff over. As a bonus, the new disk is faster than the old one, and we get to start the warranty over.

There is, however, a 'gpt migrate' command that purports to convert a disk from FDISK and BSD slice format to GPT, but that concept sounds a bit scary to me, at least for filesystems I really care about. :)

One interesting thing is that the gpt command opens the disk for writing, even if all you want to do is read information. But if there are mounted partitions, then this will fail. There is a -r option that will make the open read-only, which is useful for the 'show' command.

Now that the disk is GPT partitioned, converting to an EFI based machine would simply require replacing the special FreeBSD boot partition with an EFI system partition (it would need to be slightly larger, but space from the adjacent swap partition could be stolen), and EFI boot code for FreeBSD would need to be added to it (if it existed).

FreeBSD 7.1 hasn't yet has been released - it's at RC2 at the moment - but - on new year's day, in fact. I'm quite happy with it.

Friday, December 19, 2008

iPhone dartboard navigation

When I was waiting to turn left from San Tomas Expressway onto Saratoga Ave, I happened to glance down at my phone to see it tell me this:



Come on! That's not even the same zip code! Hell, it's not even the same city! It's the city two cities away! Oops.

Google hosed me

I took my car in for service last night, with the plan being to take CalTrain from work, as usual, but get off at the station close to the dealership and walk to go pick it up.

I settled on this plan because when I asked the iPhone's Google Maps app to give me directions from "Sunnyvale Caltrain" to Sunnyvale VW, it said that the route was about a mile.

Well, it appears that it decided that "Sunnyvale Caltrain" meant any CalTrain station in Sunnyvale... of which there are two. It's about 1 mile from the Lawrence station to Sunnyvale VW, but it's about 3 miles from the Sunnyvale CalTrain station. If it had said that it was a 3 mile walk and showed me a mostly southerly route, I probably would have known to try Lawrence instead.

So, thanks, Google. You clearly knew best when you thought I didn't mean the Sunnyvale CalTrain station when that's exactly what I typed in.

Wednesday, December 17, 2008

JBoss and custom LoginModules for data sources

This is rather a specialized topic, but precious little has been said about it, so I figure it's worth a mention.

A data source in JBoss is typically either a JMS or JDBC connection pool, more or less. It represents a resource within JBoss that you can turn to to obtain the thing you want, use it, then throw it away (typically the connections are wrapped with code that catches the "close()" call and rather than closing the connection returns it to the available pool).

If the resource represents a database or remote JMS server, you're going to need to authenticate - typically by providing a username and password. In most enterprise situations, you don't want those passwords to be in plaintext in the configuration files. Rather, you have either some sort of configurable password encryption system or a password fetching system. In every shop I've worked in so far where this has been an issue, there's been a pre-existing mechanism that is set in concrete and must be used more or less without modification to obtain passwords to connect to enterprise resources.

Well, if you're configuring a data source within JBoss, you give that data source an <application-and-security-domain>, which is a <application-policy> node within server/___/conf/login-config.xml, which contains a <authentication> section which provides the username and password. The question is, how can you provide the bridge between JBoss and your established mechanism for providing username and password? Naively, the answer is that you must write your own custom JAAS login module.

Fortunately, there is a much easier way.

JBoss provides a ConfiguredIdentityLoginModule, which is simply a wrapper for a plaintext username and password. The simplest way to wire in your own password fetching code is to extend this module. You simply need to replace this method in the class:

public void initialize(Subject subject, CallbackHandler handler, Map sharedState, Map options)

The "options" map is a map of the list of module-options from login-config.xml. You simply call super.initialize() with all of the same arguments, but with a different options map. The new options map will have in it the "username" and plaintext "password" options that are required by the ConfiguredIdentityLoginModule.

For example, if you have a CryptoWidget that can decrypt passwords, you'd write something like this:


public void initialize(Subject subject, CallbackHandler handler, Map sharedState, Map options) {
Map newOptions = new HashMap(options);
String pw = (String) newOptions.get("password");
pw = CryptoWidget.decrypt(pw);
newOptions.put("password", pw);
newOptions = Collections.unmodifiableMap(newOptions);
super.initialize(subject, handler, sharedState, options);
}


And that, more or less, is the entire class. You can do anything you need to modify the options map, so long as the options map you pass in to super.initialize() is what the superclass expects to get. It might be a good idea to remove any options that you require that the superclass does not require. For instance, if a "salt" option was required to pass some additional argument into the CryptoWidget, you'd fetch it, then remove it from newOptions.

Incidentally, it is necessary to make a copy of the options map because it is an unmodifiable map (note that we make newOptions unmodifiable before calling super.initialize() also).

Saturday, December 13, 2008

Next ATSC test: 1/10, 33 cm

Well, despite the complete lack of success at 420 MHz, I'll be trying again on January 10th with the new 900 MHz amp. I'll be putting out around 75 watts or so of ATSC on 910-916 MHz into a KP-20, for a total of about 380 watts of ERP. I liked the Cañada college QTH when I was there last, so that's where I'll be this time.

Of course, in the meantime, I'll need to get ahold of a 28 VDC power supply and a small generator to run it.

Sunday, December 7, 2008

Building a VHF TV dipole

After 2/17 of next year, there will be only two broadcasters below channel 14 here in the San Francisco market: KGO on channel 7 and KNTV on channel 11.

You could make do with a UHF corner Yagi... but what about those two channels?

Well, the ChannelMaster CM2016 is a good solution. It's a traditional UHF corner Yagi antenna combined with a VHF-hi dipole. But if you already have a UHF corner Yagi, there's no need to replace it. You can simply add your own VHF-hi dipole. Even better, you could make a relatively high quality folded dipole from copper plumbing pipe.

After February, the two channels that matter will be 7 and 12. 7 has a bottom of 174 MHz, 12's top is at 210 MHz. Halfway between those two is 192 MHz. A half wavelength at 192 MHz is 2.43 feet, or 29 1/4 inches, but we're going to put some fittings on each end, so subtract two inches, for 27 1/4". You'll need two pieces of 1/2" copper pipe that long, 2 90 degree 1/2" "street" elbows and two 90 degree 1/2" normal elbows. "Street" elbows are designed so that one side is the same diameter as the pipe itself, so that it can mate with one of the ordinary elbows to make a 180 degree turn.

Cut a half inch off one of the long pieces of copper and then cut that piece in half. Assemble the two ends out of one of each type of elbow. Put one of the combo elbows on each end of the long piece, and then stick a short piece in each remaining open elbow connection. The two short pieces should have a half inch gap between them. Once it is all dry-fit properly, use a plumber's torch and sweat the whole thing together. Use sheet metal screws to attach a standard TV balun on each side of the gap.

The only trick remaining is to mount the thing. You want the dipole to be at a right angles to the direction from your location to Mt. San Bruno and Sutro Tower. You need to use a piece of wood or plastic or something insulating to attach it to your mast. You also need to keep it at least a couple feet away from any other antenna on your mast, if you can.

Saturday, December 6, 2008

Joel McHale at the Flint Center

Joel McHale has a message for all his fans:



Actually, no, Joel was very nice. As he was finishing his act, he told the entire assembled multitude (a sell-out crowd at the Flint Center) that he'd sign stuff for everyone afterwards, which I believe came as a shock to the house staff, since there were no preparations whatsoever for the resulting huge mob that gathered in the lobby around the merch booth. I waited an hour and a half to walk 5 feet.

If you go to the mall to visit Santa, the line is very orderly, but you don't get to have lots of chicks mashing their tits into your elbow.

Naturally, the ATM machine was broke, so I asked Joel if he'd let me slide on the T-shirt price by $5 (they were $25, but I only had $20). He signed my ticket, and let me take the picture you see above. When we got out, I told Scarlet the story and she said she had $5, but only had $4. We gave his bodyguard the $4 and had him pass it up to Joel and we left before he counted it. I'm sure that he made a snarky comment about it.

I'm actually going to put a dollar in the mail and send it to him (at E!). Just so he knows I'm not really cheap.

If you're a fan of The Soup (and don't you dare call it Talk Soup), you really should try and catch him if he comes near your town. It's great.

Sunday, November 30, 2008

New Water Heater

Well, there are only two major appliances in the house that we hadn't replaced since moving in - the furnace / AC and the water heater. And now, there's just one. The water heater started leaking and set off the flood detector Friday morning. We called our favorite plumber (Gus at Castle Plumbing), and he said he could come out and take a look Saturday, but that if it needed to be replaced and we couldn't wait until Monday that that likely meant getting a new water heater at Home Depot, since nothing else would be open. But the good news is that the Home Depot water heaters are made by Rheem, which has a good track record.

In the meantime, we called a national plumbing chain (I won't mention their name) and they sent someone out who gave us a free estimate of $1300, but who knows whether they would have put a good water heater in for that price? In any event, that's way, way too much, so they were dismissed.

Saturday came around and I decided that it was just too likely that the water heater had to be replaced. It was 11 years old, and I strongly suspected that it wasn't the 12 year warranty kind. One thing you can take to the bank is that an N year warranty water heater will last for about N years + 1 day before giving out. So I decided to attempt to save some money by at least starting the demolition of the old unit myself. It was pretty easy, and I managed to get the old unit out all by myself. The gas and water connections came off with a wrench. The T&P relief valve had a sweated connection that I needed to desolder before I could unscrew the rest of it. Lastly, the chimney was held on with a couple of sheet metal screws.

We went to Home Depot and bought a 12 year warranty 40 gallon natural gas heater. It was about $550 or so, but the extra-cheap 6 year warranty units were about $400, so I think that's pretty clearly money well spent.

In retrospect, I probably could have installed the new unit myself. The new unit is a little taller than the old one was, because between then and now the building code has an added safety requirement - a special sealed combustion chamber that has a spring-loaded door held open by a thermal fuse. The idea is that if the burner area overheats, the door will spring shut cutting off the combustion air flow, choking off the fire. I had Gus install the new water heater mostly because of the fear that the size difference was going to make a difference between it being easy and being hard. The worry was that the water connections were going to need to be moved, which would have involved tearing out some sheetrock in the back of the water heater alcove. But there are flexible copper pipes and there was enough flex left for the new heater to fit. The only other work needed was to trim the chimney to fit and to re-plumb the T&P relief piping.

The last advice Gus had was to keep the home depot receipt, because Home Depot has a reputation for doing anything they can to low-ball you on any warranty claims. I stapled it to the door of the water heater closet. He also said we should drain it once a year, but that didn't mean emptying it all the way - just opening the drain valve and pouring off a gallon or two is enough.

Thursday, November 27, 2008

Thanksgiving Turkey Fry



We fried our turkey again. This time, the event was transmitted to the K6BEN ATV repeater for anyone who wanted to tune it in. Scarlet used our digital camera to capture the drop and retrieval operation.

Wednesday, November 26, 2008

Cringely stupidity

Sometimes Bob comes up with a real boner.

My hobby is building small airplanes and one of my favorites is a Davis DA-2A, winner of the Outstanding New Design contest in 1966, the same year my Oldsmobile (and my current Thunderbird convertible) was built. That little Davis can teach us a lot about cars.

I didn't build my DA-2A, but I am rebuilding it right now and know it intimately. My Davis is an all-aluminum two-seater with an 85-horsepower engine. The engine was built in 1946, the plane in 1982, and the whole thing cost under $4,000 at the time, though today I have more than that invested in the instrument panel alone. The plane weighs 625 lbs. empty, 1125 lbs. loaded, has a top speed of 140 miles per hour and can travel about 600 miles on its 24-gallon fuel tank.

Why can't I buy a car like that?


Um, because a fender-bender would kill everyone, stupid!

Cars used to be made like that airplane of yours. Then Ralph Nader wrote a little book called "Unsafe At Any Speed," and the fit hit the shan.

The threat model for airplanes and cars are entirely different, which requires entirely different priorities. Cars need to be crashworthy, because crashes are very, very frequent compared to airplanes.

Those who can't, teach. Those too stupid to even teach, commentate.

Sunday, November 23, 2008

Pictures from an Expedition

With apologies for the terrible pun to Modest Musorgsky.




Saturday, November 22, 2008

Results from the test transmission

Well, I don't think very many people were able to see the signal, much less get a picture. The closest was Joel, KD6W, the vice president of PAARA. He wasn't able to decode the signal, but he was able to see the pilot show up. On the way home, on his advice, I stopped at Cañada College and parked at a spot that had excellent coverage and tried again. From there, Joel (who was at his house in Menlo Park) captured this trace on his spectrum analyzer:



It's just not quite enough to display

So 10 watts of output power, or 50 watts of ERP don't hardly get you much, I guess.

Leaving for the mountain

See you all at 1:30 on 420 MHz and 146.76 MHz!

Friday, November 21, 2008

An overview of different digital modulation schemes

There are 3 main ways that digital TV is modulated and transmitted nowadays: 8VSB, QAM and OFDM. Here's a little bit of introduction into each:

I've talked about 8VSB quite a bit on this blog. It is 8 level Vestigial SideBand modulation. Reducing it to its most basic description, you take a carrier and amplitude modulate it with a square wave that has 8 different legal amplitude levels. The result is a tremendously wide double-sideband signal. You then pass that signal through a Nyquist filter that reduces the signal down to 6 MHz of bandwidth and that's what 8VSB is. In actual fact, most modern 8VSB modulators don't actually work that way. Instead, they directly synthesize the equivalent waveform instead, but the net result is the same. The symbol rate of 8VSB is about 10 megabaud. And this is fundamentally why 8VSB is vulnerable to problems with multipath. There are 10 million symbols per second, meaning that the sample interval is only 100 microseconds long. In general, the shorter the sample interval is, the tighter the tolerances are.

QAM stands for Quadrature Amplitude Modulation. With QAM, you take a carrier and amplitude modulate it and phase modulate it at the same time. It's thus a combination of AM and FM that happen simultaneously. As with 8VSB, there is a sampling rate when the receiver must determine where in two dimensions the signal exists. In general, there are 2^n different amplitude and phase shift values in a "square" QAM constellation that has n different points on each axis, which yields n bits per baud. The more complex the constellation, the lower the symbol rate can go for the same bit rate. But the more complex the constellation, the higher your requirements for S/N become so that you can distinguish the different points from each other. Most cable companies run QAM-256, which is quite a complex constellation - each point encodes 8 bits of data. They can get away with 38 MB/s in a 6 MHz channel because of the lack of multipath and the high S/N ratio typical of cable delivery. You can run QAM over the air, but you would typically do so with only a 16 point constellation, which would net you a much lower channel bit rate than QAM-256, all else being equal. That said, if you were to attempt QAM-16 at ATSC's 19 MB/s data rate, the baud rate would be lower than 8VSB because each baud encodes 4 bits of data instead of only 3.

You might ask about 8VSB and its "constellation." With 8VSB only the amplitude of the signal is used to encode information. By coercing the waveform into a narrow bandwidth, we must give up any semblance of control over the signal's phase. As a result, when plotted on a constellation display, 8VSB's constellation consists of 8 vertical lines. Thus, each baud contributes 3 bits of information, which is why the baud rate of 8VSB must be so high. In theory, you could reduce both the baud rate of 8VSB and the width of the Nyquist filter at the same time, but doing so would make for a mode that wouldn't be compliant with ATSC specifications. By contrast, the DVB specifications incorporate many different modulation schemes, going all the way from 5 to 8 MHz wide.

The third method for delivering bulk digital data over RF is OFDM. OFDM stands for Orthogonal Frequency-Division Multiplexing. OFDM is a divide-and-conquer scheme. The incoming datastream is divided amongst a number of relatively closely spaced RF channels, each of which is either sent with traditional Phase Shift Keying or perhaps a low constellation QAM mode (PSK, however, at its heart is simply a variant of QAM - without any information on the amplitude axis). Because each individual carrier only has a small portion of the data, the resulting baud rate for each carrier is quite low. It does, however, complicate the receiver quite a bit, because it has to be able to receive and decode a number of digital streams in parallel. This is actually less of a big deal than it might seem, however, since it is relatively routine for multiple receivers to operate within a single chip. For example, there exist single-chip multichannel GPS receivers. And, of course, multiple methods exist to synthesize an OFDM "fugue," so to speak. The big downside of OFDM, however, is in its transmitter linearity and overhead requirements (particularly because of its much higher peak-to-average ratio), and its increased S/N requirements for receivers.

Tuesday, November 18, 2008

33 cm amp arrived

The 900 MHz amp I got the sweetheart deal on has arrived.

It's actually two amps, in fact.

The big one only has about 37 dB of gain. My thinking at the time was that its output at maximum input would not be sufficient for my needs. But now, my thinking has changed. If I feed the thing the maximum power from the exciter of 12 dBm average, the output power would be 79 watts average. Well, as we now know, the peak-to-average ratio of ATSC is 5 dB (at least it is 98% of the time), so that's actually 250 watts peak, which is probably too much (we'll have to get the thing on a scope to see for sure).

I bought that amp, plus a companion amp designed to boost the signal from -2 dBm to up to 5 watts. But I think, in retrospect, that given what I've learned that I'll probably just run the big amp by itself.

The first stage amp does have the advantage of having a power control pin that can be used to reduce the gain, but the exciter also has software output power control.

One thing that the big amp lacks is a PTT line (that is, something that can key the bias voltage for the modules on and off). This is something I'll likely need to add myself. The kind folks at the factory said they'd be happy to help with that when I got to that point.

It also lacks a cover. I'll need to get some sheet metal bent somewhere to fix that.

First step, however, will be trying it out on the air. But that will have to wait for a 28 volt power supply.

I'd like to publicly thank Ken and Lance - you two know who you are. I'd mention the company name, but I am not sure whether they would appreciate the publicity or not. If they would like a plug, I'll edit this post and add one happily. They are very nice people to deal with.

909 or 910?

I spent some time before work this morning pondering what to do about M-LMS licensees in the 33 cm band. M-LMS is the Multilateration Location and Monitoring Service. In the 90s, the FCC held an auction to grant nationwide licenses for this service. In the meantime, the growth of GPS has made the whole thing largely moot. Still, we amateurs must not cause harmful interference to them, to the extent that they actually use their licenses. The sooner those licenses are revoked, the better, I think, as there clearly is no public benefit to them.

There is a block of L-MLS allocation that ends at 909.75 MHz. If the last 750 kHz of this grant are in use, then I will have to change from 909-915 to 910-916 MHz. Fortunately, this is still a reasonable choice. On the TVC-9S, it's channel 2 instead of channel 1.

The only issue is the NARCC band plan for 33 cm, such as it exists. That band plan has ATV at 909-915 and a digital allocation at 915-917.

This doesn't really square all that well with the reality on the ground, given that potentially the range between 904 and 909.75 Mhz is the M-LMS block A allocation.

The NARCC plan also has an ATV channel on 922-928 MHz, which means it overlays the repeater output band at 927-928 MHz. That doesn't make sense.

The Mt. Diablo ATV folks have a repeater output from 918-924 MHz. This makes sense.

What would make sense in addition would be for NARCC to move the digital sub band from 915-917 to 916-918 MHz, move the lower ATV channel from 909-915 to 910-916 MHz, and recognize the reality that M-LMS probably denies us access to 904-910 MHz.

What am I going to do?

Well, it rather depends on whether there are current digital users between 915 and 916 MHz here in the Bay Area and/or the M-LMS license holder is actively using 909.0-909.75 MHz.

I can only hope and pray that both aren't true. If they are, then I will have no choice but to operate on 910-916 (since I can't interfere with M-LMS) or share 918-924 with Mt. Diablo. Both of those options would likely suck.