osmo-fl2k: Using cheap USB 3.0 VGA adapters as SDR transmitter ============================================================== :author: Steve Markgraf :copyright: 2018 by Steve Markgraf (License: CC-BY-SA) :backend: slidy :max-width: 45em == Devices with FL2000 chip image::fl2k_devices.jpg[width="80%"] == Transmitting signals with VGA [role=""] * Use the harmonics of VGA DAC to transmit RF * Has a rather long history [role=""] ** 2001: Erik Thiele "Tempest for Eliza", AM Radio ** 2005: Fabrice Bellard transmitted DVB-T and analog TV ** 2009: Bartek Kania transmitted WBFM (VGASIG) ** 2013: siro at "das Labor": I/Q modulator attached to VGA card * Similar idea: RPitx, but VGA has a real DAC instead of PWM == VGA Synchronization image::vga_frame.png[width="50%"] [role=""] * Main issue with all VGA cards: HSYNC/VSYNC * Basically "lost samples", not user controllable * Very bad for analog modulation types * Some OFDM-based systems can cope with it (like DVB-T) footnote:[Image source: http://martin.hinner.info/vga/vga.html] == USB VGA adapters [role=""] * Two manufacturers: * Displaylink ** classical graphics card with framebuffer and USB interface * Fresco Logic ** Software defined approach ** Framebuffer in host memory ** Image constantly being streamed via USB 3.0 ** Makes adapters very cheap (5-10$) * Sounds very interesting... ;) == FL2000 Hardware image::fl2k_pcb_top.jpg[width="60%"] == Reverse Engineering [role=""] * Same approach as with rtl-sdr * VirtualBox VM with Windows and original driver * USB 3.0 device forwarded to VM * Sniffing USB traffic with Wireshark on Linux * Replaying commands in libusb-based application * Remove stuff until it doesn't work anymore * Play with register contents to figure out what does what == Reverse Engineering cont. * Figure out data format used in USB buffer * Experiment with PLL register to figure out how clocking works * At some point after lots of experimentation end up with this: image::lostsamples.png[width="40%"] * VSYNC and HSYNC completely disabled, but still some lost samples == Goal: Continuous stream of samples [role=""] * Look again at Wireshark traces * Last URB of USB transfer was smaller than other URBs * Choose a new resolution that is a multiple of URB size (61440) * 1280 * 1024 * 3 colors = 61440 * 64 * => Result: 150 MHz, 3 channel 8-Bit DAC with USB 3.0 interface == libosmo-fl2k [role=""] * Initializes the device, sets the sample rate * Can be fed with 8 bit signed or unsigned samples * Performs conversion of buffer format * Can use zero-copy buffers to reduce CPU load == Applications [role=""] * fl2k_file ** Streams a file with samples to device, repeats * fl2k_tcp ** Streams samples from TCP to device, e.g. GNU Radio * fl2k_fm ** FM Modulator with stereo and RDS support ** Can be used together with SoX to transmit WBFM ** based on VGASIG code for FM modulation and PiFmRds * fl2k_test ** Determines PPM offset to system clock ** Useful for calibration of device * Still needed: fl2k_upsample ** Upsample I/Q baseband samples in real time ** Hoernchen started with it, more work needed == VGA SDR transmitter * Transmission of several signals was tested successfully: * WBFM * DAB * DVB-T * GSM * UMTS * LTE * GPS (11th harmonic!) == Example: GSM transmission * Upsample using GNU Radio * Synthesized carrier frequency: 40.6 MHz * DAC sample rate: 138 MHz ± 40.6 MHz ** 3rd harmonic: 414 MHz ± 40.6 MHz ** 5th harmonic: 690 MHz ± 40.6 MHz ** 7th harmonic: 966 MHz ± 40.6 MHz ** => Images: 925.4 MHz (ARFCN 976), 1006.6 MHz == Example: GSM transmission image::vga_gsm.jpg[width="50%"] == Further ideas * Connect I/Q modulator to do "proper" transmission * Add reconstruction filter and use as lab signal generator (0-75 MHz) * Synchronize clock with rtl-sdr to use both as very cheap transceiver == Quality differences * Device with two LDOs for DAC reference and digital supply image::fl2k_dacref_ldo.png[height="80%"] == Quality differences * Device with two switching regulators image::fl2k_dacref_smps.png[height="80%"] == Output spectrum image::spectrum.png[height="80%"] == EOF * More information: * https://osmocom.org/projects/osmo-fl2k/wiki * Questions? image::rds.jpg[]