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

Re: HDMI to CSI-2 via TC358743 on kernel 4.1

Sat Dec 07, 2019 12:12 pm

ellisium wrote:
Sat Dec 07, 2019 12:01 pm
After few searchs, I checked /dev folder and surprising no /dev/cec0 listed. Driver is not CEC enable by default?

Code: Select all

pi@raspberrypi:~ $ sudo modprobe configs
pi@raspberrypi:~ $ zcat /proc/config.gz | grep TC358743
CONFIG_VIDEO_TC358743=m
# CONFIG_VIDEO_TC358743_CEC is not set
So no, the CEC side of the TC358743 driver is not loaded by default. You'll need to build your own kernel for now to try it out.
If it works, then create an issue under https://github.com/raspberrypi/linux/issues to request that it is added to the default configurations.
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.

ellisium
Posts: 11
Joined: Sat Nov 23, 2019 8:29 pm

Re: HDMI to CSI-2 via TC358743 on kernel 4.1

Sat Dec 07, 2019 1:44 pm

Thank you to confirm it
I never had to build kernel by myself. I'm gonna try to do it. Hope to not break my system :lol:
Do you think I can follow this step by step? https://gist.github.com/maditnerd/01195 ... 1682f1727b
Thx very much for your advice and support

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

Re: HDMI to CSI-2 via TC358743 on kernel 4.1

Sat Dec 07, 2019 2:12 pm

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.

ellisium
Posts: 11
Joined: Sat Nov 23, 2019 8:29 pm

Re: HDMI to CSI-2 via TC358743 on kernel 4.1

Sun Dec 08, 2019 10:18 am

I compiled it and now I get /dev/cec0. First test result:
Not sure about this "Logical Address : Not Allocated"

Code: Select all

sudo cec-ctl -d /dev/cec0 --no-rc-passthrough --tv -S -T -M
		CEC_ADAP_G_CAPS returned 0 (Success)
Driver Info:
	Driver Name                : tc358743
	Adapter Name               : 0-000f
	Capabilities               : 0x0000003e
		Logical Addresses
		Transmit
		Passthrough
		Remote Control Support
		Monitor All
	Driver version             : 4.19.86
	Available Logical Addresses: 4
		CEC_ADAP_G_PHYS_ADDR returned 0 (Success)
	Physical Address           : 0.0.0.0
		CEC_ADAP_S_LOG_ADDRS returned 0 (Success)
		CEC_ADAP_S_LOG_ADDRS returned 0 (Success)
		CEC_ADAP_G_LOG_ADDRS returned 0 (Success)
	Logical Address Mask       : 0x0000
	CEC Version                : 2.0
	Vendor ID                  : 0x000c03 (HDMI)
	OSD Name                   : 'TV'
	Logical Addresses          : 1 

	  Logical Address          : Not Allocated
	    Primary Device Type    : TV
	    Logical Address Type   : TV
	    All Device Types       : TV
	    RC TV Profile          : None
	    Device Features        :
		None

		CEC_ADAP_G_LOG_ADDRS returned 0 (Success)
		CEC_TRANSMIT returned 0 (Success)
		CEC_TRANSMIT returned -1 (Machine is not on the network)
		CEC_TRANSMIT returned -1 (Machine is not on the network)
		CEC_TRANSMIT returned -1 (Machine is not on the network)
		CEC_TRANSMIT returned -1 (Machine is not on the network)
		CEC_TRANSMIT returned -1 (Machine is not on the network)
		CEC_TRANSMIT returned -1 (Machine is not on the network)
		CEC_TRANSMIT returned -1 (Machine is not on the network)
		CEC_TRANSMIT returned -1 (Machine is not on the network)
		CEC_TRANSMIT returned -1 (Machine is not on the network)
		CEC_TRANSMIT returned -1 (Machine is not on the network)
		CEC_TRANSMIT returned -1 (Machine is not on the network)
		CEC_TRANSMIT returned -1 (Machine is not on the network)
		CEC_TRANSMIT returned -1 (Machine is not on the network)
		CEC_TRANSMIT returned -1 (Machine is not on the network)

		CEC_S_MODE returned 0 (Success)
		CEC_DQEVENT returned 0 (Success)

Event: State Change: PA: 0.0.0.0, LA mask: 0x0000
issue : CEC_TRANSMIT returned -1 (Machine is not on the network)
I guess I have to configure something

ellisium
Posts: 11
Joined: Sat Nov 23, 2019 8:29 pm

Re: HDMI to CSI-2 via TC358743 on kernel 4.1

