timvideos / HDMI2USB-litex-firmware

A version of the HDMI2USB firmware based around LiteX tools produced by @Enjoy-Digital (based on misoc+migen created by @M-Labs)
https://hdmi2usb.tv
BSD 2-Clause "Simplified" License
145 stars 71 forks source link

input lables change 0,1 base #483

Open CarlFK opened 4 years ago

CarlFK commented 4 years ago

Some parts of the UI reference the first input port as input0, some input1. I suspect this is related to adding source VIDEO_IN_PCIE

If we agree that everything is 0 based, then commands do what we want, but the input status messages are off by one. (the output messages are not.)

H2U 22:59:12>video_matrix connect input1 output1
Connecting input2 to output1

H2U 22:57:59>video_matrix connect input0 encoder 
Connecting input1 to encoder

H2U 22:58:13>status 
input0:  0x0 (@4.28 MHz) (disabled)
input1:  0x0 (@0.00 MHz) (capturing)
output0: 1280x720@50.00Hz from input2 (underflows: 0)
output1: 1280x720@50.00zput2 (underflos primary mode:   1280x720@50.00Hz
EDID secondary mode: 1280x720@60.00Hz
encoder: 1280x720 @ 25fps from input1 (q: 85)

status calls: https://github.com/timvideos/HDMI2USB-litex-firmware/blob/c27ca257f49e580183222aa2b10623ae6c544553/firmware/ci.c#L453

which calls: https://github.com/timvideos/HDMI2USB-litex-firmware/blob/c27ca257f49e580183222aa2b10623ae6c544553/firmware/processor.c#L707

micolous commented 4 years ago

It looks like this was a regression introduced in 971d1cb48212cfce16e2db7fb86eff82e1c94e4a, because it changed pattern from "source 2" to "source 0".

Some of our case designs for Opsis call the onboard inputs "1" and "2", but the "internal" naming has always been "0" and "1". We should retain this, and always call it "0" and "1".