
Show HN: Open-source, configurable HDMI output for FPGAs - purisame
https://github.com/hdl-util/hdmi
======
anonsivalley652
Neat!

The other day, I was considering how fast/good(/expensive) an ADC would have
to be to capture VGA at say 1600x1200 24-bit @ 70 Hz... around 160 Msps with
~10 bits of resolution on 3 channels at least (RGB; a little lower res for
VSYNC and HSYNC). Octopart parametric search says it would cost ~$40 for ADCs
alone in small quantities (I don't have chip sampling vendor hookups
anymore.). :'( This was going to be for a DIY IP VGA KVM because I was
considering how to not spend $400-2000 on an actual new/used Avocent.

VGA is really easy to generate, most FPGA dev kits have a VGA Pong clone or
VGA demo... so I can see how having HDMI would be awesome to have video and
audio in the 21st century.

~~~
exikyut
The TVP7002 only goes to 60Hz, but it does 1600x1200, is ~$4-$10 from digikey,
and here's someone who figured out how to read from it (at very low FPS, far
lower than it is capable of) with a microcontroller and (as stated) very
little electronics knowledge: [https://www.rpg.fi/desaster/blog/vga-
framegrabbing-with-tvp7...](https://www.rpg.fi/desaster/blog/vga-
framegrabbing-with-tvp7002.html)

------
typon
Your systemverilog is quite readable and well written. Good work on the
library. Always a pleasure to see people using stuff I developed (used to work
on Quartus)

~~~
purisame
Thanks! I was originally writing in Verilog but made the switch after coming
across multidimensional packed arrays, which made the audio implementation
easier.

------
peterburkimsher
Nice! Everything I'd seen before was DVI.

What about HDMI input? What I'm imagining is an HDMI freeze button, to buffer
a single frame. Many projectors have that feature built in, but some don't,
and I wish I could build it as an external hardware device.

~~~
dbcurtis
I would live HDMI input also, but for different reasons. I want to process
video from HDMI streams.

~~~
TD-Linux
You maybe interested in litevideo, used by hdmi2usb.tv.
[https://github.com/enjoy-digital/litevideo](https://github.com/enjoy-
digital/litevideo)

------
jcims
Pixel clocks... haven’t thought about those in a looooong time. When my old
14” packard bell monitor world act up i would bust open x11config and taze it
with a hilariously overdriven clock.

Probably should be illegal.

~~~
myself248
There was just a kerfuffle about the HDMI output on the Raspberry Pi being
able to jam its own wifi at certain specific resolutions. The dot-clock
multiplied by the line encoder landed right in 2.4GHz.

~~~
jcims
It’s kind of a marvel this doesn’t happen more frequently. The transmitter
hack for rpi can jam mobile phones within a short range.

------
nrclark
This is a cool project! Is there any info available on the utilization numbers
for the core? I'm curious how it stacks up against Xilinx's HDMI bloatware.

~~~
purisame
Here's the usage on my Cyclone 10:

    
    
      Info (21057): Implemented 1509 device resources after synthesis - the final resource count might be different
      Info (21058): Implemented 15 input pins
      Info (21059): Implemented 33 output pins
      Info (21060): Implemented 87 bidirectional pins
      Info (21061): Implemented 1240 logic cells
      Info (21064): Implemented 128 RAM segments
      Info (21065): Implemented 2 PLLs
    

I haven't been focusing on resource usage yet, but I think there's big savings
potential in _packet_assembler.sv_ since it's using around 300 cells just for
parity computation.

~~~
purisame
The HDMI entity itself is using less. Here's the resource utilization report
by entity from Quartus:
[https://gist.github.com/sameer/b04f798f3e9f574853ed55aae7b21...](https://gist.github.com/sameer/b04f798f3e9f574853ed55aae7b2185b)

------
cmrdporcupine
Thanks for this. You should look into getting this into the fusesoc
repository, if possible.

[https://github.com/olofk/fusesoc](https://github.com/olofk/fusesoc)

~~~
purisame
Sounds like a good idea, I'll look into it.

------
gitgud
> Dual-licensed under Apache License 2.0 and MIT License.

How does this work? Isn't the Apache license _somewhat_ more restrictive than
the MIT license? Why bother with both?

~~~
purisame
The primary license is Apache, but the user may license under MIT for GPLv2
compatibility.

I've been writing a lot of Rust lately, and started providing both after their
big relicensing push: [https://github.com/diesel-
rs/diesel/issues/82](https://github.com/diesel-rs/diesel/issues/82)

------
MatthewWilkes
Isn't the reason they use DVI that it helps avoid the HDMI licencing costs?
Not the FPGA implementation, but the adopter licence fee.

~~~
purisame
From what I've read, you are supposed to become an "HDMI Adopter" to legally
sell products that use HDMI. There's a flat annual fee plus a per device
royalty fee. Not sure how well enforced it is, since there are over 1,000
terminated adopters:
[https://hdmi.org/adopter/terminated](https://hdmi.org/adopter/terminated). I
wouldn't be surprised if some of their products are still on Amazon and other
places.

The FPGA I'm using has HDMI and was made by Arduino, but they are not an HDMI
Adopter: [https://store.arduino.cc/usa/mkr-
vidor-4000](https://store.arduino.cc/usa/mkr-vidor-4000). "Raspberry Pi
Trading Ltd" is one though.

There's a parameter to make the output be DVI only if it's a concern, I'll
make a note of this in the README.

~~~
MatthewWilkes
I know some small projects are having a lot of trouble with this, because
using only modules from fully paid-up adopter doesn't exempt you if you ship
an end-user product that uses HDMI.

For example, the F18Amk2 project at
[https://atariage.com/forums/topic/280138-f18a-mk2/](https://atariage.com/forums/topic/280138-f18a-mk2/)
which is implementing a TMS9918A has hit this problem.

I am inclined to agree that enforcement isn't 100%, but wanted to flag this up
as it's relevant to your users. Thanks for adding the note!

------
peter_d_sherman
Brilliant!

~~~
peter_d_sherman
I really do have great appreciation for this; why the downvote?

?

