Tuesday, May 01, 2018

First play with OSMO-FL2K compatible VGA dongle

Everyone knows about the popularisation of software defined radio that came about via the wonderful discovery that low cost USB TV dongles with realtech chipsets could be used. Now it looks like we have the same sort of thing but for transmitting.

Some low cost USB VGA adapters are so cheap that they are simply fast digital to analog converters. Steve M from Osmocom has figured out how to turn them into a simple output device suitable for transmitting. Mine came from Aliexpress but others are on eBay locally.

Here I tried a device and used the demo program to transmit an audio file (saved as WAV) over wide band FM to a nearby radio.

I'm on Ubuntu linux so there were some very small deviations from the instructions about USB memory buffer, I had to do this:

sudo sh -c 'echo 1000 > /sys/module/usbcore/parameters/usbfs_memory_mb'

To get some audio to transmit, I opened a 44100 rate mp3 in Audacity and saved it as WAV signed 16-bit PCM file.

The command line to transmit is:

fl2k_fm -s 130e6 -c 35e6 -i 44100 Electric\ Light\ Orchestra\ -\ Telephone\ Line.wav

So far other examples, and there are some amazing ones, require GNU Radio, but hopefully we'll get some more accessible ways to do interesting things like transmit WSPR in the near future.

This is a wonderful example of where the cheaper product is actually more useful than the more expensive versions.

There is a pretty good explanation of how this works in an earlier project VGASIG.

Here's how it looks on an SDR receiver. A little off frequency but looks reasonable to me.

And here's how the 35MHz waveform looks on a CRO:

So when working it's a decent 0.5V peak to peak waveform, DC offset. And a good signal on an FM radio at 95Mhz

I have noticed that this software/hardware works on some Linux machines and not others. It works fine on an Ubuntu 18.04 desktop but not on Fedora machines. When running on some machines it fails silently in that all appears to be running but there's no RF output.

Using the fl2k_file utility I output a sine wave. I can see the sine wave in the dongle output but there is lots of nasty spikes too. I guess a low pass filter could clean this up but it's not a good look.

Please let me know if you've got a better result than I have.

Update: Now getting a better waveform.

I've done some hacking on the FM code, basically stripping it right back and focusing on generating the cleanest wave I can on 40m.

This is running at a sample rate of 150Mega samples per second and a carrier of 7.159MHz. Not great but might be eventually useful (with some filtering) for something like WSPR transmit.

My stripped back version of the source now builds stand alone (no library) and simply generates a sine wave carrier. The source is available here.


twentyfour-fr said...

Hello, I bought 2 versions of this dongle, one of two dnt that does not look at all inside the photo that is on the site Aliexpress.
The version I have and that seems to correct each time an SPI chip containing operating drivers.

under my Ubuntu a dmesg tells me clearly that this is a USB storage medium, but when I run a test with fl2k I get a result but sometimes he tells me to wait 10 seconds longer for the kernel defeats storage.

Here is what gives me the result fl2k_test -s 162:

Allocating 6 zero-copy buffers
Reporting PPM error measurement every 10 seconds...
Press ^C after a few minutes.
real sample rate: 58370469 current PPM: -550996 cumulative PPM: -550996
real sample rate: 58278531 current PPM: -551704 cumulative PPM: -551353
real sample rate: 58374594 current PPM: -550965 cumulative PPM: -551223
real sample rate: 58309954 current PPM: -551462 cumulative PPM: -551283

When I use the following command (having taken care to download the mp3 file and converted to wav PCM 16 signed and put in mono):
fl2k_fm -s 130e6 -c 35e6 -i 44100 Electric \ Light \ Orchestra \ - \ Telephone \ Line.wav

I have this result :
Samplerate: 130.00 MHz
Carrier: 35.00 MHz
Frequencies: 95.00 MHz, 165.00 MHz
Allocating 6 zero-copy buffers

Nothing on my FM radio on the 95MHz or anywhere else. My SDR USB key when it does not capture anything either on the 95MHz although the 2 antennas are local (wire on the pin 1 of the adapter and telescopic antenna on the SDR).

I do not understand because with completely strange settings I can transmit on other frequencies with the same adapter vga, the SPI chip would it be responsible that it does not work?

I live in France and where I live I have a lot of FM radio to pick up even with the telescopic antenna and one is not far from the 95 MHz, would there be a jamming by these more powerful transmitter?

The adapter works well under Windows 7 USB2 and USB3 apparently, so I do not think of a bad wiring inside the USB cable).

Thank you in advance for your help to make the thing work and continue my experiments.

Peter Marks said...

Bonjour twentyfour-fr,

I've just plugged my dongle in to a Windows computer and it did not come up as a storage device. You may have a more deluxe version. It looks to me like yours might be working. Does the audio file play? Perhaps in your transcoding it didn't pass through and so there's no modulation?

If you have a CRO, or can access one, a good test is to look at the pins - you should see 0-3V there.

Even if there's an FM station near by, a wire from the dongle video pin near your radio should overwhelm it.

Best wishes,


twentyfour-fr said...

Hello CRO ??

Peter Marks said...

CRO stands for Cathode Ray Oscilloscope, although that's a dated term. It plots (typically) voltage against time. Like the Rigol you see above.

The one with no shadow said...

Looking at a dongle's output using fl2k_fm I spotted sideband signals at both sides of the produced carrier at 1.2MHz distance.
It turns out that they occur as power supply noise created by the KB3426 switching mode buck regulators that power both 1.2V and 3.3 V power input lines of the FL2000 chip in several available implementations.
A rather crude mod that includes the removal of the switching mode regulators and their replacement with 2 LM317 (TO220 package) linear regulators cleaned up the mess. And yes I somehow managed to fit them both inside the plastic box, thanks to the miniscule consumption of the chip there are no heat accumulation problems I guess there's a more elegant way to install linear regulators in there, or someone could be blessed with having an implementation that uses linear reg from the start. In any case, if you open your FL2K case and spot coils in the power section (not the L at the RGB output, visibly spotted coils) expect a (rectifiable if you have mastered a soldering iron) dirty signal.

The one with no shadow said...

Also, mind you: Some USB dongles come with an I2C (or SPI - I cannot recall quite which right now) that poses as a USB storage device carrying the driver for the device in windows environments. One probably needs to use USBmodeswitch in order to convince the device to switch between storage and actual VGA mode.