HyperHDR and TC358743 HDMI to CSI-2 using Geekworm X1301 #1440
Martin-Pfingstl
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This is my setup of a Geekworm X1301 board (equipped with a TC358743 chip, HDMI-In, HDMI-Out and HDMI to CSI-2-converter) with a Raspberry Pi 4B (2GB Ram) and HyperHDR for Ambilight.
It's working great and stable in my setup, and as I had some difficulties in finding out some parts I thought I'd like to share my knowledge.
My base setup is as follows: An AV-Receiver with several HDMI-Inputs is the core component: Various HDMI signals are being routed to the AV receiver which is responsible for high quality audio playback. The HDMI-Output is routed to a TV for video playback. The TV should be equipped with Ambilight.
In order to achieve this I bought an HDMI splitter and an USB video grabber, placed it between HDMI-Out of AV receiver and TV, USB Video grabber into raspberry pi.
That was my initial setup working fine. Except all these connectors were quite unstable: A small touch and the signal was lost for a few seconds, sometimes randomly while watching TV (very annoying). So I started with an already working system.
Two weeks ago I read about that HDMI to CSI-2 possibility and decided to give it a try. As the X1301 has a splitter and a converter it seemed to be a mechanically more stable solution: No separate components, a single hat for the raspberry pi and that's it.
Now, what steps were necessary to make it work:
Base information: https://forums.raspberrypi.com/viewtopic.php?t=281972&sid=26dc584745ea89a85bdab1a65fcd1912
My Raspberry Pi 4 has Raspberry Pi OS (64 bit) installed (latest version).
dtoverlay=tc358743cma=256mReboot using
sudo rebootand check whetherdmesg | grep cmaaccepted the 256m request.On my system it outputs a line as follows:
[ 0.005300] Memory: 1601252K/2018304K available (14336K kernel code, 2418K rwdata, 4832K rodata, 2048K init, 577K bss, 149508K reserved, 262144K cma-reserved)So I have 2 GB ram, 1.6GB free, and 262144K=256m cma-reserved. Ok. Fine.
1080P50EDID.txt
This is the one-time setup, the following steps need to be repeated each time the pi starts up and each time the HDMI signal changes (how to do this automatically I'll cover later in this topic). That was one of my main failures: Rebooting and redoing all these commands again and again in correct order!
v4l2-ctl --set-edid=file=/home/pi/1080P50EDID.txtEnsure you have a HDMI signal fed into the X1301 board and the HDMI out is connected to your TV. The board indicates a valid signal using two green LEDs.
Ensure HyperHDR is switched off, otherwise it blocks the v4l2. Execute the following command in case you are interested in which resolution the HDMI input is:
v4l2-ctl --query-dv-timingsv4l2-ctl --set-dv-bt-timings queryNow the board should display 3 green LEDs: HDMI-In, HDMI-Out and "Video Ready" (i.e. video on CSI-2 ready).
v4l2-ctl -v pixelformat=UYVYAnd that was it: Now switch on HyperHDR. Video Capturing/USB Capture/Device contains an item labelled "unicam-image (video0)", That's our video. Now configure HyperHDR as you like.
As written before: Anytime you restart your pi and/or you change the HDMI signal you need to reconfigure it. Fortunately the v4l2-ctl-command has an option "--wait-for-event=<event_type>", which returns only after the corresponding event has occurred. And HyperHDR has a JSON interface which allows us to disable/enable it. Altogether this means: We can write a simple bash-script to monitor the HDMI input source and automatically set the timings. See attachment
videograb.sh
. I've put it into crontab of user pi as follows:
@reboot sleep 12 && /home/pi/videograb.sh >> /home/pi/videograb.log 2>&1Limitations:
All reactions