-
Notifications
You must be signed in to change notification settings - Fork 85
Clockgen Mod
Previous Page CX Cards
Sub-Page RF Capture Guide
Next Page Hardware Installation Guide


2x CX Cards (RF Capture) // H/W Left & Right audio on a secondary bracket for baseband capture.
Software Install / Buy Hardware Kits & Parts / Build your own Hardware
This doc is the official vhs-decode standardised workflow implementation of Rene Wolfs "cxadc-clock-generator-audio-adc" or just "clockgen mod" setup wiki which is flushed out with more theory.
This doc focuses on the basics of what goes whare and getting setup to make captures, and use them with the decode workflow.
Tip
Open images in a new tab for full resolution viewing of images on this page.
Important
This Guide Assumes you have CXADC Installed and have tested your cards before starting modification of them and know the basics of capture with a CX Card, and have at least overview info about its mods.
The clockgen mod setup typically assumes external amplifiers are employed, allowing for optimal signal-to-noise ratio of the raw Video/HiFi FM signals intended to be captured without need for the CX Cards gain levels to ever be modified so they are running in a "fixed config" for 99% of situations.
Important
C31 Mod & BNC Mod is normally recommended and assumed deployed with this mod.
To avoid any worries of permissions of configuration we want to set the system to use the same config on every re-boot, to do this we use the udev rules
File System --> etc --> udev --> rules.d
/etc/udev/rules/
Inside this folder using admin privileges made place a cxadc.rules file with your desired configuration.
This example config should be ample for most users current setups.
Clockgen Capture --> FM RF & Audio Files --> HiFi-Decode (if present) --> Auto Audio Align (Linear & or HiFi) --> vhs-decode
./local-capture.sh --add-date --video=0 --hifi=1 --compress-video --convert-linear --resample-hifi --compress-hifi VHS_PAL_SP_Tape_001
sudo apt install jq curl
Warning
FLAC v1.4.x is normally the default package used by Linux dependency repository's, so manual installation is still required to get v1.5.0 and reliable Video/HiFi real-time compression.
sudo apt update && sudo apt install -y build-essential cmake libogg-dev
Install FLAC 1.5.0
wget https://github.com/xiph/flac/releases/download/1.5.0/flac-1.5.0.tar.xz
tar -xf flac-1.5.0.tar.xz
cd flac-1.5.0
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
sudo make install
sudo ldconfig
Tip
For 8mm users and people with mixed setups, this method allows you to pick and choose what hardware is capturing.
This web server capture workflow can be done locally on a single computer.
However being a "server" also allows for captures to networked storage pools, but has more reliable buffering than the direct script for lower end systems.
Note
- Baseband audio capture is called "
linear" due to the hardcoded capture server naming, however it should be renamed tobaseband. - Unless you 100% know the output is Linear naming of source capture should always be correct context as it could be baseband audio derived from HiFi audio unless using a deck with forced Linear only mode on the audio connections.
./local-capture.sh --add-date --video=0 --hifi=1 --compress-video --compress-hifi --resample-hifi --convert-linear tape_capture_name
This will output a 4 file set ready for use with the decode workflow.
- filename-2025-11-21_12_09_49_00_00-headswitch.u8
- filename-2025-11-21_12_09_49_00_00-video.flac
- filename-2025-11-21_12_09_49_00_00-hifi.flac
- filename-2025-11-21_12_09_49_00_00-linear.flac
Important
Ensure both the script & the capture server itself has read and write permissions for the video group.
Caution
Only stop/exit with pressing q if you do CTRL + C as you would for a normal script, it will break USB audio device access and will require restarting your system.
- Direct capture creates 2 40msps files
- Resampling uses SoX on the HiFi RF to make a 10msps 8-bit file
If your system is slow and or very low-end direct capture is the safest option, if you're noticing time differences between decoded HiFi and baseband captures of HiFi for example.
- Direct Capture Script (Without HiFi Down-sampling)
- Capture Script (With HiFi Down-sampling)
- Collect Info Script
- SoX Benchmark Script
Synchronised capture is all scripted into a single .sh file to run it simply download it and define the output path
Example:
./cxadc-vhs-sync-capture.sh /home/harry/Desktop
The Resulting Output:
RF Output is:
xxxx.xx.xx-xx.xx.xx-rf-audio-10msps.u8
xxxx.xx.xx-xx.xx.xx-rf-video-40msps.u8
Audio is 24-bit 3 channel 46875sps (46khz) file the mapping is:
Left/Right/Headswitch
You will want to map this to 2 separate audio tracks for muxing into a final video file.
The file set is automatically date stamped yyyy.hh.dd-hh.mm.ss
Important
Read this segment if you are confused by multiple standard audio files from long duration captures with basic scripts.
For the next step to be easy and fluid captures over 1 hour long, using the bash script method typically end up being split into multiple .wav files by the encoder for the baseband audio capture.
You can consolidate these together in an audio editor or DAW such as Ocen Audio, Audacity, Adobe Audition, iZotope RX with relative ease or you can use FFmpeg and or SoX.
SoX:
sox input-1.wav input-2.wav combined.wav
FFmpeg:
ffmpeg -i input1.wav -i input2.wav -i input3.wav -i input4.wav -filter_complex '[0:0][1:0][2:0][3:0] concat=n=4:v=0:a=1[out]' -map '[out]' output.wav
After decoding your Video RF and or HiFi FM audio you will want to sync your decoded audio data with your video file or Baseband (normally Linear audio) captures made by audio ADC's running off the same clock source like the Clockgen Mod or MISRC.
There is a few ways to do this, as it is only a simple process of reading the post decoded .JSON file for total duration and offsets from dropped fields/frames of information, but the standard workflow currently uses Rene Wolfs implementation for Windows, Linux and MacOS, however this may change to a more universal python replacement later as Mono is considered an extra dependency.
With a standard configuration you just need to alter the following:
-i baseband.wav
Input PCM or FLAC audio file.
--json capture.tbc.json
Input TBC JSON from decoded video RF.
baseband_aligned.flac
Output name at the end (also s16 will do 16-bit if s24 is replaced)
--stream-sample-rate-hz
Input rate of your audio file in Hz i.e 46875 for clockgen baseband or 48000 for hifi-decode or 44100 for ld-decode.
--rf-video-sample-rate-hz
Capture rate of your base file this normally will be 40000000 (40Msps) or 20000000 (20Msps) & 16000000 (16Msps) for down-sampled captures.
Tip
Below is premade commands for usage:
Linux & MacOS
"ffmpeg" -i baseband.wav -filter 'channelmap=map=FL-FL|FR-FR' -f s24le -ac 2 - | mono VhsDecodeAutoAudioAlign.exe stream-align --sample-size-bytes 6 --stream-sample-rate-hz 46875 --json capture.tbc.json --rf-video-sample-rate-hz 40000000 | ffmpeg -f s24le -ar 46875 -ac 2 -i - -af aresample=48000 -sample_fmt s32 baseband_aligned.flac
"ffmpeg" -i baseband.wav -filter_complex "[0:a]channelsplit=channel_layout=2.1:channels=FL[FL]" -map "[FL]" -f s24le -ac 1 - | mono VhsDecodeAutoAudioAlign.exe stream-align --sample-size-bytes 3 --stream-sample-rate-hz 46875 --json capture.tbc.json --rf-video-sample-rate-hz 40000000 | ffmpeg -f s24le -ar 46875 -ac 1 -i - -af aresample=48000 -sample_fmt s32 baseband_aligned.flac
Windows
ffmpeg.exe -i baseband.wav -filter_complex "channelmap=map=FL-FL|FR-FR" -f s24le -ac 2 - | VhsDecodeAutoAudioAlign.exe stream-align --sample-size-bytes 6 --stream-sample-rate-hz 46875 --json capture.tbc.json --rf-video-sample-rate-hz 40000000 | ffmpeg.exe -f s24le -ar 46875 -ac 2 -i - -af aresample=48000 -sample_fmt s32 baseband_aligned.flac
ffmpeg.exe -i baseband.wav -filter_complex "[0:a]channelsplit=channel_layout=2.1:channels=FL[FL]" -map "[FL]" -f s24le -ac 1 - | VhsDecodeAutoAudioAlign.exe stream-align --sample-size-bytes 3 --stream-sample-rate-hz 46875 --json capture.tbc.json --rf-video-sample-rate-hz 40000000 | ffmpeg.exe -f s24le -ar 46875 -ac 1 -i - -af aresample=48000 -sample_fmt s32 baseband_aligned.flac
Ensure CXADC is installed and working with your 1-2 CX Cards.
cxvalues
If 2 sets of cards values show up, then both cards are good and ready to go for modification, likewise after modifying cards use this to check on every re-boot that both show up.
Install alsamixer
sudo apt install asmixer
Run alsamixer with:
alsamixer
Sample rate modes are the following:
28.63msps, 20msps, 40msps, 50msps
To open the terminal control window use:
alsamixer
Press F6 to change devices.
Navigate with ↑ & ↓ keys.
Hit Enter with CXADC+ADC+ClockGen selected.
Set both cards to 40MHz mode.
Press Space to enable audio control.
That is about it, you only play with these settings when doing manual overrides for stock settings.
Fix Capture Script Permissions
chmod +x cxadc-sync-capture.sh
Test Firmware / Clock Gen Firmware / Reset Firmware
-
Ensure Pi Pico is not plugged into the mainboard of the clockgen.
-
Equip a USB-C or Micro-B cable depending on your Pi Pico Type.
-
The Pi Pico displays as a USB storage device if working.
-
Simply drag and drop the test firmware onto the file system, and it will automatically flash
Note
If the unit blinks then its all good to reset and proceed.
Note
To reset an Pi Pico Hold the button on it while unplugged then plug into usb, and use the flash_nuke.uf2 file to reset it to clean.
After a successful flashing, the Pi Pico will show up as a microphone 3ch 48khz device to any systems sound manager application.
As the clockgen mod is powered and driven by the Pi Pico, it requires both power and data from a Micro-B or USB-C cable (depending on Pico board used)
Normally PC's and Servers have always a single or 2-3 internal USB 2.0 headers for basic devices.
Tip
You can buy pre-made cases here!
As the audio ADC is unbalanced, and the clock gen board is sensitive to EMI due to high frequency clock signals being generated it's recommended to shield the setup.
You can print a PCI bracket, or you can drill out metal brackets.
Copper Tape + 3D Printed Case
Check USB Devices with
lsusb
Check PCI & PCie Devices with
lspci
Test
arecord -D hw:CARD=CXADCADCClockGe -c 3 -r 46875 -f S24_3LE --samples=1000 test.wav
Result
arecord: main:831: audio open error: Device or resource busy
Solution:
Restart, try again
- PC Wont boot
This can be 2 key issues, bad SMA cable, or bad jig.
The Jig boards for the CX Cards are very sensitive, if a board is damaged or component then the board will not work.
Solution:
Reflow parts, if fail use another board, or replace all SMD components on PCB Jig.
Pre-made PCB boards off the Kofi Store.
Direct PCB Fab - Here's the Gerber's
I like PCBway but you can use JLCPCB or any domestic fab house or make them at home even have fun!
Is it worth using a PCB fab to populate parts?
No not really doing it yourself is very easy and the price of having 2 boards populated, you can buy the tools and learn a invaluable skill of basic 0805 SMD soldering which is the most common value or size of SMD parts used today, or if would like to support the work and save some time then you can order full kits pre-made.
Cables:
- 2x 50Ohm SMA to SMA 30-50cm Cable
- 1x 50Ohm SMA to BNC bulkhead 30-50cm.
- 2x BNC to BNC 50Ohm cables (Video RF + HiFi RF)
- 1x RCA or XLR to RCA cable (Linear or HiFi Ref)
Tools:
It's worth reading the Hardware Installation Guide as this fully covers what tools are recommended to build boards and do RF Tappping!
- 3rd Arm Clip Holder or Vice Clamp
- Soldering Iron / Bevel Type Tip
- 63/37 0.8mm - Mechanic SX-862 or better (i.g Siliverline or Kestral 60/40)
- Side Cutters
- 99.9% IPA
- Desoldering Gun or ENGINEER SS-02 Solder Sucker
- Desoldering braid
Parts:
-
C- Capacitor -
D- Diode -
R- Resistor
Part Sizes
- SMA's are edge mount style connectors.
- SMD SOD-123 - Diodes
- 0805 SMD - Resistor & Capacitor
The top PCIe card is card 0 and bottom is card 1 for video and hifi respectively shortest distance to CPU will always define card 0, with the modded bracket providing secure bulkheads for standard RCA cables and a BNC to SMA bulkhead for head-switching & sync.
Note
Although the headswiching is not used by decoding tools currently it can be used for absolute ref for field dropout information.
Tip
You can order pre-drilled metal brackets here!
Tip
You can order pre-assmbled jigs or bare PCBs here!
Front & Back


