tiny-pilot / tinypilot

Use your Raspberry Pi as a browser-based KVM.
https://tinypilotkvm.com
MIT License
3k stars 250 forks source link

HDMI Bridge based on chip TC358743XBG #114

Closed Bramzor closed 4 years ago

Bramzor commented 4 years ago

I assume your project might also work together with an HDMI Bridge to CSI-2 (Raspberry Pi camera port) based on the popular TC358743XBG chip as HDMI IN? https://auvidea.eu/b101-hdmi-to-csi-2-bridge-15-pin-fpc/ Or the B102 in my case (Raspberry Pi zero 22 pin port)

Ordered one of these and will be able to test it in a few days. Only problem might be the increased resolution which might slow it down even more when combined with a raspberry pi zero. But maybe there is a way to lower the resolution or lower FPS.

mtlynch commented 4 years ago

It should work, though you'll need to add/replace some of the ustreamer settings to:

ustreamer_format: uyvy
ustreamer_encoder: omx
ustreamer_use_dv_timings: true
somik123 commented 4 years ago

@Bramzor do let us know as I'm also interested in this.

Bramzor commented 4 years ago

Does not seem to work. /opt/ustreamer/ustreamer --persistent --dv-timings --format=uyvy --encoder=omx --workers=1 --quality=80 --desired-fps=30 --drop-same-frames=30 --last-as-blank=0 Unknown encoder type: omx; available: CPU, HW

Running it without the encoder line gives me:

/opt/ustreamer/ustreamer --persistent --dv-timings --format=uyvy --workers=1 --quality=80 --desired-fps=30 --drop-same-frames=30 --last-as-blank=0 -- INFO [772.123 main] -- Installing SIGINT handler ... -- INFO [772.124 main] -- Installing SIGTERM handler ... -- INFO [772.124 main] -- Ignoring SIGPIPE ... -- INFO [772.124 main] -- Using internal blank placeholder -- INFO [772.125 main] -- Listening HTTP on [127.0.0.1]:8080 -- INFO [772.125 stream] -- Using V4L2 device: /dev/video0 -- INFO [772.125 stream] -- Using desired FPS: 30

-- INFO [772.125 stream] -- Device fd=8 opened -- INFO [772.125 http] -- Starting HTTP eventloop ... -- INFO [772.125 stream] -- Using input channel: 0 -- INFO [772.126 stream] -- Using TV standard: DEFAULT -- ERROR [772.126 stream] -- Can't subscribe to V4L2_EVENT_SOURCE_CHANGE: Invalid argument -- INFO [772.126 stream] -- Device fd=8 closed

mtlynch commented 4 years ago

Oh, looks like I need to fix something to make it recompile with the WITH_OMX=1 option. See:

https://github.com/pikvm/ustreamer#building

Once it's properly built, this should work:

/opt/ustreamer/ustreamer \
    --format=uyvy \ # Device input format
    --encoder=omx \ # Hardware encoding with OpenMAX
    --workers=3 \ # Maximum workers for OpenMAX
    --persistent \ # Don't re-initialize device on timeout (for example when HDMI cable was disconnected)
    --dv-timings \ # Use DV-timings
    --drop-same-frames=30 # Save the traffic
stratus-ss commented 4 years ago

I tried to make ustreamer with the following make WITH_OMX=1 -j3 but when I try to run ustreamer with either the arguments from @mtlynch or @Bramzor I get the following:

ustreamer@raspberrypi:/home/pi$ /opt/ustreamer/ustreamer --format=uyvy --encoder=omx --workers=3 --persistent --dv-timings --drop-same-frames=30
-- INFO  [116.997      main] -- Installing SIGINT handler ...
-- INFO  [116.997      main] -- Installing SIGTERM handler ...
-- INFO  [116.997      main] -- Ignoring SIGPIPE ...
-- INFO  [116.997      main] -- Using internal blank placeholder
-- INFO  [116.997      main] -- Listening HTTP on [127.0.0.1]:8080
-- INFO  [116.998    stream] -- Using V4L2 device: /dev/video0
-- INFO  [116.998    stream] -- Using desired FPS: 0
================================================================================
-- INFO  [116.998    stream] -- Device fd=8 opened
-- INFO  [116.998      http] -- Starting HTTP eventloop ...
-- INFO  [116.998    stream] -- Using input channel: 0
-- INFO  [116.998    stream] -- Using TV standard: DEFAULT
-- ERROR [116.998    stream] -- Can't subscribe to V4L2_EVENT_SOURCE_CHANGE: Invalid argument
-- INFO  [116.998    stream] -- Device fd=8 closed
-- INFO  [116.998    stream] -- Sleeping 1 seconds before new stream init ...
mtlynch commented 4 years ago

@stratus-ss - you seem to be hitting a ustreamer bug:

https://github.com/pikvm/ustreamer/issues/38

stratus-ss commented 4 years ago

thanks for the quick reply!

somik123 commented 4 years ago

any fix for it?

mtlynch commented 4 years ago

I added instructions for configuring a HDMI to CSI capture chip here:

https://github.com/mtlynch/tinypilot/wiki/Installation-Options#example-csi-to-hdmi-capture-chip

It looks like one particular chip might be having issues, but that would be a bug in the driver not TinyPilot.