<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Scott Steinmetz</title>
    <description>The latest articles on DEV Community by Scott Steinmetz (@scott_steinmetz).</description>
    <link>https://dev.to/scott_steinmetz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4050394%2F611c58d9-5498-4ab0-a85f-b1e3a2e49097.png</url>
      <title>DEV Community: Scott Steinmetz</title>
      <link>https://dev.to/scott_steinmetz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/scott_steinmetz"/>
    <language>en</language>
    <item>
      <title>Writing a Linux Driver From Scratch to Watch Free TV on a Raspberry Pi</title>
      <dc:creator>Scott Steinmetz</dc:creator>
      <pubDate>Tue, 28 Jul 2026 03:20:31 +0000</pubDate>
      <link>https://dev.to/scott_steinmetz/writing-a-linux-driver-from-scratch-to-watch-free-tv-on-a-raspberry-pi-40o5</link>
      <guid>https://dev.to/scott_steinmetz/writing-a-linux-driver-from-scratch-to-watch-free-tv-on-a-raspberry-pi-40o5</guid>
      <description>&lt;p&gt;&lt;em&gt;May 2026&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;There's a touchscreen mounted in my kitchen — I call it the WallScreen. It runs recipes, the chore board, a calendar, the usual smart-home clutter. One day I decided it should also pull in free over-the-air television. No subscription, no streaming app, just the local broadcast towers that have been beaming HD into the air for free this whole time. I had a Raspberry Pi 5, a $30 USB tuner, and what I assumed would be a boring afternoon.&lt;/p&gt;

&lt;p&gt;It was not a boring afternoon.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tuner that didn't want to work
&lt;/h2&gt;

&lt;p&gt;The tuner I grabbed was a &lt;strong&gt;MyGica A681&lt;/strong&gt; — a tidy little USB TV stick. Plug it into Windows, install the bundled software, done. Plug it into a Raspberry Pi running a current Linux kernel and you get… nothing. The computer notices a device is there and otherwise shrugs.&lt;/p&gt;

&lt;p&gt;Here's why, in two sentences:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Linux has no built-in driver for the chips inside this particular stick.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The manufacturer's driver only works on regular PC processors&lt;/strong&gt; — and even then, only as a sealed, prebuilt file with no source code. A Raspberry Pi uses a different kind of chip entirely, so that driver is a non-starter.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's the whole problem. The hardware is great. It's just that on a Pi, this tuner is a paperweight — and you can't buy or download your way out of it.&lt;/p&gt;

&lt;p&gt;The only way out was to write the driver myself.&lt;/p&gt;

&lt;h2&gt;
  
  
  What writing the driver actually involved
&lt;/h2&gt;

&lt;p&gt;A USB TV tuner isn't one chip — it's a little team of them working together. One chip is the "translator" that lets the computer talk to the device over USB. Another tunes to a channel, like turning a radio dial. A third converts the broadcast signal into video data the computer can use.&lt;/p&gt;

