Tag Archives: ntsc

scanlime:020 – TSG95 Color Bar Generator Teardown

Little teardown and exploration of an old bit of NTSC / PAL television test equipment, the Tektronix TSG 95. We’ll poke around with the oscilloscope and analog TV, and we even stumble on some helpful documentation.

Please consider supporting me on Patreon so I can keep making these vids!

Subscribe to YouTube notifications or follow https://twitter.com/scanlimelive for live streaming announcements.

Life at 3.579545 MHz

Well, after an evening of cooking and hacking, I’ve managed to implement my own crazy software-only modulator for NTSC video. It can take an arbitrary JPEG image, turning it into an analog signal representing one field of color broadcast video. This analog signal happens to be playable by displaying a resulting image file on your video card with the proper X modeline.

This is a familiar test image that I photographed myself. The coax cable on my TV is alligator clipped right onto the red channel of the test machine’s video card. The white dots you see are “blind spots” caused by horizontal sync. Horizontal resolution is quite good, but vertical resolution is limited since I’m only generating one NTSC field.

If you care about the source code, you probably already know where to get it. Otherwise, bug me. I won’t bother linking to it from here, since by the time you read this I’ve probably changed it some more. Once I can do this in real-time, I’d like to make it into a library of some sort.

Update: I didn’t end up doing much more with this project. The code I had is in Subversion at http://svn.navi.cx/misc/trunk/modulator/

Tempest for ATSC

Recently I have become intrigued by the little 75-ohm coax plug on my plasma TV. To me, television programming isn’t worth nearly what Comcast charges for cable. I mostly watch DVDs, or television shows downloaded over the interweb. After reading about the fairly powerful digital television coverage in the bay area, I decided to plonk down $35 on a little amplified UHF antenna.

It’s a bit finicky at times, but I can receive at least 3 or 4 channels in crisp digital-cable-like HDTV quality. It’s really amazing how much data you can pump over the airwaves with the right compression and modulation. What’s more amazing, though, is that the ATSC tuner gives me a much sharper picture than I get over component video. Sure, HDMI would be ideal, but my TV doesn’t seem content with your average DVI signal.

So, how hard would it be to generate my own ATSC signal? I’d effectively be piping MPEG-2 data directly into the television’s logic board- if it could be done cheaply, it could be a really revolutionary way for HTPC hobbyists to get high quality video into any modern digital television. After thumbing through the ATSC spec, it looks like nearly the entire modulation job could be done by a sufficiently powerful CPU. Indeed, the GNU Radio project already has code for a software-only ATSC modulator and demodulator. All you’d need would be a 3-bit or higher D/A converter at about 10 MHz, a modulator, and a couple oscillators at very particular frequencies. Heck, this could be a $20 USB dongle.

Then, I happened upon what might be the coolest hack I’ve ever seen. Fabrice Bellard, the guy behind QEMU, wrote a software modulator for PAL, SECAM, and DVB-T. Sure, the GNU Radio project has had that for a while. The really novel part about this hack is that it uses the video card as both a DAC and an RF output stage!

Here on the other side of the pond from Fabrice I only have NTSC and ATSC television equipment, but nevertheless I felt like giving this hack a try. No source code unfortunately, but the images that result from the modulation process are available. I set up the PAL test image, and stuck an oscilloscope probe into the VGA port. Hey, this looks like it might be a valid video signal. Then I cart in a little 13″ television and start tuning around. I hit channel 7, and there’s a greyscale rendition of Lena! The vertical hold is almost nonexistent, but it sure ain’t bad for an NTSC television trying to display a PAL signal coming straight out of a GeForce 6200’s VGA port.

Then, I realize I haven’t even connected the other end of the coax cable. This whole time, my cheap scope probe has been acting as a transmitter antenna and the half-connected coax as a receive antenna. Lena has been travelling over about a foot of air. I plug the other end in, and the signal gets a whole lot less noisy.

It’s unfortunate that Fabrice didn’t include source, but I’m sure he has his reasons. The demo has inspired me, though. This isn’t the first time I’ve seen video outputs used in strange and unusual ways: long ago I coerced the LCD controller on a 68EZ328 (2nd generation Palm Pilot CPU) to generate a VGA signal. The horizontal and vertical blanking signals were painted right into the framebuffer. What really tickles me about this demo is that it’s exploiting the EMI given off by the card to modulate the finished RF signal.

Anyway, I think I’ll try my hand at an NTSC version of the demo… and eventually ATSC. I’m curious how much CPU power it would take to play back an MPEG stream in real-time this way. Worst case, it might require pre-processing to turn the MPEG stream into a raw stream of 8VSB codes. Could the modulation process be accelerated with fragment programs? This would definitely be the first time I’ve heard of OpenGL used to accelerate a radio.