HDMI Input: 4K negotiation loop?

Thought I’d create a separate post so as to not hijack another user’s thread.

I’m having some sort of an issue with getting HDMI 4K input to work with my camera. I have a Fujifilm X-T4, and recording with 1080p works fantastic with the following command that was provided in this post, but with the format changed to NV16 and resolution to 1920x1080.

gst-launch-1.0 -e v4l2src device=/dev/video0 ! video/x-raw,format=NV16,width=1920,height=1080 ! queue ! mpph265enc ! h265parse ! queue ! mpegtsmux ! filesink location="/storage/hdmi4k_$(date +"%Y%m%d_%H%M%S").ts" sync=false

When I try to set the camera to 4K, the hdmirx-controller loops over and over again and the camera follows suit.

[  924.311850] fdee0000.hdmirx-controller: hdmirx_wait_lock_and_get_timing signal not lock, tmds_clk_ratio:0
[  924.311856] fdee0000.hdmirx-controller: hdmirx_wait_lock_and_get_timing mu_st:0x2, scdc_st:0x3, dma_st10:0x20012
[  924.599097] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_audio_interrupts_setup: 1
[  925.514514] fdee0000.hdmirx-controller: Vertical Sync threshold reached interrupt 0x2
[  926.014557] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_delayed_work_audio: enable audio
[  926.014569] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_delayed_work_audio: restart audio fs(44100 -> 192000) ch(0 -> 2)
[  926.014600] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_audio_fifo_init
[  929.250701] fdee0000.hdmirx-controller: hdmirx_wait_lock_and_get_timing signal not lock, tmds_clk_ratio:0
[  929.250707] fdee0000.hdmirx-controller: hdmirx_wait_lock_and_get_timing mu_st:0x2, scdc_st:0x3, dma_st10:0x20016
[  929.515596] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_audio_interrupts_setup: 1
[  929.515614] fdee0000.hdmirx-controller: Vertical Sync threshold reached interrupt 0x2
[  930.041272] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_delayed_work_audio: enable audio
[  930.041286] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_delayed_work_audio: restart audio fs(44100 -> 192000) ch(0 -> 2)
[  930.041312] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_audio_fifo_init
[  934.161004] fdee0000.hdmirx-controller: hdmirx_wait_lock_and_get_timing signal not lock, tmds_clk_ratio:0
[  934.161010] fdee0000.hdmirx-controller: hdmirx_wait_lock_and_get_timing mu_st:0x2, scdc_st:0x3, dma_st10:0x20012
[  934.432338] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_audio_interrupts_setup: 1
[  935.201879] fdee0000.hdmirx-controller: Vertical Sync threshold reached interrupt 0x2
[  935.721354] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_delayed_work_audio: enable audio
[  935.721367] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_delayed_work_audio: restart audio fs(44100 -> 192000) ch(0 -> 2)
[  935.721391] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_audio_fifo_init
root@rock-5b:/home/rock# 

My camera has a function called “HDMI Output Info Display”, which shows the information overlay into the HDMI stream. Disabling that causes the loop to stop, but v4l2-ctl -d /dev/video0 --get-fmt-video shows 1920x1080, which is not correct. The captured video also still has the information overlay… so unfortunately this isn’t ideal. I also tried forcing 4k EDID with the command in this post. It resets the camera, but it is still stuck at 1080 and requires the overlay to be enabled, else it starts looping again. I’m guessing somewhere somehow the negotiation is messing up. I did try hooking the camera to a 4K monitor and had no issues there. I also tried hooking up my Mac as an external display to test the 4K HDMI input, and surely enough the resolution is correct there. Seems like it’s a negotiation issue between this camera and the Rock 5B.

1080@60 - https://youtu.be/PBCmKoEMeYk
4K (technically still 1080, with “output info display” enabled) - https://youtu.be/NkridmofX_I

An amateur here, so any suggestions would be helpful!

I suggest firstly you need to determine what HDMI format is being produced by your camera at 4K ie RGB,YUV444,YUV422,YUV420. You be able to get this from your connect monitor or camera spec, as currently you are guessing the output format.

I can’t seem to find much info regarding HDMI output format, but it does appear that the camera HDMI output supports 4:2:2. My monitor doesn’t really tell me any useful information aside from resolution when it’s plugged in.

However, I think I may know the culprit. Because my camera’s HDMI output is MicroHDMI, and so is the input on the 5B, I’m using this generic adapter from Walmart, that i’m now realizing doesn’t show any specs that it’s rated for. Since it works fine at 1080p, I think this cable is not rated for 4K and that’s why the negotiation keeps failing. I’ve ordered a proper adapter this time and hopefully that’ll do the trick. I will also test the adapter in a bit but it seems likely to be the cause.

Definitely has to be the adapter. Getting the same behavior when setting 4K with my Mac plugged into it. Let’s hope the new adapter that comes tomorrow solves my problem.

It was the adapter all along… hehe user error. My X-T4’s 30min recording limit can now be bypassed, records at 4:2:2 as well, yay! Doesn’t look like I can do DCI 17:9 (4096x2160), but I’ll take what I can get. Not really seeing any frame drops or weird glitches either, so I’m super happy this works well.

Format Video Capture Multiplanar:
	Width/Height      : 3840/2160
	Pixel Format      : 'NV16' (Y/CbCr 4:2:2)
	Field             : None
	Number of planes  : 1
	Flags             : premultiplied-alpha, 0x000000fe
	Colorspace        : Unknown (0x53bfe740)
	Transfer Function : Default
	YCbCr/HSV Encoding: Unknown (0x000000ff)
	Quantization      : Default
	Plane 0           :
	   Bytes per Line : 3840
	   Size Image     : 16588800
1 Like