VGA/HDMI output over USB (using Fresco Logic 2000 adapter)

jmarsh

Well-known member
I have just finished committing support for Fresco Logic 2000 USB video adapters to my teensy4_usbhost library.
These adapters are all over ebay for very cheap prices, they're actually designed to be used in USB3 ports but also work over USB2 for resolutions up to 800x600 (or potentially higher - the only limit is the USB bandwidth). They're also used by the osmo-fl2k project to generate all sorts of radio signals - there's some physical examples of the adapters on that site. They come in two different types: VGA or HDMI output, this code can handle both although it only drives the HDMI output in DVI-compatible mode. Sadly there is no way to send audio over the HDMI output - unless maybe I can get hold of an adapter like this which I'm guessing is actually a USB hub with both the FL2000 and a USB audio codec, with its I2S output connected to the HDMI encoder. But they seem pretty rare and they're not dirt cheap like the plain video adapters are.

There's some basic examples included in the repo, for example a mandelbrot fractal using RGB565 color @ 512x480@60Hz:
mandelbrot.jpg


And a circle-based spectrogram, using 8-bit indexed color @ 800x600x56Hz:
circle.jpg

(it looks a lot better when it's animated...)

I have plans to enable "lightweight" scrolling, where the framebuffer address is aligned to a power-of-2 boundary and scrolling is done just by changing the start offset. So that will likely be the next example added to the repo...

Some of the code is still very "raw" but it does at least handle both the USB adapter and the connected monitor being hotplugged. If you want audio to work at the same time as the video output you probably want to read my Issues with DMAChannels thread to see the work being put towards enabling DMA channel preemption.

There's also a driver for XBOX360 compatible gamepads in the repository, which can lead to some fun stuff:
mario.jpg
 
So something fun I learned today... the SMOD setting on DMA channels only applies to the SADDR+SOFF calculation, it doesn't get applied to SADDR+minor loop offset or SADDR+SLAST. Presumably the same applies to DMOD.
 
Added support for circular framebuffers and a "piano roll" demo:
piano.jpg

This scrolls upwards, writing only the bottom line of the framebuffer on each new frame. The colored bars are active MIDI notes coming from the PC with each channel being individual colors (highest velocity gets priority). Resolution is 640x200 using a 128KB circular buffer - each frame moves the top-left of the framebuffer forward by 640 bytes within the 128KB window, DMA automatically takes care of the wrapping. The only catch is the framebuffer has to a) be a power-of-2 size and b) be aligned to a matching boundary. So a 128KB buffer has to be 128KB aligned, 256KB buffer must be 256KB aligned...
 
If that was an RF spectrum it would be called a waterfall display, but piano-roll is more appropriate for MIDI!
 
There is a waterfall example like that in the repo (based on incoming USB audio) but I modified it to scroll horizontally since there's more pixels in that direction... didn't mention it here because it proved difficult to get a decent photo of.
 
Back
Top