Skip to content

MISRC Is a multi channel RF capture device for FM RF, S-Video, CVBS RAW capture and anything else, but intended and supported for the decode family of projects vhs-decode, ld-decode, hifi-decode.

Notifications You must be signed in to change notification settings

Stefan-Olt/MISRC

Repository files navigation

MISRC - Multi Input Simultaneous Raw RF Capture

V1.5 with Tang Nano 20k on the FX3 to Tang adapter PCB.

Description

MISRC is a device to capture two signals at 12-bit and up to 40 MHz (could maybe be extended to 80 MHz in the future) and an additional 8-bit's of binary (auxiliary data) over USB 3.0.

It is intended to capture modulated tape deck RF for software demodulation, but also baseband CVBS/S-Video (Composite) video signals for software decoding, and can be used as a direct stream Oscilloscope but limited to 2vpp input voltage.

The Decode Projects:

Provide decoding for a wide range of videotape formats, HiFi audio and even RAW or Baseband composite decoding with free and powerful software time base correction with full post filtering control over the signal processing.


Possible capture examples:

  • Capture 2x CVBS
  • Capture 1x S-Video (Y & C)
  • Capture Video RF and HiFi RF simultaneously
  • Capture Video RF and CVBS simultaneously
  • Capture 4ch of 24-bit 48khz audio with AUX pins via integrated or external ADCs

Note

It may be useful for other purposes as well, as it is built as a generic ADC with configurable filtering.

Features

  • Two 12-bit 40msps ADCs
  • Selectable input gain (8 steps)
  • Selectable ADC range (1V or 2V)
  • Selectable input impedance (75, 50, 37.5 and 30 ohms)
  • DC or AC (pre- or post-termination) coupling
  • Zero-adjust to compensate DC offset
  • Latching clipping indicator
  • Clock source selectable: USB PLL, crystal or external Clock output SMA for external devices
  • Melted PCB Traces

Costs

Hardware

  • External Clock Source Output
  • 6 Extra Aux inputs for audio ADC modules etc
  • Duel ADC / Duel Input (BNC Connectors)
  • Physically adjustable input filters
  • 12-Bit, 20/40/65msps sampling
  • AD8138 Driver, Op-Amp / SN74ls541 Buffer / AD9235 ADC

Note

These are off-shelf PCBs and USB 3.0 devices that you add to the MISRC PCB.

Tip

You can order pre-made adapter PCBs here for V1.5 boards with the headders for the FX3.

Software & Firmware

There are 2 tools currently and a few dependencies required to deploy a MISRC.

  • hsdaoh Driver
  • MISRC Capture
  • MISRC Extract

Warning

The main hsdaoh branch (steve-m) does not have the required changes merged yet, ensure the above liked repo is used for install or your application will not build.

hsdaoh Driver Install Linux

To install the build dependencies on a distribution based on Debian (e.g. Ubuntu), run the following command:

sudo apt-get install build-essential cmake pkgconf libusb-1.0-0-dev libuvc-dev

To build hsdaoh:

git clone https://github.com/Stefan-Olt/hsdaoh.git
mkdir hsdaoh/build
cd hsdaoh/build
cmake ../ -DINSTALL_UDEV_RULES=ON
make -j 4
sudo make install
sudo ldconfig

To be able to access the USB device as non-root, the udev rules need to be installed (either use -DINSTALL_UDEV_RULES=ON or manually copy hsdaoh.rules to /etc/udev/rules.d/).

Before being able to use the device as a non-root user, the udev rules need to be reloaded:

sudo udevadm control -R
sudo udevadm trigger

Furthermore, make sure your user is a member of the group 'plugdev'. To make sure the group exists and add your user to it, run:

sudo groupadd plugdev
sudo usermod -a -G plugdev <your username>

If you haven't already been a member, you need to logout and login again for the group membership to become effective.

hsdaoh Driver Install Windows

Currently, this is highly experimental, noted here for testing and is not production implimented yet!

Firstly download Zadig to force the installation of WinUSB driver on your MS2130/MS2131 adapter.