Important
Ensure orientation of opening fins are suited for the airflow of your case/fan setup.
L 40mm X W 40mm X H 11mm heatsinks are readily available.
Tip
Conformal coating can also protect the surface from dust, oils and debris, also allowing for safe mounting of conductive heatsyncs.
Tip
You can order pre-assmbled jigs or bare PCBs here!
Warning
Ensure all parts are populated in the correct orientation as shown in the image below.
- J30: SMA Edge Mount
- C1: 1.5 nF (6V or greater, ceramic X5R or X7R)
- C2: 10 nF (6V or greater, ceramic X5R or X7R)
- R1: 1K Ohm (5% tolerance or better)
- R2: 1K Ohm (5% tolerance or better)
- R3: 10K Ohm (5% tolerance or better)
- 2mm thick 25mm wide double-sided foam tape.
- 26AGW wire in 4 colours Link
Caution
- This PCB when connected to a CX Card will be under tension, ensure strong adhesive tape is used, silicone or epoxy glues and ensure both surfaces are cleaned with 99.9% IPA and dry before adhering.
- Do not use a permenent mounting method on the jig before testing the mod is fully working on the card.
Important
- Ensure that the 3 parts C22, R12, C19 & Y1 the crystal are removed.
- Be careful to not touch or overflow low melt solder onto C80, C78, C78.
- You may want to cover them with some Kapton tape or remove C80 with soldering tweezers before removing the crystal.
To solder wires to C85 add some flux and add extra solder to the pads before hand and ensure the wires are tinned but long enough to pinch and pull into the side of the capacitor, doing top/bottom separately as not to make a cold joint or knock the capacitor off.
Cut any exsess wire off with a pair of flush or flat cutters, but do not press them into the PCB as you can scratch it and damage traces.
Tip
You can order pre-assembled mainboards or bare PCBs here!
Warning
Always check via line indicator on SMD ports the polarity of diodes are in-line with indicator on PCB!
Gen 2 PCB using SMA for Headswitch/Sync input and the 2 clock output pads for CX Card 1 & 2, compatible with the original 3D printed case.
There is 3 off shelf boards used for this:
AliExpress is most likely the cheapest place to source these but are very available on Amazon and other vendors globally.
-
Raspberry Pi Pico as the interface and control board via USB (Clockgen PCB is based around the 1st party green PCB but you can use Micro-USB or USB-C port versions)
-
Adafruit Si5351A for generating the shared clock source with 5 potential inputs.
-
PCM1802 PCB ADC for L/R input baseband Linear or HiFi audio capture.
Parts:
- SMA Edge Mount or Vertical (On Headswitch/Ground Pads)
- C1: 10 µF
- R1: 1K Ohm
- D1: 3.3V zener diode
- D2: Generic switching diode
Sockets:
Header Socket Pin Size: 2.54mm
- U1: 2x 20-pin Header Socket (Pi Pico)
- U2: 1x 9-pin Header Socket (PCM1802)
- U3: 1x 7-pin Header Socket (Si5351A)
Board Parts:
- 1x 1m XLR Audio Cable (Left/Right & Ground via shielding)
- 1x Pair of RCA or TRS audio connectors.
- 1x Small Zip-Tie or Cable-Tie (to secure audio line)
Interface:
- USB 2.0 Internal to Type-A or to Micro-B (or USB-C) cable
Secondary:
- BNC Bulkhead to SMA
- Copper Tape
- Electrical Tape
- Heatshrink (optional)
- Metal PCI Bracket & Step Drill Bits (or 3D printer and filament)
Note
The Si5351A kit headers are not recommended for socketed connectors, It's recommended to solder headers then the board to said 2.54mm headers directly to ensure a secure connection.
Tip
You can order pre-drilled brackets or whole audio kits here!
Caution
Ensure all parts are populated on the PCB as shown in the top-down photo below if parts are missing you will have issues!
Note
There are multiple variants of the PCM1802 board floating around. Check for continuity with your multimeter before you start to work out what board you have.
To check what board you have, check for continuity between the following points (as pictured):
- 3.3v and Mode0 Bridge + Pad
- 5v and Mode0 Bridge + Pad
- Right Leg of the voltage regulator and 3.3v