&lt;p&gt;The good news: for the parts that handle tuning and decoding the signal, I was able to build on existing open-source work from the broader Linux TV community — code other people had already written and shared for the chips inside this stick. (It's all credited in the project.)&lt;/p&gt;

&lt;p&gt;The missing piece — the part nobody had written — was the &lt;strong&gt;translator layer&lt;/strong&gt;: the code that tells Linux "this device exists, here's how to send it commands, and here's how to pull the live TV stream out of it." That's the driver I built from scratch. Once it was in place, the existing pieces could finally do their jobs, and the signal had a path from the antenna all the way to the screen.&lt;/p&gt;

&lt;p&gt;In theory.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bug that ate the afternoon
&lt;/h2&gt;

&lt;p&gt;When I first loaded everything up, the tuner reported that it had &lt;em&gt;locked onto a real TV station.&lt;/em&gt; Every indicator was green. And it produced &lt;strong&gt;zero video.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A tuner that's "locked on" but sends no picture is a uniquely maddening problem, because nothing looks broken. I spent hours convinced I had a setting backwards, and tried every variation I could think of to coax data out of it.&lt;/p&gt;

&lt;p&gt;The fix, embarrassingly, was to &lt;strong&gt;change nothing.&lt;/strong&gt; The code I'd built on came with a sensible default for how the video data should flow out of the device — and that default was correct all along. The moment I'd "helpfully" switched it to what I assumed was the right mode, I'd broken it. I put the default back and the live TV stream came pouring out.&lt;/p&gt;

&lt;p&gt;The lesson I keep relearning in this kind of work: when something already ships with a sensible default, the burden of proof is on &lt;em&gt;changing&lt;/em&gt; it — not on second-guessing it.&lt;/p&gt;

&lt;h2&gt;
  
  
  When the instruments lie
&lt;/h2&gt;

&lt;p&gt;The second trap was sneakier. With video finally flowing, I checked the tuner's own readouts for signal quality — strength, error rate, that sort of thing. They were &lt;strong&gt;terrible&lt;/strong&gt;: numbers that said the signal was practically nonexistent, on a channel that was playing flawlessly right in front of me.&lt;/p&gt;

&lt;p&gt;It turned out those particular readouts were never actually implemented for this chip — they just report meaningless noise. If I'd trusted them, I'd have concluded my working driver was broken and thrown it away.&lt;/p&gt;

&lt;p&gt;So I stopped trusting the dashboard and started checking the data directly: a tiny script that grabs a few seconds of the live stream and confirms it has the structure a real TV broadcast should have. If it does, the driver works — full stop, no matter what the instruments claim. That capture-and-check became my real source of truth, and it's the method I recommend to anyone using the driver.&lt;/p&gt;

&lt;p&gt;The payoff: it locked cleanly onto my local stations and pulled in every channel and subchannel they broadcast.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making it last
&lt;/h2&gt;

&lt;p&gt;A driver that works today but breaks the next time the Pi updates itself is just a future headache. So I packaged it to &lt;strong&gt;rebuild itself automatically&lt;/strong&gt; whenever the system installs a new version of Linux, and to load the moment the tuner is plugged in. Install it once and forget it's there.&lt;/p&gt;

&lt;h2&gt;
  
  
  From "it works" to "TV anywhere in the house"
&lt;/h2&gt;

&lt;p&gt;A working driver gives you raw data, not a TV experience. To finish the job I layered the standard open-source TV software on top: a backend that scans the airwaves and organizes everything into proper channels, and a TV-style interface on the WallScreen itself with a one-tap launcher.&lt;/p&gt;

&lt;p&gt;The fun part is how many ways the rest of the house can now watch the same antenna:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Straight from a web browser.&lt;/strong&gt; Any device on my home Wi-Fi can open a page and start watching — no app to install. To keep this smooth, the actual video conversion is offloaded to my ProDesk, a more powerful machine on the network, so the little Pi isn't stuck doing the heavy lifting just to feed a browser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Through a free TV app.&lt;/strong&gt; On a phone, laptop, or another TV box, you can install Kodi (a free, open-source media app), point it at the home TV server's address, and get the full channel guide and a proper remote-friendly interface.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There's one honest limitation to call out: I'm using a &lt;strong&gt;single tuner.&lt;/strong&gt; A tuner can only sit on one channel at a time — but it can hand that one channel out to as many screens as I want. So the whole house can watch the same station together with no trouble; what it &lt;em&gt;can't&lt;/em&gt; do is let one person watch the news while someone else watches a game on a different channel. That would take a &lt;strong&gt;multi-tuner device&lt;/strong&gt; (something like a multi-tuner network TV box that holds several channels at once). For now, one tuner covers how we actually watch, and stepping up is just a matter of swapping in bigger hardware later — the software already handles it.&lt;/p&gt;

&lt;p&gt;A couple of other things this setup &lt;em&gt;can&lt;/em&gt; do that I deliberately left for a future upgrade, to keep the first version simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Watching from outside the house&lt;/strong&gt; — secure remote access so I could pull up local channels while traveling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recording shows (DVR)&lt;/strong&gt; — the software supports scheduling recordings like a TiVo.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both are well within reach with what's already running; I just chose to get live TV rock-solid first and treat those as phase two.&lt;/p&gt;

&lt;p&gt;There was also one last gremlin worth a mention: the TV software kept crashing and restarting mid-show, which &lt;em&gt;looked&lt;/em&gt; like a flaky signal but turned out to be a single bad default value buried in its streaming settings. One corrected setting and it's been rock-solid since.&lt;/p&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;What started as "let me plug in a TV tuner" turned into reverse-engineering how the device talks, writing a piece of the operating system by hand, and chasing down two bugs that each disguised themselves as something they weren't. That's the nature of this kind of work: the hardware is rarely the hard part — it's the undocumented gaps between the pieces.&lt;/p&gt;

&lt;p&gt;The kitchen screen now plays free local HD on tap — and so does every phone, laptop, and TV in the house. The best part: the next person who buys this same tuner for their Raspberry Pi doesn't have to spend the afternoon I spent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I've published the complete, working driver on GitHub so anyone can use it:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/LordLuktor/mygica-a681-linux-driver" rel="noopener noreferrer"&gt;https://github.com/LordLuktor/mygica-a681-linux-driver&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Clone it, run the installer, plug in your tuner, and you're watching TV — no proprietary software, no subscription, no fuss. It's free and open-source, with full credit to the open-source TV community whose work made it possible.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>linux</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