Install MSYS2 (https://www.msys2.org/)

Start MSYS2 MINGW64 terminal from the application menu. (Blue Icon)

Update all packages:

pacman -Suy

Install the required dependencies:

pacman -S git zip mingw-w64-x86_64-libusb mingw-w64-x86_64-libwinpthread mingw-w64-x86_64-cc \ mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja

Clone & Build libuvc:

git clone https://github.com/steve-m/libuvc.git
mkdir libuvc/build && cd libuvc/build
cmake ../ -DCMAKE_INSTALL_PREFIX:PATH=/mingw64
cmake --build .
cmake --install .

Build libhsdaoh

cd ~
git clone https://github.com/steve-m/hsdaoh.git
mkdir hsdaoh/build && cd hsdaoh/build
cmake ../
cmake --build .

Gather all files required for release:

zip -j hsdaoh_win_release.zip src/*.exe src/*.dll /mingw64/bin/libusb-1.0.dll /mingw64/bin/libuvc.dll /mingw64/bin/libwinpthread-1.dll
Software Install

Tested and built on Linux Mint 21.03 and 22 / Ubuntu 22.04

First install dependencies

  • apt install libflac-dev
  • hsdaoh driver

These allow you to use the MS2130 & MS2131 chips directly.

Restart and then continue

Install capture & extract tools (Linux & MacOS)

git clone https://github.com/Stefan-Olt/MISRC.git

Enter Directory

cd MISRC/misrc_tools

Build and install

mkdir build
cd build
cmake ..
make
sudo make install

Run mirsc_extract or misrc_capture in any directory without arguments to trigger the help menu.

There is a dedicated sub-readme for these tools.

Firmware Flashing

Today we are now using the more affordable Tang Nano 20k sending the data over HDMI this only needs to be flashed once via usb connection, we have pre-compiled firmware see releases for the latest version.

Install openFPGALoader

Connect your Tang to a USB 3.0 port via its Type-C, it will need this for 5V power after flashing, but not data.

Run via terminal inside the firmware directory

openFPGALoader -b tangnano20k -f hsdaoh_nano20k_misrc.fs

You have flashed your Tang Nano 20k!

Capture

Caution

  • NEVER use USB for any other heavy-load task (like external HDD/SSD drives, USB network adapters, YUV capture devices) during capture.
  • Do not connect/disconnect any other USB device during capture, a dedicated USB 3.0 to 3.2 Gen 2 card is ideal for dedicated capture stations as it ensures dedicated bandwidth/power if you have other items that require USB.
  • Connect the desired sources to the BNC inputs and select suitable impedance and AC or DC coupling.

  • Start the capturing process for setting the gain:

    • Reset clipping LEDs (always on after start)
    • Increase gain during capture until clipping LED lights up
    • Decrease gain one step and reset clipping LED
    • Repeat for the second channel if in use
  • Stop capture and verify levels are acceptable in an audio editor (Audacity/Audition etc)

  • Start capture.

  • Stop capture.


misrc_capture is a simple program to capture from MISRC using hsdaoh to which levrages data capture over HDMI with MS2130 "U3" cheep HDMI capture cards that have YUV support.

Create a folder which you wish to capture inside, open it inside terminal and then run misrc_capture.

Example RAW:

misrc_capture -a video_rf.s16 -b hifi_rf.s16

Example with FLAC compression:

misrc_capture -f -a video_rf.flac -b hifi_rf.flac 

You can also define its directory path of each RF stream manually:

misrc_capture -f -a /mnt/my_video_storrage/video_rf.flac -b ../../this/is/a/relative/path/hifi_rf.flac

Press Ctrl+C to copy and Ctrl+P to past your config from a notepad or txt file.

Use <+> to move edit position on the command line to edit the name or command while in terminal and Enter to run the command.

Ctrl+C Will kill the current process, use this to stop the capture manually.

Usage Arguments:

-d device_index (default: 0)

-n number of samples to read (default: 0, infinite)

-a ADC A output file (use '-' to write on stdout)

-b ADC B output file (use '-' to write on stdout)

-x AUX output file (use '-' to write on stdout)

-r raw data output file (use '-' to write on stdout)

-p pad lower 4 bits of 16 bit output with 0 instead of upper 4

-f compress ADC output as FLAC

-l LEVEL set flac compression level (default: 1)

-v enable verification of flac encoder output

Design

MISRC is loosely based on the Domesday Duplicator (DdD).

It is built around the AD9235 analogue to digital converter by Analog Devices and is heavily based on the evaluation board circuit given in its datasheet with the AD8138 Op-Amp providing adjustable fixed gain.

The MISRC like the DdD it originally used the Cypress FX3 SuperSpeed Explorer board for a USB 3.0 data connection, and using Sigronk for capture, with hopes to not use the DE0 FPGA, this ended with the adoption of the Tang Nano 20k and MS2130 "data over YUV" method being used.

License

You can read the License here.

About

MISRC Is a multi channel RF capture device for FM RF, S-Video, CVBS RAW capture and anything else, but intended and supported for the decode family of projects vhs-decode, ld-decode, hifi-decode.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published