Skip to content

Repository files navigation

MyGica A681 (A681B) ATSC USB Tuner — Linux Driver

A working, out-of-tree Linux driver for the MyGica / Geniatech A681 (A681B) USB ATSC tuner — USB ID 1f4d:a681. It builds on ARM64 (Raspberry Pi 5) and x86-64, and is DKMS-packaged so it survives kernel upgrades.

Tested and confirmed working on a Raspberry Pi 5, kernel 6.18 (ARM64), feeding Tvheadend + Kodi for live over-the-air TV. It locks 8VSB ATSC muxes and delivers a clean MPEG-TS.

Full write-up: Writing a Linux Driver From Scratch to Watch Free TV on a Raspberry Pi

Why this exists: MyGica/Geniatech ship the demodulator + tuner drivers for this stick only as x86-64 binary blobs (.a archives) — no source, and useless on ARM. Mainline Linux has no driver for the chipset inside. So on any modern kernel — and on a Raspberry Pi in particular — this tuner is a brick out of the box. This driver fixes that.

What's inside the stick

The A681 is a three-chip design:

Role Chip Notes
USB bridge Cypress FX2 Generic USB 2.0 bridge; cxusb/D680-style control protocol
Demodulator Panasonic MN88436 8VSB / QAM ATSC demod, I²C addr 0x18
Tuner MaxLinear MXL603 I²C addr 0x60, driven internally by the MN88436 driver

The MN88436 driver controls the MXL603 over the same I²C bus via its mndmd_attach() entry point, so no separate tuner module is needed.

How it's put together

This repo is the buildable union of three things:

  1. dvb-usb-a681.cthe original work in this repo. A standalone dvb-usb glue module that registers 1f4d:a681, implements the FX2 bridge plumbing (USB control messages, I²C-over-USB, GPIO tuner reset, and bulk TS streaming), and attaches the MN88436 demod. The USB bridge protocol is modeled on the in-kernel cxusb driver's Conexant/D680 reference design, which the A681 inherits.
  2. mn88436.c + API headers — the MN88436 demodulator driver (with built-in MXL603 control), sourced from the TBS linux_media tree (github.com/tbsdtv/linux_media). GPL-2.0.
  3. Build/packagingMakefile, dkms.conf, and install.sh.

See Attribution & licensing for provenance details.

Build & install

Requires kernel headers for your running kernel and DKMS.

# Raspberry Pi OS / Debian / Ubuntu
sudo apt install raspberrypi-kernel-headers dkms build-essential   # Pi
# or:  sudo apt install linux-headers-$(uname -r) dkms build-essential

git clone https://github.com/LordLuktor/mygica-a681-linux-driver.git
cd mygica-a681-linux-driver
sudo ./install.sh

install.sh copies the source to /usr/src/a681-1.0, registers it with DKMS (AUTOINSTALL=yes, so it rebuilds automatically on kernel updates), builds, installs, and loads the modules.

To build the modules once without DKMS:

make                       # produces mn88436.ko and dvb-usb-a681.ko
sudo insmod mn88436.ko
sudo insmod dvb-usb-a681.ko

Plug in the tuner and check dmesg | tail. You should see the device claimed and a DVB frontend appear at /dev/dvb/adapter0/frontend0.

Verifying it works

Signal-quality stats (SNR / BER / signal strength) from this chipset's driver are not implemented and return garbage — ignore them. The real test is whether the demod recovers a valid transport stream:

# Scan for ATSC muxes
dvbv5-scan /usr/share/dvbv5/atsc/us-ATSC-center-frequencies-8VSB -o channels.conf

# Capture a few seconds and verify 188-byte TS sync
diagnostics/capture-ts.sh channels.conf

A VALID TS verdict means tuner + demod + USB bridge are all working. If a player then shows no picture, the problem is downstream (PSI/PID/app), not the driver.

Gotchas (learned the hard way)

  • TS output must be PARALLEL. The TBS source defaults to DMD_E_TSOUT_PARALLEL_BRTG_MODE with a NORMAL clock — leave it. Switching to serial TS output yields 0 bytes over the FX2 bridge. (This cost hours of chasing serial/clock-polarity ghosts; parallel was right all along.)
  • The stats lie. C/N, BER, and signal-strength readouts are unimplemented (you'll see things like 0% / 1.29 dB / 100% BER even on a perfect lock). Judge lock quality by an actual TS capture, not by these numbers.
  • No separate tuner module. Don't try to dvb_attach an MXL603 driver — the MN88436 driver owns the MXL603 over I²C.

Hardware this was validated on

  • MyGica A681B USB ATSC tuner (1f4d:a681)
  • Raspberry Pi 5, 8 GB, Raspberry Pi OS, kernel 6.18 (ARM64)
  • Locked WSIL (RF34 / 593 MHz, Carterville IL) at −19 dBm, clean 100%-sync TS, full service scan decoded — driving Tvheadend (ATSC OTA network) → Kodi.

Attribution & licensing

This driver is GPL-2.0, consistent with the Linux kernel and all upstream sources it derives from.

  • dvb-usb-a681.c, Makefile, dkms.conf, install.sh, and the diagnostic scripts are original work for this project, released under GPL-2.0.
  • mn88436.c, mn88436.h, MN_DMD_API.h, MXL603_API.h derive from the TBS linux_media tree (https://github.com/tbsdtv/linux_media), GPL-2.0. Copyright remains with the original authors.
  • dvb-usb.h and dvb-pll.h are Linux kernel headers (GPL-2.0), bundled so the legacy dvb-usb framework resolves for an out-of-tree build.
  • The USB bridge logic in dvb-usb-a681.c is modeled on the in-kernel cxusb driver (Patrick Boettcher, Michael Krufky, Chris Pascoe, Maciej S. Szmigiero), GPL-2.0.

No proprietary vendor blobs are included or required.

Disclaimer

Provided as-is under the GPL-2.0, with no warranty. It loads a kernel module on your system — read the source, and use at your own risk.

About

Working Linux driver for the MyGica A681 (A681B) USB ATSC tuner (1f4d:a681) — MN88436 demod + MXL603 tuner over a Cypress FX2 bridge. Builds on Raspberry Pi 5 / ARM64 and x86-64, DKMS-packaged.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages