Jump to content

HDMI in ADV7611 (oPi zero +2 H5)


Recommended Posts

Posted (edited)

Hello.
I want to do HDMI-in to CSI with ADV7611. But have problems with DT overlay. I'm a newbie.

I can build img with activated module adv7611 in menuconfig. And apply "armbian-add-overlay adv7611.dts".
But /dev/video device did not appear.
Can someone suggest in the H5 device tree?

I found the AnalogDevice forum, where it says that need to use a bridge. As I understood this bridge is implemented as camera@1cb0000 ?

https://ez.analog.com

 

Thanks!

 

Board: OrangePi zero plus2 H5
Linux 4.19.21-sunxi64 #5.76
armbianmonitor -u : http://ix.io/1ydH

 

scheme:

https://drive.google.com/file/d/1eT7e76SpUhAEcup6RZTLhV4o1UbJKGvd/view?usp=sharing

 

dmesg | grep -C3 adv7611:

[    7.675676] OF: /thermal-zones/cpu-thermal: arguments longer than property
[    7.675690] thermal thermal_zone2: failed to read out thermal zone (-110)
[    7.718236] videodev: Linux video capture interface: v2.00
[    7.871221] adv7611 1-004c: Error -6 reading IO Regmap
[    7.904420] asoc-simple-card soc:sound: i2s-hifi <-> 1c22800.i2s mapping ok
[    8.465050] Adding 61620k swap on /dev/zram1.  Priority:5 extents:1 across:61620k SSFS
[    8.467709] zram2: detected capacity change from 0 to 63102976

 

my adv7611.dts overlay:

  Reveal hidden contents

 

 

full "dtc -I fs" log:

  Reveal hidden contents

 

Edited by yogggoy
broken AD link
Posted

Well, I found the HW problem on the board and after fix dmesg | grep adv7611 looks like this:

[    7.795241] media: Linux media interface: v0.10
[    7.879137] asoc-simple-card soc:sound: i2s-hifi <-> 1c22800.i2s mapping ok
[    7.887178] videodev: Linux video capture interface: v2.00
[    8.040638] adv7611 2-004c: adv7611 found @ 0x98 (mv64xxx_i2c adapter)
[    8.599735] Adding 61620k swap on /dev/zram1.  Priority:5 extents:1 across:61620k SSFS
[    8.606285] zram2: detected capacity change from 0 to 63102976
[    8.737312] thermal thermal_zone0: failed to read out thermal zone (-110)

But, as I understand it, this kernel module only works with i2c, but not with CSI.
I don't see any video devices in /dev, and v4l2-ctl -l says that it cannot find /dev /video0.

I missed something in DT, but what?


ps, my HW errors:
bad schematic for ocsil_clk 28.636. GND instead VCC. XTAL_P must be 1v8
I forgot about reset pin, fastfix - just plug 3v3. The correct solution is to use reset-gpios and hpd-gpios

Posted

February 15

Hello.
I want to do HDMI-in to CSI with ADV7611. But have problems with DT overlay. I'm a newbie.

I can build img with activated module adv7611 in menuconfig. And apply "armbian-add-overlay adv7611.dts".
But /dev/video device did not appear.
Can someone suggest in the H5

Posted

I am not a detective but I think @de24b27b0e - spamBot(copy-paste).

By the way, I did not find a thread on the forum where I can report violations.

Posted

I'm also working on the ADV7611 and I'm stuck too.

I think you need to rework the devicetree. This is my devicetree for the ADV7611:

 

&csi1 {
	status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&csi1_clk &csi1_16bit>;

port {
	
	
	csi1_ep: endpoint {
	
		remote-endpoint = <&hdmi_in>;
		bus-width = <16>;
	   
	   };
	};
 };

&i2c1 {
    	pinctrl-0 = <&i2c1_pins>;
		pinctrl-names = "default";
		status = "okay";

	hdmi_receiver@4c {
		compatible = "adi,adv7611";
		reg = <0x4c>;
		
		#address-cells = <1>;
		#size-cells = <0>;

		port@0 {
			reg = <0>;
		};
		port@1 {
			reg = <1>;
			hdmi_in: endpoint {
				remote-endpoint = <&csi1_ep>;
				bus-width = <16>;
			};
		};
	};
	
	
	
};

And it seems like your devicetree was decompiled at some point. It would be way better to work with the "real" source devicetree.

How recent is your kernel? It maybe lacks support for the CSI / DVP.

 

 

 

 

 

Posted

I added a description of reset and hot-plug_dtct pins in DTS'overlay. (But don't understand how is work htp-detect)

  Quote

 

                reset-gpios = <&pio 4 14 0>;

                hpd-gpios = <&pio 4 15 1>;

 

Expand  

now dt-overlay looks like:

  Reveal hidden contents

 

  Quote

And it seems like your devicetree was decompiled at some point.

Expand  

Yep, my full dts in first msg realy decompiled from system: dtc -I fs -O dts -o dt_full_adv7611.dts /sys/firmware/devicetree/base/

 

  Quote

How recent is your kernel? It maybe lacks support for the CSI / DVP. 

Expand  

from first msg:

    Board: OrangePi zero plus2 H5
    Linux 4.19.21-sunxi64 #5.76

And yesterday, i'am rebuild img again :) with last kernel

 

I see one problem. In menuconfig i'am select adv7604 and sun6i_csi moudles, but after apply armbian-add-overlay and reboot linux - in list lsmod i see only adv7604. sun6i_csi is missing.

If i do: modprobe sun6i_csi, in lsmod i see this module. But in /dev has not appeared video-dev/

 