Sun Dec 08, 2019 11:01 am

I confirm issue was about logical address due to my splitter.

Code: Select all

sudo cec-ctl -d /dev/cec0 --no-rc-passthrough --tv -S -T -m
		CEC_ADAP_G_CAPS returned 0 (Success)
Driver Info:
	Driver Name                : tc358743
	Adapter Name               : 0-000f
	Capabilities               : 0x0000003e
		Logical Addresses
		Transmit
		Passthrough
		Remote Control Support
		Monitor All
	Driver version             : 4.19.86
	Available Logical Addresses: 4
		CEC_ADAP_G_PHYS_ADDR returned 0 (Success)
	Physical Address           : 0.0.0.0
		CEC_ADAP_S_LOG_ADDRS returned 0 (Success)
		CEC_ADAP_S_LOG_ADDRS returned 0 (Success)
		CEC_ADAP_G_LOG_ADDRS returned 0 (Success)
	Logical Address Mask       : 0x0001
	CEC Version                : 2.0
	Vendor ID                  : 0x000c03 (HDMI)
	OSD Name                   : 'TV'
	Logical Addresses          : 1 

	  Logical Address          : 0 (TV)
	    Primary Device Type    : TV
	    Logical Address Type   : TV
	    All Device Types       : TV
	    RC TV Profile          : None
	    Device Features        :
		None

		CEC_ADAP_G_LOG_ADDRS returned 0 (Success)
		CEC_TRANSMIT returned 0 (Success)
		CEC_TRANSMIT returned 0 (Success)
		CEC_TRANSMIT returned 0 (Success)
		CEC_TRANSMIT returned 0 (Success)
		CEC_TRANSMIT returned 0 (Success)
	System Information for device 4 (Playback Device 1) from device 0 (TV):
		CEC_TRANSMIT returned 0 (Success)
		CEC Version                : 1.4
		CEC_TRANSMIT returned 0 (Success)
		Physical Address           : 3.0.0.0
		Primary Device Type        : Playback
		CEC_TRANSMIT returned 0 (Success)
		Vendor ID                  : 0x000000
		CEC_TRANSMIT returned 0 (Success)
		OSD Name                   : MIBOX4
		CEC_TRANSMIT returned 0 (Success)
		CEC_TRANSMIT returned 0 (Success)
		Power Status               : Standby
		CEC_TRANSMIT returned 0 (Success)
		CEC_TRANSMIT returned 0 (Success)
		CEC_TRANSMIT returned 0 (Success)
		CEC_TRANSMIT returned 0 (Success)
		CEC_TRANSMIT returned 0 (Success)
		CEC_TRANSMIT returned 0 (Success)
		CEC_TRANSMIT returned 0 (Success)
		CEC_TRANSMIT returned 0 (Success)
		CEC_TRANSMIT returned 0 (Success)
		CEC_TRANSMIT returned 0 (Success)
		CEC_TRANSMIT returned 0 (Success)

	Topology:

	0.0.0.0: TV
	    3.0.0.0: Playback Device 1

		CEC_S_MODE returned 0 (Success)
		CEC_DQEVENT returned 0 (Success)

Event: State Change: PA: 0.0.0.0, LA mask: 0x0001
		CEC_RECEIVE returned 0 (Success)
Received from Playback Device 1 to TV (4 to 0): CEC_MSG_GET_MENU_LANGUAGE (0x91)
		CEC_RECEIVE returned 0 (Success)
Transmitted by TV to Playback Device 1 (0 to 4): CEC_MSG_FEATURE_ABORT (0x00):
	abort-msg: 145 (0x91)
	reason: unrecognized-op (0x00)
^C

So CEC is working as expected in my case.

ellisium
Posts: 11
Joined: Sat Nov 23, 2019 8:29 pm

Re: HDMI to CSI-2 via TC358743 on kernel 4.1

Sun Dec 08, 2019 5:46 pm

Feedback about my tests today.

I tried 2 differents splitters but I got issues with both. After checking, it doesnt support CEC... that's why. So be carefull if you want to use CEC through splitters. CEC is not a standard on splitters.

Connecting mi box directly and CEC is working as expected and got surprise about hdcp stripping. So if your home theater has 2 hdmi output you can avoid to buy a splitter.

So I connected it to my pioneer sc-lx77 on hdmi out 1 and CEC working as expected. However I can't get hdmi out 1&2 display. So I tried yavta capture and it didn't work

Code: Select all

