Raspberry Pi Learns The Lost Art Of Teletext


Exploring dead protocols is often the calling card of hobby electronics enthusiasts. And why not? The mistakes have already been made and fixed — you can learn from them. This Raspberry Pi TeleText hack is the perfect example. It let [Moonlit] explore the realm of generating composite video, as well as establishing communications between the Raspberry Pi  and a microcontroller.

Teletext was a method of accessing information on a television before computer networks were available to the general public. It was pretty impressive at the time, as you can tell from this Retrotechtacular feature. [Moonlit] started looking into recreating a Teletext device by simply generating a PAL signal with an AVR chip. He was met with an equipment failure (remember, it’s always a hardware problem) in to form of a fake composite to USB dongle. After changing the receiving device he was up and running and ready to explore the particulars of the protocol. As you can see, his success even led him to spin a breakout board which plugs in to the RPi GPIO header. A Y-splitter (joiner?) combines the composite output of the RPi with the the overlay data from his own board.

35 thoughts on “Raspberry Pi Learns The Lost Art Of Teletext

    1. DVB was supposed to have super-teletext in it (DVB-MHP), but nothing ever came of it. Instead, they started piping regular teletext as an extra stream in the mux, so that compatible tuners can decode it.

      The whole DVB system is a bit of a hack when it comes to sending any other information besides image and sound. It doesn’t work as well as the old teletext system and often loses sync, or succumbs to packet loss so that things like subtitles almost never work perfectly and television channels have started to restort to burning their subtitles in the picture.

      1. I am not sure if you are adding information, agreeing with me or disagreeing. but my point still stands (quality issues aside ;-) and it happens that teletext is the primary way for a lot of people to keep updated on news/sports/weather (esp. sports in these tour-de-france days).

        As for the subtitles, I never use that (infact i barely ever watch tv), but that is a pretty irrelevant side-issue to the whole point of teletext existing or not. Fact remains that i can turn on my tv and press teletext, getting my dose of news that way. so it is far from a lost art. (in comparison to a unreliable internetconnection it will still at least “work” despite missing lines here and there. but when internet is down, you cant do anything)

        1. The old teletext signal was robust enough that it would be captured on a VHS casette if you recorded broadcast television. Simply playing back the tape would also play back the teletext signal, and you could read yesterday’s news.

          With DVB’s teletext, if you get poor reception you lose the whole thing, because the data is transferred in big clumps very infrequently instead of streaming the pages slowly all the time. Same thing with the subtitles. They may send several minutes of text in one glob, and if you miss that glob when you switch on to a channel, or it becomes corrupted on the air, your television simply won’t show subtitles for several minutes. It’s especially annoying on documentaries where you can be damn sure that the subtitles won’t work just as some Japanese dude is explaining cold fusion.

          There’s also a special flag that tells the reciever whether the subtitles are available or not, and if you start a recording while the flag is not up, the DVR won’t capture the subtitles. Television channels that still use DVB subtitles have restorted to sending the flag all the time because of that.

        2. I guess what I was trying to point out is that teletext used to be used for subtitles/closed captioning that you could turn off if you didn’t need it, and you had it in different languages as well by simply turning a different teletext page. You could also have results tickers on sports programs, stock tickers, news tickers, departing flights tickers, realtime bus timetables etc. overlayed on any program. I remember there was even a telephone text chat page.

          Then they switched to DVB and it all stopped working because teletext wasn’t being streamed continuously anymore. You could still read the news pages and weather reports etc. but the really useful realtime stuff didn’t work any longer. Instead, you got the DVB implementations of subtitles which work worse than the teletext versions, so that television channels had to go back to burning subtitles to programs again.

          1. I do not know of anyone actually using those services you mention as important (and i was child in the 80ies – back when we also had fun with phoneline multiuser chats). ofcourse usage and services popularity is wastly different between different groups of people, i and my circles can be in the minority for all i know.

            But we are really (as far as i can see) talking about two different things. I said that teletext is still very much alive (it is) and you are saying the DVB standard has made it less usefull (which i will take your word for, not having encountered it myself)

    2. Yeah, it’s really a shame that here in the UK they decided, for whatever reason, that it was time to move on and ditch teletext. As far as I know, there’s no reason why you couldn’t send traditional teletext data along with digital TV, I believe some countries do just that, but I suppose you have to move on eventually.

      But hey, that’s no reason to let it die. :D

      1. Well, why move on if it works? its a lot easier for “old folks” to use the tv-remote that they are at least somewhat comfortable with than to use a computer with all the issues that can have. another important part of teletext is how it is always on – as long as you can pull in OTA stations. I guess it will die from neglect sooner or later though, as it will likely be folded into the “internet news site” groups of the respective tv companies, and slowly be less and less updated… even though its cheap to run for the company (you only have to add it to the already existing signal – internet news cost you for each client reading it (bandwidth/traffic is not free))

        Ofcourse is seems that the values of “it works” are different between people (just notice how in this very same thread Dax and I disagree on what is important services)

        1. Well, here in the UK, since the digital TV transition, we use an MHEG-5 system via DVB-T as a teletext replacement… confusingly, it’s also called teletext, or digital teletext, but it’s more of a web-like system. It’s available on any DVB-T set top box or TV here in the UK, as far as I’m aware, so it’s as widely available as old teletext used to be, but I’m not personally a fan of it. It does still use numbers for navigation, but it can contain real images, alternative video streams and the text is much higher resolution. It serves its purpose, but in my experience it’s slow and unwieldy, it feels clunky compared to good old “analogue” teletext.

          1. It’s actually a full programming language. The broadcaster streams a program to the television which then pulls other data streams down from the broadcast mux and presents them to the viewer.

            It’s the same system that we were supposed to have, but the people were so angry about the rushed implementation of the DVB network , the shoddy quality of the hardware and the poor signals despite claims that digital would carry further. They decided to just keep quiet about it because many people had already had to buy their second or third set-top-box before they started selling ones that actually work and the national broadcasting company was losing lisence payers at a rate of 50-100.000 a month. Most boxes and televisions didn’t actually support the digital teletext despite promises that it would have been a feature of the new digital network, so introducing it then would have angered even more people. So they never did.

            Eventually they solved the problem of people refusing to pay their tv lisences due to the digital transition by removing the lisence fee completely and introducing a new tax for the same amount.

    1. Just kidding, I’d like to be able to have my own tv channel in my home that I could add text to. I’ve got screens all over the place, including the barn and garage, being able to put up pertinent text could have its uses.

  1. Seems like you’re confusing Teletext and Bildschirmtext [lit. “screen text”], which is described in the Retrotechtacular link. Teletext has no back channel and needs no phone line. Like the american closed captions, it uses the blanking interval to transmit some extra data.

  2. 1) The Raspberry Pi is irrelevant here. It’s merely serving as a composite video source, and could be replaced by any other. Calling this “Dreamcast learns the lost art of Teletext” would have been both as accurate, and grossly misleading, because the creator tested with one of those too.

    2) All EzCap USB dongles are fakes. The real, original EzCap – and the chipset it uses – haven’t been made for many years. Both are essentially unobtainium unless you’re very, very lucky on the purchase of an old used device. If you’re purchasing new and retail, you will get a fake, period, and really have no idea what chipset you’ll get. I would love to know where to get a composite video capture device that is *guaranteed* to work well with a Pi, should anybody know.

    1. Actually, the Pi is serving a purpose beyond providing a composite video signal, the board is connected to the Pi’s I2C pins for control and data. While the composite signal could be from anything as I mentioned in the article, the device still needs to be fed the teletext page data from somewhere, it doesn’t store any on the AVR. I suppose if anything, my article is a bit confusing in that I state that it could be attached to anything… it could, that’s not untrue, but the Pi or some other I2C device would still need to be attached too, otherwise it really wouldn’t do anything.

      Interesting info on the EzCap dongles though, I had no idea, I just picked it up at a local car boot sale some years ago because I thought it’d come in handy. It does capture a video signal just fine, if that’s all you need, but when you start to get a bit more demanding, it promptly starts failing to deliver. Still, it’s cheap and cheerful, it’s still useful for casual video capture stuff.

      1. It can store a couple of static pages inn the AVR if you want. That’s not very interesting though. I designed this thing specifically with the Raspberry Pi in mind, knowing it has I2C and composite out, and could be used to fetch eg RSS feeds and transform them into teletext pages in real time to produce a kind of personalized teletext service.

        I concur about the EZCap. If you want a real composite capture the best thing is to get a WinTV PCI with BT8x8 chipset. This will work with just about anything you throw at it and it will also give you the raw untouched VBI lines for software decoding (something I exploited in one of my other teletext projects, recovering old pages from VHS tapes.)

        1. Hah! I didn’t realise you were the guy who did the software teletext generation too, good job, I’ll update the article so it credits you for that too.

          I had actually played with storing a couple of pages in the AVR, that’s how I got the page 100 and page 101, I haven’t yet worked out how to send multiple pages to the AVR in traditional magazine format. I did try piping some teletext dumps to it, with mixed – but ultimately unsuccessful – results, any tips on how I should format the data? I’ve been bashing my head against my compiler for hours trying to work around it, lol.

          My current capture card is based on a Philips 7134 tuner, which also offers a VBI debugging display, very very useful, I don’t know it’d even be possible to play with this without that feature.

          I’ll be releasing the board files soon, I just want to fix up a couple of non-critical errors on my design, so I’ll drop you a line if you’d like a copy of them when they’re done.

          Thanks again, I’ve been wanting a cheap and easy to modify inserter for years, and because of you, I have one, which is awesome. :D

          1. The idea is to stream rows over I2C (one VBI line is one row of teletext data). The teletext decoder will deinterleave the magazines. It’s only necessary to send them in page order, or in other words exactly the way they would be received over the air, top to bottom, in field order.

            If you want to “debug” you can just use a normal TV. Somewhere in the code is a constant which detects the current line. You can change that and it will draw the lines in the visible area. You can make it render to the visible and VBI areas at the same time without much tweaking – that is how I debugged it originally.

            If you have problems with tuning a particular set, try altering the delay at the beginning of the horizontal scan function. Sometimes if the clock run in is too early or too late the TV won’t accept it.

            If you don’t have it, this document is essential: http://www.etsi.org/deliver/etsi_i_ets/300700_300799/300706/01_60/ets_300706e01p.pdf

            It fully explains teletext from the electrical level up to magazine and page decoding and rendering.

  3. The Y cable is just a simple RCA splitter, but it actually does more than simply combine the two signals. The board takes the video signal from the Pi, watches for sync pulses, and then overlays the teletext data pulses within the VBI. It must be timed correctly, otherwise you’ll get either no teletext, a bunch of random lines on your video, or both.

    Also, woot, hackaday’d. :D

    1. I should also mention that this board can’t actually generate its own composite video signal, though that’s one thing which would allow it to work without a Pi attached, it simply modifies an existing video signal by adding teletext data signals to the VBI. It’s a little like adding an OSD to a video signal, it simply turns bits of the image white, or in this case a non-visible area of the signal.

      A little clarification on teletext too, it’s a text mode which TVs in Europe are capable of, the signal is delivered over the antenna, there is no phone line nor subscription involved. The text is rendered by the TV on a separate “screen”, rather than displaying it as a channel. Think of it as very early multitasking, but on your TV. You can watch TV, or you can browse teletext, or you can do both with mix mode, but the TV picture and the teletext display are two distinct and separate things, though they both arrive in the same signal via the same antenna. You can’t capture teletext like a normal TV picture for this reason, it’s just a stream of bits hidden away above the top of the video, beyond what you normally see, it’s not rendered as an actual video signal until it’s decoded in the TV and spat out of the electron gun. Very much like closed captioning, which uses the same technology.

      For those interested, there is one exception I’m aware of, the BBC used to make a filler show which was run in the early hours of the morning, which was a selection of teletext pages rendered into a video stream, accompanied by some smooth jazz or similar stock music. But that’s a capture of a teletext receiver rendering to a video signal, you couldn’t navigate it yourself, and it’s not the way teletext usually worked.

      1. “You can’t capture teletext like a normal TV picture for this reason, it’s just a stream of bits hidden away above the top of the video”

        You can. A VCR would catch the hidden teletext signal, as it would directly record whatever signal came from the tuner. Replaying a recording of broadcast television would allow you to browse the teletext pages as they were coming through at the time of recording, so that if a program had optional subtitles, you’d play the casette and overlay the relevant teletext page on your video from your TV.

        Nowadays doing that is almost impossible, because digital recorders don’t allow you to pull the recordings out from the hard drive, and even when they give you the program stream file, it’s very difficult to burn it onto a DVD while preserving the subtitles.

        1. Right, but what I mean is that it’s not a normal video image like some other text presentation methods in use around the world. It’s quite difficult to give an accurate but very specific description of teletext for people who have no idea what it is, the point I’m trying to get across is that it’s a data service, not a video based one. I guess I could’ve just said that, lol.

  4. I do like this hack but feel it is not complete yet.
    I miss some code to feed the AVR with data from the RPI, do you have some examples ?
    My RPI is used to generate test-chart pictures for HAM radio ATV transmissions, this would be a very nice addon to generate TeleText on my video signal!

    1. I don’t have any example code to hand because the SD card which contained them has gone bye-bye, but if you’re running Linux then i2cset works great, that’s what I was using for testing. I should’ve probably done it all in python with proper libraries and whatnot, but a simple i2cset command is all you need to send page data. You could even write a simple script to read values from a serial port and print them to a teletext page or something like that.

  5. I’ve read the RPi chipset is very similar to that used in set-top boxes, so there might already be hardware in there to generate the teletext signal on the composite output already.

  6. I am currently making an inserter called vbit-pi. It will be able to run a full service including control packets for station ident and clock time for vcrs. At the moment all of the settings are in the source code but I plan to extend this and make control interfaces.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.