Giter VIP home page Giter VIP logo

hdmi2usb-litex-firmware-old's Introduction

HDMI2USB MiSoC Firmware

Quick Links

Table of contents

  • Overview
  • HDMI2USB MiSoC Firmware
    • Supported Boards
    • In Progress Boards
    • Other Boards
  • Getting started
  • Documentation
  • License
  • Contact

Overview

The HDMI2USB project develops affordable hardware options to record and stream HD videos (from HDMI & DisplayPort sources) for conferences, meetings and user groups.

We are currently developing our own hardware (the Numato Opsis, and also provide firmware for various prototyping boards.

HDMI2USB started in 2013, and is an active ongoing project in its third iteration of hardware prototyping. Today you can download early working firmware and have real capture happen, but we actively wish to improve and are seeking assistance:

  • For video recording individuals+teams: Be an early adopter; get a board, start using it, report back to us with feedback

  • For software/FPGA developers: Get involved in contributing code both to the capture software + FPGA stack

Our aim is this becomes the defacto, incredibly affordable and easy to use video recording hardware for conferences, meetings and user groups worldwide.

Find out more about HDMI2USB and why we're doing this in ABOUT + FAQ

HDMI2USB Diagram

HDMI2USB MiSoC Firmware

Supported Boards

This firmware is supported on the following to boards for capturing conferences;

For a comparison between the supported boards, see the HDMI2USB Hardware page.

In Progress Boards

The following boards are under development for conference capture;

  • Digilent Nexys Video
  • Alphamax NeTV2

Other Boards

The following boards are useful for development but not conference capture;

  • Saanlima Pipistrello - http://pipistrello.saanlima.com/

    PLATFORM=pipistrello

    A small FPGA board with only one HDMI output port. Due to the lack of video inputs, this board is only useful for developers.

  • ScarabHardware miniSpartan6+ - https://www.scarabhardware.com/minispartan6/

    PLATFORM=miniSpartan

    A small FPGA board with HDMI input and HDMI output. Due to the low speed ram and USB interface, this board is only useful for developers who want to work on the HDMI subsystem and need a small board that fits in their pocket.

  • Numato MimasV2 - https://numato.com/mimas-v2-spartan-6-fpga-development-board-with-ddr-sdram/

    PLATFORM=mimasv2

    A small, cheap FPGA board with a Spartan 6 and DDR RAM. Due to the lack of video input and high speed data interfaces this board can't be used for capture. It can however be used for development of non-capture related firmware features and experimenting with FPGA development.

Getting started

For using a HDMI2USB board, prebuilt versions of the firmware are available in the HDMI2USB-firmware-prebuilt repository.

For helping with the development, instructions for setting up the build environment are found in the getting-started.md file.

Documentation

User documentation is found on the HDMI2USB website.

High level developer documentation for the firmware can be found in the doc directory. More documentation is found in the source code.

System Diagram

License

This code was developed by the people found in the AUTHORS file (including major contributions from EnjoyDigital) and released under a BSD/MIT license.

Code under the third_party directory comes from external sources and is available in their own licenses.

Contact

TimVideo.us:

EnjoyDigital:

hdmi2usb-litex-firmware-old's People

Contributors

carlfk avatar cr1901 avatar deeprave avatar enjoy-digital avatar fallen avatar joeladdison avatar katharosada avatar micolous avatar mithro avatar rohitk-singh avatar sealne avatar shenki avatar ssk1328 avatar stefanor avatar vikram9866 avatar xfxf avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hdmi2usb-litex-firmware-old's Issues

Screen output flickering but no underflow output....

The screen output of the following version was flickering, but no underflow on the output.

RUNTIME>version

hardware version info
===============================================
           DNA: 0136ebbbb16f64b3
           MAC: d8:80:39:67:98:3c

gateware version info
===============================================
      platform: opsis
        target: HDMI2USB
      revision: cfdf618ea626298f11c517d8bbc6b9712393088b

firmware version info
===============================================
      platform: opsis
        target: hdmi2usb
    git commit: e3deab5cd1cfa7426adeb62a4ab1726c88f4615a
    git branch: nextgen
  git describe: v0.0.0-243-ge3deab5-dirty
    git status:
    --
     M ../../../../firmware/version.c
    --

         built: Jan 14 2017 16:40:07
        uptime: uptime 00:01:17
-----------------------------------------------

Rework underflow stuff so it is part of hdmi_out modules and notifies even when status not showing...

		hdmi_out0_core_underflow_enable_write(1);
		hdmi_out0_core_underflow_update_write(1);
		underflows = hdmi_out0_core_underflow_counter_read();
		wprintf(
			"%dx%d@" REFRESH_RATE_PRINTF "Hz %s (uf:%d), ",
			processor_h_active,
			processor_v_active,
			REFRESH_RATE_PRINTF_ARGS(processor_refresh),
			processor_get_source_name(processor_hdmi_out0_source),
			underflows);
		hdmi_out0_core_underflow_enable_write(0);
		hdmi_out0_core_underflow_enable_write(1);

Reuse the PRINTF thingy that Joel added

3d19e65e8df7deb44b0b31b100730a61acf9d363

 #ifdef CSR_HDMI_IN0_FREQ_BASE
-	wprintf(" (@ %d kHz)", hdmi_in0_freq_value_read() / 1000);
+	wprintf(" (@ %3d.%2d MHz)", hdmi_in0_freq_value_read() / 1000000,
+		                        (hdmi_in0_freq_value_read() / 10000) % 100);
 #endif
 	wprintf("\r\n");
 #endif

Fix all the printf not using wprintf

Use grep '[^ wvs(]printf' * and grep '[^ w]puts' *

The only places printf should be used directly is;

  • ether*.{c,h}
  • telnet.{c,h}
  • stdio_wrap.h
  • main.c before Ethernet is initialized
(H2U P=opsis T=video R=nextgen) tansell@tansell-x1c:~/foss/timvideos/lite/opsis-soc/firmware$ grep '[^ wvs(]printf' *
ci.c:				printf("%X\r\n", (int)cas_switches_in_read());
encoder.c:			printf("Unsupported encoder quality (50, 75, 85 or 100)\r\n");
etherbone.c:	printf("Etherbone listening on port %d\n", ETHERBONE_PORT);
ethernet.c:	printf("uIP init done with ip %d.%d.%d.%d\n", ip_addr[0], ip_addr[1], ip_addr[2], ip_addr[3]);
fx2.c:		printf("fx2: Read from invalid address %02X (end: %02X)\r\n", addr, end_addr);
fx2.c:	printf("fx2: Waiting for FX2 to load firmware.\r\n");
fx2.c:			printf("fx2: Waiting at %02X (end: %02X)\r\n", next_read_addr, end_addr);
fx2.c:		printf("fx2: Timeout loading!\r\n");
fx2.c:		printf("fx2: Booted.\r\n");
fx2.c:			printf("fx2: read %02X (end: %02X)\r\n", next_read_addr, end_addr);
fx2.c:			printf("fx2: Finished loading firmware.\r\n");
fx2.c:		printf("fx2: Bad status %02X\r\n", status);
fx2.c:	printf("fx2: Turning off.\r\n");
fx2.c:	printf("fx2: Turning on.\r\n");
fx2.c:	printf("Possible FX2 Firmware:\r\n");
fx2.c:	printf(" [%s] usbjtag (%02X) (IXO USB JTAG Mode)\r\n", fx2_fw_active == FX2FW_USBJTAG ? "*" : " ", FX2_MBFW_USBJTAG_END);
fx2.c:	printf(" [%s] hdmi2usb (%02X) (HDMI2USB Video Capture Mode)\r\n", fx2_fw_active == FX2FW_HDMI2USB ? "*" : " ", FX2_MBFW_HDMI2USB_END);
hdmi_in0.c:		printf("dvisampler0: slot0: stray DMA\r\n");
hdmi_in0.c:		printf("dvisampler0: slot1: stray DMA\r\n");
hdmi_in0.c:			printf("dvisampler0: slot0: unexpected frame length: %d\r\n", length);
hdmi_in0.c:			printf("dvisampler0: slot1: unexpected frame length: %d\r\n", length);
hdmi_in0.c:	printf("dvisampler0: ph:%4d %4d %4d // charsync:%d%d%d [%d %d %d] // WER:%3d %3d %3d // chansync:%d // res:%dx%d\r\n",
hdmi_in0.c:			printf("dvisampler0: IDELAY busy timeout\r\n");
hdmi_in0.c:			printf("dvisampler0: delays calibrated\r\n");
hdmi_in0.c:				printf("dvisampler0: phase init OK\r\n");
hdmi_in0.c:			printf("dvisampler0: phase init failed\r\n");
hdmi_in0.c:				printf("dvisampler0: giving up\r\n");
hdmi_in0.c:		printf("dvisampler0: FIFO overflow\r\n");
hdmi_in0.c:				printf("dvisampler0: disconnected\r\n");
hdmi_in0.c:						printf("dvisampler0: lost PLL lock\r\n");
hdmi_in0.c:						printf("dvisampler0: PLL locked\r\n");
hdmi_in0.c:				printf("dvisampler0: connected\r\n");
hdmi_in1.c:		printf("dvisampler1: slot0: stray DMA\r\n");
hdmi_in1.c:		printf("dvisampler1: slot1: stray DMA\r\n");
hdmi_in1.c:			printf("dvisampler1: slot0: unexpected frame length: %d\r\n", length);
hdmi_in1.c:			printf("dvisampler1: slot1: unexpected frame length: %d\r\n", length);
hdmi_in1.c:	printf("dvisampler1: ph:%4d %4d %4d // charsync:%d%d%d [%d %d %d] // WER:%3d %3d %3d // chansync:%d // res:%dx%d\r\n",
hdmi_in1.c:			printf("dvisampler1: IDELAY busy timeout\r\n");
hdmi_in1.c:			printf("dvisampler1: delays calibrated\r\n");
hdmi_in1.c:				printf("dvisampler1: phase init OK\r\n");
hdmi_in1.c:			printf("dvisampler1: phase init failed\r\n");
hdmi_in1.c:				printf("dvisampler1: giving up\r\n");
hdmi_in1.c:		printf("dvisampler1: FIFO overflow\r\n");
hdmi_in1.c:				printf("dvisampler1: disconnected\r\n");
hdmi_in1.c:						printf("dvisampler1: lost PLL lock\r\n");
hdmi_in1.c:						printf("dvisampler1: PLL locked\r\n");
hdmi_in1.c:				printf("dvisampler1: connected\r\n");
grep: libuip: Is a directory
pll.c:		printf("Frequency too low for PLLs\r\n");
pll.c:		printf("Frequency too high for PLLs\r\n");
pll.c:	printf("framebuffer PLL:\r\n");
pll.c:		printf("%04x ", hdmi_out0_driver_clocking_pll_dat_r_read());
pll.c:	printf("\r\n");
pll.c:	printf("dvisampler0 PLL:\r\n");
pll.c:		printf("%04x ", hdmi_in0_clocking_pll_dat_r_read());
pll.c:	printf("\r\n");
pll.c:	printf("dvisampler1 PLL:\r\n");
pll.c:		printf("%04x ", hdmi_in1_clocking_pll_dat_r_read());
pll.c:	printf("\r\n");
grep: __pycache__: Is a directory
telnet.c:	printf("Telnet listening on port %d\n", TELNET_PORT);
telnet.c:			printf("\nTelnet connected.\n");
telnet.c:			printf("\nTelnet disconnected.\n");
telnet.c:int telnet_printf(const char *fmt, ...)
telnet.c:	len = vscnprintf(outbuf, sizeof(outbuf), fmt, args);
telnet.h:int telnet_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
grep: uip: Is a directory
(H2U P=opsis T=video R=nextgen) tansell@tansell-x1c:~/foss/timvideos/lite/opsis-soc/firmware$

Random thoughts on `status short`

  • Lets print the raw values rather than converting to MHZ and such..
  • Maybe we should do json or csv or some other easily parsable rather than human readable?
  • Can you add the debug into from "debug input0 on" and "debug input1 on" into the data.
  • Maybe the lines should be "input0:", "input1:", "output:", "encoder:"...

Refactor custom video mode to allow testing

The custom video mode needs to be tested outside the firmware. The code relating to it should be refactored to allow this testing to happen, followed by tests being written and integrated into the build system.

underflows on first re-enable of output?

H2U 00:12:18>output0 off
Disabling output0
H2U 00:12:22>status
input0:  0x0 (@0.00 MHz)
input1:  1280x720 (@74.25 MHz)
output0: off
output1: [email protected] from input1 (underflows: 0)
EDID primary mode:   [email protected]
EDID secondary mode: [email protected]
encoder: 1280x720 @ 29fps from input1 (q: 85)
ddr: read: 1259Mbps write:  753Mbps all: 2012Mbps
H2U 00:12:24>output0 on
Enabling output0
H2U 00:12:29>status 
input0:  0x0 (@0.00 MHz)
input1:  1280x720 (@74.25 MHz)
output0: [email protected] from input1 (underflows: 523311571)
output1: [email protected] from input1 (underflows: 0)
EDID primary mode:   [email protected]
EDID secondary mode: [email protected]
encoder: 1280x720 @ 30fps from input1 (q: 85)
ddr: read: 1998Mbps write:  752Mbps all: 2750Mbps
H2U 00:12:35>status
input0:  0x0 (@0.00 MHz)
input1:  1280x720 (@74.25 MHz)
output0: [email protected] from input1 (underflows: 0)
output1: [email protected] from input1 (underflows: 0)
EDID primary mode:   [email protected]
EDID secondary mode: [email protected]
encoder: 1280x720 @ 30fps from input1 (q: 85)
ddr: read: 1996Mbps write:  752Mbps all: 2748Mbps
H2U 00:12:40>

Add EDID decode to firmware

Detect EDID of device connected to it, then decode this and display.

Possible extensions are to choose a video mode from the list and apply it to the opsis.

Macbook Pro HDMI out requires 'inputX on' to work

Observed repeatedly during LCA.

Macbook Pro (at least my 2013 Retina but observed over a ton of different models) HDMI port doesn't work until 'input1 on' (if using input1) is typed in. Unplug laptop, plug back in, same issue.

Works perfectly without this using mDP adapter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.