./yavta --capture=10000 -n 3 --encode-to=file.h264 -f UYVY -m -T /dev/video0
We're encoding to file.h264
Device /dev/video0 opened.
Device `unicam' on `platform:unicam 3f801000.csi' (driver 'unicam') is a video capture (without mplanes) device.
stride is 0
stride is now 1280
Video format set: UYVY (59565955) 640x480 (stride 1280) field none buffer size 614400
Video format: UYVY (59565955) 640x480 (stride 1280) field none buffer size 614400
Unable to get frame rate: Inappropriate ioctl for device (25).
vc.ril.isp:in:0(UYVY)(0xbf5fb0)type: video, fourcc: UYVY bitrate: 0, framed: 0 extra data: 0, (nil) width: 640, height: 480, (0,0,640,480) pixel aspect ratio: 0/0, frame rate: 0/0
buffers num: 3(opt 1, min 1), size: 614400(opt 614400, min: 614400), align: 0
Created pool of length 3, size 0
Enable encoder....
Create pool of 3 buffers of size 0 for render
Create pool of 3 buffers of size 0 for encode ip
Create pool of 3 buffers of size 460800 for encode/render
Writing data to file.h264
Create pool of 8 buffers of size 262144
Sent buffer 0xbffd58
Sent buffer 0xbfff30
Sent buffer 0xc00108
Sent buffer 0xc002e0
Sent buffer 0xc004b8
Sent buffer 0xc00690
Sent buffer 0xc00868
Sent buffer 0xc00a40
3 buffers requested, V4L2 returned 3 bufs.
length: 614400 offset: 0 timestamp type/source: mono/EoF
Buffer 0/0 mapped at address 0x7236a000.
Importing DMABUF 8 into VCSM...
...done. vcsm_handle 73728
Exported buffer 0 to dmabuf 8, vcsm handle 73728
Linking V4L2 buffer index 0 ptr 0xc01760 to MMAL header 0xbfc4c0. mmal->data 0xC0000003
length: 614400 offset: 614400 timestamp type/source: mono/EoF
Buffer 1/0 mapped at address 0x722d4000.
Importing DMABUF 9 into VCSM...
...done. vcsm_handle 77824
Exported buffer 1 to dmabuf 9, vcsm handle 77824
Linking V4L2 buffer index 1 ptr 0xc017d0 to MMAL header 0xbfc698. mmal->data 0xC0000004
length: 614400 offset: 1228800 timestamp type/source: mono/EoF
Buffer 2/0 mapped at address 0x7223e000.
Importing DMABUF 10 into VCSM...
...done. vcsm_handle 81920
Exported buffer 2 to dmabuf 10, vcsm handle 81920
Linking V4L2 buffer index 2 ptr 0xc01840 to MMAL header 0xbfc870. mmal->data 0xC0000005
select timeout
I tried with kodi raspberry source and mi box, both set 1080p@50 on tv display information. Do you think it's relative to EDID?

ellisium
Posts: 11
Joined: Sat Nov 23, 2019 8:29 pm

Re: HDMI to CSI-2 via TC358743 on kernel 4.1

Sat Dec 14, 2019 10:48 am

Previous message was my bad, I didn't stop hyperion instance. I disable all video conversion on pioneer amp too
So new clean try today and I get blackscreen "no signal" on TV when I plug amp hdmi out 2 on this board. Run the yavta command :

Code: Select all


 We're encoding to file.h264