If you've got 3.3v (or 5v) to the pads on the back, and the right leg of the voltage regulator goes to the 3.3v pin, then you've got a fully good PCM1802! If you've got no connection between 3.3v (or 5v) to the pads on the back and the right leg of the voltage regulator goes to the 3.3v pin - you've got Board Type 1. If you've got 5v (or 3.3v) to the pads on the back, and the right leg of the voltage regulator does NOT go to the 3.3v pin - then you've got Board Type 2.
For all board types, you'll need to bridge the MODE0 Pads as well as the MODE1 pads as well as solder on the 8pin 2.54mm header.
This variant of the PCM1802 Board requires a bodge wire bypass mod as the 3.3v line needs to be connected to the pads on the back.
Setup (as pictured)
- MODE0 with 3.3v Bridge Mod
- MODE1 bridged pads


This board is missing a trace from the 3.3v regulator to the 3.3v pin. You will need to run a wire to bridge the two together from the bottom right pin on the regulator to the 3.3v pin as pictured.
- Tin & strip back XLR cable end
- Ensure cable is past the configuration pad's as not to bridge anything.
- Secure XLR cable with cable tie on the same hole used for 3.3v boge wire.
Tip
When soldering the ground the RCA lugs you can have it slightly shorter to sang proof the cable so no tugging or tension is on the signal wires.
- Insulate the signal lines with tape or ideally a few mm thick of silicone.
- Wrap entire back end of connectors with metal foil tape to shield it to ground.
RCA Left/Right Audio & Headswitch Input BNC connected to the Clockgen Mainboard.
Tip
BNC to SMA cable is for the Aux "headswitch" or sync input, this is optional as its not used by the decoders today, but could be useful later.
- Turn off system
- Find two available PCIe slots with 1x gen 2 or better bandwith.
- Find one USB 2.0 motherboard header use a adapter cable to Connect your clockgen mainboard
- Connect your cards to the slots and connect your SMA clock lines
- Turn the power on and follow the software guide portion of this page for configuration.
Tip
If you have space adding a side fan such as 80mm or 120mm can provide plenty of extra airflow and saves space taken by using fans on the cards/heatsinks directly.
There is also a spin-off of the clockgen mod just using wires and a Pi Pico on its own, but only the mainboard based version is the official "Clockgen Mod" workflow that is standardised for production.
Previous Page CX Cards
Sub-Page RF Capture Guide
Next Page Hardware Installation Guide
- FAQ - Frequently Asked Questions
- Diagram Breakdowns
- Visual-Comparisons
- VCR Reports / RF Tap Examples
- Download & Contribute Data
- Speed Testing
- Capture Setup Guide
- MISRC
- CX Cards & CXADC
- CX Cards - Clockgen Mod
- DdD - Domesday Duplicator
- RTL-SDR
- Hardware Installation Guide
- Finding RF Tap Locations
- Amplifier Setup Guide
- The Tap List Example VCR's
- Visual VBI Data Guide
- Closed Captioning
- Teletext
- WSS Wide - Screen Signalling
- VITC Timecode
- VITS Signals
- XDS Data (PBS)
- Video ID IEC 61880
- Auto Audio Align
- Vapoursynth TBC Median Stacking Guide
- Ruxpin-Decode & TV Teddy Tapes
- Tony's GNU Radio For Dummies Guide
- Tony's GNU Radio Scripts
- DomesDay Duplicator Utilities
- ld-decode Utilities