HFT On HF, You Can’t Beat It For Latency

If you are a radio enthusiast of A Certain Age, you may well go misty-eyed from time to time with memories of shortwave listening in decades past. Countries across the world operated their own propaganda radio stations, and you could hear Radio Moscow’s take on world events, the BBC World Service responding, and Radio Tirana proudly announcing that every Albanian village now had a telephone. Many of those shortwave broadcast stations are now long gone, but if you imagine the HF spectrum is dead, think again. An unexpected find in an industrial park near Chicago led to an interesting look at the world of high-frequency trading, or HFT, and how they have moved to using shortwave links when everyone else has abandoned them, because of the unparalleled low latency they offer when communicating across the world.

Our intrepid tower-hunter is [KE9YQ], who was out cycling and noticed a particularly unusual structure adorned with a set of HF beams. These are the large directional antennas of the type you might otherwise expect to see on the roof of an embassy or in the backyard of a well-heeled radio amateur, and were particularly unusual in this otherwise unexciting part of America. There followed an interesting process of tracking down the site’s owners via the FCC permits for its operation, leading to the deduction of its purpose. With other antenna-hunters on the lookout for corresponding sites elsewhere in the world, it seems that this unusual global network hiding in plain sight could soon be revealed.

Unsurprisingly we’ve not covered many shortwave HFT stories. There are however other higher-latency ways to cross the world on HF.

Via SWLing Post, and thanks [W6MOQ] for the tip.

Video Streaming Like Your Raspberry Pi Depended On It

The Raspberry Pi is an incredibly versatile computing platform, particularly when it comes to embedded applications. They’re used in all kinds of security and monitoring projects to take still shots over time, or record video footage for later review. It’s remarkably easy to do, and there’s a wide variety of tools available to get the job done.

However, if you need live video with as little latency as possible, things get more difficult. I was building a remotely controlled vehicle that uses the cellular data network for communication. Minimizing latency was key to making the vehicle easy to drive. Thus I set sail for the nearest search engine and begun researching my problem.

My first approach to the challenge was the venerable VLC Media Player. Initial experiments were sadly fraught with issues. Getting the software to recognize the webcam plugged into my Pi Zero took forever, and when I did get eventually get the stream up and running, it was far too laggy to be useful. Streaming over WiFi and waving my hands in front of the camera showed I had a delay of at least two or three seconds. While I could have possibly optimized it further, I decided to move on and try to find something a little more lightweight.

Continue reading “Video Streaming Like Your Raspberry Pi Depended On It”

Fixing Arduino’s serial latency issues

arduino_latency

[Paul] wrote in to tell us about some interesting Arduino latency issues he helped nail down and fix on the Arduino.

It seems that [Michu] was having some problems with controlling his Rainbowduino project we featured earlier this year, and he couldn’t quite figure out why he was experiencing such huge delays when sending and receiving data.

Searching online for answers turned up very little, and since [Michu] was using Processing, the pair designed a set of tests to see what kind of latency was being introduced by Java. Pitting an Arduino Uno and an Arduino from 2009 against a Teensy 2.0, the tests gauged the latency of native data transfers versus transfers facilitated by Java via the rxtx library it uses for serial communications.

The results were pretty stunning. While both of the Arduinos lagged behind the Teensy by a long shot, their latency values under Java were always 20ms at a minimum – something didn’t add up. [Michu] poked around in the rxtx code and found a mystery 20ms delay programmed into the serial library. It made no sense to him, so he changed the delay to 2ms and saw a drastic increase in performance when transferring less than 128 bytes of data.

The pair’s fix doesn’t seem to affect latency when larger amounts of data (>1kB) are being transferred, but it makes a world of difference when manipulating smaller chunks of data.

For the sake of disclosure, it should be noted that [Paul’s] company produces the Teensy mcu.