Unmapped all buffers
> Device /dev/video0 opened.
> Device `unicam' on `platform:unicam 3f801000.csi' (driver 'unicam') is a video c                                                     apture (without mplanes) device.
> stride is 0
> stride is now 1280
> Video format set: UYVY (59565955) 640x480 (stride 1280) field none buffer size 6                                                     14400
> Video format: UYVY (59565955) 640x480 (stride 1280) field none buffer size 61440                                                     0
> Unable to get frame rate: Inappropriate ioctl for device (25).
> vc.ril.isp:in:0(UYVY)(0x1016fb0)type: video, fourcc: UYVY bitrate: 0, framed: 0                                                      extra data: 0, (nil) width: 640, height: 480, (0,0,640,480) pixel aspect ratio:                                                      0/0, frame rate: 0/0
> buffers num: 3(opt 1, min 1), size: 614400(opt 614400, min: 614400), align: 0
> Created pool of length 3, size 0
> Enable encoder....
> Create pool of 3 buffers of size 0 for render
> Create pool of 3 buffers of size 0 for encode ip
> Create pool of 3 buffers of size 460800 for encode/render
> Writing data to file.h264
> Create pool of 8 buffers of size 262144
> Sent buffer 0x1020d58
> Sent buffer 0x1020f30
> Sent buffer 0x1021108
> Sent buffer 0x10212e0
> Sent buffer 0x10214b8
> Sent buffer 0x1021690
> Sent buffer 0x1021868
> Sent buffer 0x1021a40
> 3 buffers requested, V4L2 returned 3 bufs.
> length: 614400 offset: 0 timestamp type/source: mono/EoF
> Buffer 0/0 mapped at address 0x7236a000.
> Importing DMABUF 8 into VCSM...
> ...done. vcsm_handle 73728
> Exported buffer 0 to dmabuf 8, vcsm handle 73728
> Linking V4L2 buffer index 0 ptr 0x1022760 to MMAL header 0x101d4c0. mmal->data 0                                                     xC0000003
> length: 614400 offset: 614400 timestamp type/source: mono/EoF
> Buffer 1/0 mapped at address 0x722d4000.
> Importing DMABUF 9 into VCSM...
> ...done. vcsm_handle 77824
> Exported buffer 1 to dmabuf 9, vcsm handle 77824
> Linking V4L2 buffer index 1 ptr 0x10227d0 to MMAL header 0x101d698. mmal->data 0                                                     xC0000004
> length: 614400 offset: 1228800 timestamp type/source: mono/EoF
> Buffer 2/0 mapped at address 0x7223e000.
> Importing DMABUF 10 into VCSM...
> ...done. vcsm_handle 81920
> Exported buffer 2 to dmabuf 10, vcsm handle 81920
> Linking V4L2 buffer index 2 ptr 0x1022840 to MMAL header 0x101d870. mmal->data 0                                                     xC0000005
> 0 (0) [-] none 0 614400 B 432.952524 432.962821 20.449 fps ts mono/EoF
> 1 (1) [-] none 1 614400 B 432.962800 432.982819 97.314 fps ts mono/EoF
> 2 (2) [-] none 2 614400 B 432.982800 433.002823 50.000 fps ts mono/EoF
> 3 (0) [-] none 3 614400 B 433.002800 433.022816 50.000 fps ts mono/EoF
> 4 (1) [-] none 4 614400 B 433.022800 433.042820 50.000 fps ts mono/EoF
> 5 (2) [-] none 5 614400 B 433.042800 433.062816 50.000 fps ts mono/EoF
> 6 (0) [-] none 6 614400 B 433.062799 433.072513 50.003 fps ts mono/EoF
> Exception
> Source changed
> QUERY_DV_TIMINGS returned 1920x1080 pixclk 148500000
> Failed to set DV timings
> Unmapped all buffers
> Source changed
> Unmapped all buffers
> Source changed
> QUERY_DV_TIMINGS returned 1920x1080 pixclk 148500000
> Failed to set DV timings
> Unmapped all buffers
> Source changed
> Unmapped all buffers
> Source changed
> QUERY_DV_TIMINGS returned 1920x1080 pixclk 148500000
> Failed to set DV timings
> Unmapped all buffers
> Source changed
> Unmapped all buffers
> Source changed
> QUERY_DV_TIMINGS returned 1920x1080 pixclk 148500000
> Failed to set DV timings
> Unmapped all buffers
> Source changed
> Unmapped all buffers
> Source changed
>

I tried " v4l2-ctl --set-dv-bt-timings" , result:

Code: Select all

VIDIOC_QUERY_DV_TIMINGS: failed: Numerical result out of range
VIDIOC_S_DV_TIMINGS: failed: Numerical result out of range
Any idea?

thx for support

proff
Posts: 1
Joined: Fri Dec 27, 2019 10:20 am

Re: HDMI to CSI-2 via TC358743 on kernel 4.1

Fri Dec 27, 2019 10:30 am

hi every one
I just receive 2 B101 bridges
and I tested one on a RPI 4 with last raspian buster release
and it work great no color issue or images default
the only issue I have is that compared to genuine CSI2 pi cam it adds more than 3 seconds delay !!!
I'm streaming it with gstreamer to display it on a drone ground control software (QGROUND CONTROL)

Code: Select all

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-h264,width=1920,height=1080,framerate=25/1 ! h264parse ! rtph264pay ! udpsink host=192.168.2.1 port=5000
again it's working perfectly with standard pi camera
I've try with differents hdmi sources in 180P25 and in 720p60
and it's working every time except that more that 3 sec delay is huge !!

Return to “Graphics, sound and multimedia”