6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7513
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Two cameras (CM3) question

Fri Feb 15, 2019 2:14 pm

If an I2C driver is correctly loaded then the device will report as UU in i2cdetect (U for used).
When working correctly I would expect to see address 0F show as UU on both i2c-0 and i2c-1.

The overlay I appear to still have in my working directory is:

Code: Select all

// SPDX-License-Identifier: GPL-2.0-only
// Definitions for Toshiba TC358743 HDMI to CSI2 bridge on ARM I2C bus
/dts-v1/;
/plugin/;

/{
	compatible = "brcm,bcm2708";

	[email protected] {
		target = <&i2c_arm>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";

			[email protected] {
				compatible = "toshiba,tc358743";
				reg = <0x0f>;
				status = "okay";

				clocks = <&tc358743_0_clk>;
				clock-names = "refclk";

				tc358743_0_clk: bridge-clk-0 {
					compatible = "fixed-clock";
					#clock-cells = <0>;
					clock-frequency = <27000000>;
				};

				port {
					tc358743_0: endpoint {
						remote-endpoint = <&csi0_ep>;
						clock-lanes = <0>;
						clock-noncontinuous;
						link-frequencies =
							/bits/ 64 <486000000>;
					};
				};
			};
		};
	};

	[email protected] {
		target = <&csi0>;
		__overlay__ {
			status = "okay";

			port {
				csi0_ep: endpoint {
					remote-endpoint = <&tc358743_0>;
				};
			};
		};
	};

	[email protected] {
		target = <&i2c_arm>;
		__overlay__ {
			[email protected] {
				port {
					endpoint {
						data-lanes = <1 2>;
					};
				};
			};
		};
	};

	[email protected] {
		target = <&i2c1_pins>;
		__dormant__ {
			brcm,pins = <2 3>;
			brcm,function = <4>; /* alt0 */
		};
	};
	[email protected] {
		target = <&i2c1_pins>;
		__overlay__ {
			brcm,pins = <44 45>;
			brcm,function = <6>; /* alt2 */
		};
	};
	[email protected] {
		target = <&i2c_arm>;
		__overlay__ {
			status = "okay";
		};
	};

	__overrides__ {
		i2c_pins_2_3 = <0>,"+3-4";
		link-frequency = <&tc358743_0>,"link-frequencies#0";
	};
};
Sorry, I can't guarantee that that was the one I had that worked.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

xasm
Posts: 34
Joined: Mon Nov 19, 2018 8:28 am

Re: Two cameras (CM3) question

Fri Feb 15, 2019 2:24 pm

Yes, I have the same dts file.

But when 2 overlays are loaded i2cdetect -y 1 display only "- -"

It seems like an internal conflict between the i2c-1 line exists. When I run the command "i2cdetect -y 1" it executes slowly than "i2cdetect -y 0"

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7513
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Two cameras (CM3) question

Fri Feb 15, 2019 2:36 pm

xasm wrote:
Fri Feb 15, 2019 2:24 pm
Yes, I have the same dts file.

But when 2 overlays are loaded i2cdetect -y 1 display only "- -"

It seems like an internal conflict between the i2c-1 line exists. When I run the command "i2cdetect -y 1" it executes slowly than "i2cdetect -y 0"
As I had posted first off, report what "raspi-gpio get" says. I suspect that GPIOs 2&3 are also mapped to SDA1/SCL1. Double mapping will cause problems and most likely clock stretching timeouts.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

xasm
Posts: 34
Joined: Mon Nov 19, 2018 8:28 am

Re: Two cameras (CM3) question

Fri Feb 15, 2019 2:42 pm

No, "raspi-gpio get" said that GPIO2 and 3 func=INPUT.

GPIO44 = SDA1
GPIO45 = SCL1

Am I right that dts should reconfigure it to 2 and 3?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7513
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Two cameras (CM3) question

Fri Feb 15, 2019 3:20 pm

xasm wrote:
Fri Feb 15, 2019 2:42 pm
No, "raspi-gpio get" said that GPIO2 and 3 func=INPUT.

GPIO44 = SDA1
GPIO45 = SCL1

Am I right that dts should reconfigure it to 2 and 3?
No, as per your very first post you wanted to map the I2C to the two devices from 28&29 and 44&45.
I connected:

CD1_SDA ==> 28
CD1_SCL ==> 29
CD0_SDA ==> 44
CD0_SCL ==> 45
If that's not how you've wired up the CMIO board to the B102s then you need to update either your wiring or your DT config based on that.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

xasm
Posts: 34
Joined: Mon Nov 19, 2018 8:28 am

Re: Two cameras (CM3) question

Fri Feb 15, 2019 3:53 pm

It's strange, because my prev system had the same (I guess) configuration, but wired to 2,3 GPIO.

Nevertheless, I changed wirings and it works! Thank you!

xasm
Posts: 34
Joined: Mon Nov 19, 2018 8:28 am

Re: Two cameras (CM3) question

Tue Mar 05, 2019 7:42 am

Hi 6by9!

I faced a quite strange problem. The hardware configuration of my system is following

Image

The HDMI Switch is needed for redundancy. In case of software problems in CM3 the user can switch to VIDEOSOURCE_1 directly, without CM3.

in debug mode I see RPi interface at DISPLAY and can switch between VIDEOSOURCE_1 and VIDEOSOURCE_2 by HDMI SWITCH button. But as soon as I start Mplayer and trying to play VIDEOSOURCE_1 - I saw green screen or even got system crash.

But the configuration works perfectly:

Image


I understand, that it's a very specific issue. But probably you met it before? Any thoughts are welcome. Thank you!
Attachments
video-1.jpg
video-1.jpg (14 KiB) Viewed 719 times

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7513
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Two cameras (CM3) question

Tue Mar 05, 2019 10:19 am

No ideas, but as a couple of things to check:
- Is this is a commercial HDMI switch, or something you've built?
- Are you switching the hotplug detect (HPD) line properly?
- Are you actually splitting the HDMI signal from VIDEO_SOURCE1 through a proper HDMI distribution amp, or just wiring the three connectors together (this won't work). The cheap splitters such as https://www.ebay.co.uk/itm/NEW-1-INPUT- ... 2276760648 work well.
- Have you set the timings correctly before trying to stream?
- What resolution are you trying to run through mplayer?
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

xasm
Posts: 34
Joined: Mon Nov 19, 2018 8:28 am

Re: Two cameras (CM3) question

Tue Mar 05, 2019 10:28 am

Thank you for the reply.

Please find my answers below:

- Is this is a commercial HDMI switch, or something you've built?
>> Commercial switch, but without external power. (https://goo.gl/f2Kaph) I have heard that it might be a problem. Will try another one.

- Are you switching the hotplug detect (HPD) line properly?
>>I rely on the HDMI switch.

- Are you actually splitting the HDMI signal from VIDEO_SOURCE1 through a proper HDMI distribution amp, or just wiring the three connectors together (this won't work). The cheap splitters such as https://www.ebay.co.uk/itm/NEW-1-INPUT- ... 2276760648 work well.
>>I'm using this one https://goo.gl/VDK8V4. +DVI/HDMI adapters.

- Have you set the timings correctly before trying to stream?
>>Yes, without HDMI switch everything works well

- What resolution are you trying to run through mplayer?
>>800x600 58Hz

EDIT: I'm not sure that DVI or HDMI splitters support custom video signals. They support something like 480i/ 480p/ 720i/ 720p/ 1080i/ 1080p, but my signal is different. But, probably, I have to try.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7513
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Two cameras (CM3) question

Tue Mar 05, 2019 11:09 am

xasm wrote:
Tue Mar 05, 2019 10:28 am
- Is this is a commercial HDMI switch, or something you've built?
>> Commercial switch, but without external power. (https://goo.gl/f2Kaph) I have heard that it might be a problem. Will try another one.
Looks reasonable.
xasm wrote:- Are you switching the hotplug detect (HPD) line properly?
>>I rely on the HDMI switch.

- Are you actually splitting the HDMI signal from VIDEO_SOURCE1 through a proper HDMI distribution amp, or just wiring the three connectors together (this won't work). The cheap splitters such as https://www.ebay.co.uk/itm/NEW-1-INPUT- ... 2276760648 work well.
>>I'm using this one https://goo.gl/VDK8V4. +DVI/HDMI adapters.
That looks suspiciously like it is just a simple T between the connectors. This will fail as there are various negotiations that happen over HDMI and DVI.
xasm wrote:- Have you set the timings correctly before trying to stream?
>>Yes, without HDMI switch everything works well

- What resolution are you trying to run through mplayer?
>>800x600 58Hz

EDIT: I'm not sure that DVI or HDMI splitters support custom video signals. They support something like 480i/ 480p/ 720i/ 720p/ 1080i/ 1080p, but my signal is different. But, probably, I have to try.
Generally splitters don't care about the actual video content. Good ones will manage the EDIDs from the multiple outputs, if HDCP is active then it has to decode and reencode for each output, handle ARC and CEC, but pass the video and audio through otherwise untouched.
The EDID manipulation may be a bit tricky with non-standard modes, but in your case that is likely to be dictated by the source anyway.

I wouldn't be surprised if HDCP had been engaged if your display supports it (the Auvidea boards don't).
"v4l2-ctl --log-status" will dump out a load of status from the TC358743 driver, including the HDCP status.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Graphics, sound and multimedia”