How can I see more info about HW in Linux? Expect dmesg and ls /dev/

Posted

I suggest you clone the newest version of the linux kernel from Github and apply sunxi_defconfig . After that select the ADV7604 and the Sunxi V3s CSI (Sun6i-csi) in the menuconfig. then open arch/arm/boot/dts/ and search for your board devicetree file and modify it to support the ADV7611. Then build the kernel and after that look for the zImage in arch/arm/boot/ and also copy your compiled devicetree file from arch/arm/boot/dts/.

Why do you modprobe sun6i-csi? The csi driver is mainline so you don't need that. 

 

The Reset line isn't a required property, but the Hotplug detection (HPD) pin is. The Hotplug Detection pin is an output to switch a transistor on to connect a 1k resistor between HDMI 5V and the Hotplug Detection line coming from the HDMI cable. So the HDMI source knows that EDID data can be read via HDMI I2C. The EDID Data tells the source which resolutions are avaible.

 

Have a look at the attached schematic, even though it is for an FPGA it should be nearly the same. You don't need HPD Notif, FPGA_SCl, FPGA_SDA and of course not the FPGA schematic.  ;)

dsi-shield-sch.pdf

Posted

@petit_miner, thank you very much!
I will try to repeat your instructions, i will definitely write about the results.

  Quote

I suggest you clone the newest version of the linux kernel from Github and apply sunxi_defconfig .

Expand  

Do you mean get pure kernel (torvalds rep), without armbian path?
 

  Quote

The Reset line isn't a required property, but the Hotplug detection (HPD) pin is.

Expand  

I did not understand why I need an output from the chip and why use a transistor. We can directly connect HDMI 5v to HDMI hpd.

But i am forget about other chip in family, adv7604 have 4 input HDMI port, and in this case hpd is really necessary.

Posted

Yes. But I think you need another config file, because I didn't know that the H5 is an Arm64 processor.  I can't acess my linux machine right now, to test which config file you need. Maybe another person from the forum can help? 

Posted

petit_miner, thank you! You were right, after upgrading the kernel to 4.20 and up - the module sun6i_csi is loaded automatically and the /dev/video0 is available. (of course the csi must be status = "okay"; in DT)

But I can't figure out how to use your instruction about building kernel, and how to apply the kernel to an existing image on SDcard.

I tried to assemble an image by linux-sunxi "manual build howto", but it turned out to be too difficult for me :)

 

I got the first result after applying armbian-config tools and option change kernel version to dev (4.20). After applying "armbian-add-overlay adv7611.dts" i got /dev/video0 device, but module adv7604 is missing. 

Then the img was assembled again through "buil.sh BRANCH=dev". adv7604 was selected in menuconfig

 

Now i have img with video0 dev and adv7604 module. Thanks for help!

 

But now the device is not working, i can't get picture from video0 - have error:

pi@orangepizeroplus2:~$ sudo fswebcam -r 640x480 --jpeg 85 -D 1 shot.jpg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Delaying 1 seconds.
--- Capturing frame...
Timed out waiting for frame!
No frames captured.

i think i have hardware problem, because notebook have not any reaction on HDMI connection to adv7611.

i will read the registers adv7611, I will write if get any results. 

Posted

Test if the ADV7611 gets detected via I2C: dmesg | grep ADV

 

I'm stuck with this too. You need to configure the EDID memory of the ADV7611 with media-ctl to tell the HDMI "sender" which resolutions are available.

But I don't know how to do that. 

Posted

Hi @petit_miner.  Currently I do not know how to write the EDID correctly and init ADV.

 

But I try to write data directly through i2cget / i2cset utisl, and my laptop now detects the HDMI device.

First, the dmesg say:

adv7611 2-004c: adv7611 found @ 0x98 (mv64xxx_i2c adapter)

after i found AD recommendations "script" file: ADV7611-VER.3.0c.txt

https://ez.analog.com/video/w/documents/789/adv7611-design-support-files

 

and just convert it to .sh:

script_init.sh

  Reveal hidden contents

 

script_edid.sh

  Reveal hidden contents

 

But the image is not available right now.
fswebcam -r 640x480 --jpeg 85 -D 1 web-cam-shot.jpg
I got a green img:

  Reveal hidden contents

 

Posted

The green color in an YUV image indicates that the incoming data is zero. I think you don't need to initialize the ADV7611, because the kernel does that for you.

As mentioned in the init script you initialize the ADV7611 for 24bit mode, but you have connected it in the 8bit mode. 

 

What happens if you just execute script_edid ? 

Posted

 

  Quote

What happens if you just execute script_edid ? 

Expand  

1 - run script_edid.sh

    laptop found HDMI dev

    fswebcam timeout error

2- run script_init.sh   

  Reveal hidden contents

 

Posted

Thanks, my PC detects the HDMI input, but I'm stuck with this:

# fswebcam -S 5 -d /dev/video0 -r 1280x1024 -p YUV420P test.jpg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
[ 2323.030032] sun6i-csi 1cb4000.csi: Unsupported pixformat: 0x32315559 with mbus code: 0x2008!
Error starting stream.
VIDIOC_STREAMON: Broken pipe
Unable to use mmap. Using read instead.
Unable to use read.

I'm unable to set the correct pixelformat with media-ctl, or doesn't really know how to do it.

I'm using a newer kernel version, in which you have to set the pixelformat using media-ctl.

You can't capture anything, because the CSI controller is set to the wrong pixelformat and doesn't get checked by your kernel version (mine does).

 

 

 

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines