dasse
Posts: 39
Joined: Thu Sep 27, 2018 10:21 am

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

Wed Oct 31, 2018 11:54 am

I get the i2c-0 too in the /dev.
this file is not walking to
v4l2-ctl --set-edid=file=1080P50EDID.txt --fix-edid-checksums :|

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7273
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

Wed Oct 31, 2018 12:00 pm

dasse wrote:
Wed Oct 31, 2018 11:49 am
I'm now so far with the Video0 in /dev. Thank.
And the problem was? Your experiences help others.
dasse wrote:But your links is not walking
wget https://raw.githubusercontent.com/6by9/ ... 50EDID.txt
are they any other way to get the 1080P50EDID.txt or 1080P60EDID.txt?
Thanks

Code: Select all

wget https://raw.githubusercontent.com/6by9/RPiTest/master/1080P50EDID.txt
works fine for me.

Code: Select all

pi@raspberrypi:/tmp$ wget https://raw.githubusercontent.com/6by9/RPiTest/master/1080P50EDID.txt
--2018-10-31 11:59:33--  https://raw.githubusercontent.com/6by9/RPiTest/master/1080P50EDID.txt
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.16.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.16.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 527 [text/plain]
Saving to: ‘1080P50EDID.txt’

1080P50EDID.txt                              100%[===========================================================================================>]     527  --.-KB/s    in 0s      

2018-10-31 11:59:34 (26.0 MB/s) - ‘1080P50EDID.txt’ saved [527/527]
The file is sitting in https://github.com/6by9/RPiTest, so grab it however you see fit.
Copy and paste the following into an editor of your own if you fancy

Code: Select all

00ffffffffffff005262888800888888
1c150103800000780aEE91A3544C9926
0F505400000001010101010101010101
010101010101011d007251d01e206e28
5500c48e2100001e8c0ad08a20e02d10
103e9600138e2100001e000000fc0054
6f73686962612d4832430a20000000FD
003b3d0f2e0f1e0a2020202020200100
020321434e841303021211012021223c
3d3e1f2309070766030c00300080E300
7F8c0ad08a20e02d10103e9600c48e21
0000188c0ad08a20e02d10103e960013
8e210000188c0aa01451f01600267c43
00138e21000098000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
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.

dasse
Posts: 39
Joined: Thu Sep 27, 2018 10:21 am

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

Wed Oct 31, 2018 12:06 pm

And the problem was? Your experiences help others.
I did just enable the i2c and start all from the biginning. so I think the problem was i2c interface that wasn't enable on my module

dasse
Posts: 39
Joined: Thu Sep 27, 2018 10:21 am

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

Wed Oct 31, 2018 1:33 pm

The HDMI timings set the capture resolution and frame rate. "v4l2-ctl --query-dv-timings" will tell you what mode has been detected. "v4l2-ctl --list-dv-timings" lists all the supported modes. "v4l2-ctl --set-dv-bt-timings <parameters>" allows you to set them (by index from list-dv-timings is easiest in my experience).
Use your preferred V4L2 app to capture the uncompressed image data.
Should you wish to H264 compress and/or display it, then https://github.com/6by9/yavta can handle the HDMI timings selection for you, as well as capturing and encoding the data. "./yavta --capture=1000 -n 3 --encode-to=file.h264 -f UYVY -m -T /dev/video0". Read the rest of this thread for details.
I am in the process of hacking a fork of raspivid to work with this directly whilst keeping the raspivid command line parameters, but not done yet.
when I enter: "v4l2-ctl --query-dv-timings" I get:

Code: Select all

pi@raspberrypi:~ $ v4l2-ctl --query-dv-timings
	Active width: 1280
	Active height: 720
	Total width: 1650
	Total height: 750
	Frame format: progressive
	Polarities: -vsync -hsync
	Pixelclock: 74250000 Hz (60.00 frames per second)
	Horizontal frontporch: 0
	Horizontal sync: 370
	Horizontal backporch: 0
	Vertical frontporch: 0
	Vertical sync: 30
	Vertical backporch: 0
	Standards: 
	Flags: 
I though the resolution of the B102 was 1080P. right?

what am I suppose to enter here where parameter stays. I tried this:

Code: Select all

pi@raspberrypi:~ $ v4l2-ctl --set-dv-bt-timings<11>
bash: Syntaxfehler beim unerwarteten Wort `11'
.
11 is one the index of "v4l2-ctl --list-dv-timings".

pi@raspberrypi:~ $ v4l2-ctl --set-dv-bt-timings<parameters>
bash: Syntaxfehler beim unerwarteten Wort `newline'
Thanks

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7273
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

Wed Oct 31, 2018 2:05 pm

dasse wrote:
Wed Oct 31, 2018 1:33 pm
when I enter: "v4l2-ctl --query-dv-timings" I get:

Code: Select all

pi@raspberrypi:~ $ v4l2-ctl --query-dv-timings
	Active width: 1280
	Active height: 720
	Total width: 1650
	Total height: 750
	Frame format: progressive
	Polarities: -vsync -hsync
	Pixelclock: 74250000 Hz (60.00 frames per second)
	Horizontal frontporch: 0
	Horizontal sync: 370
	Horizontal backporch: 0
	Vertical frontporch: 0
	Vertical sync: 30
	Vertical backporch: 0
	Standards: 
	Flags: 
I though the resolution of the B102 was 1080P. right?
No, it has no "resolution". The TC358743 chip which the B101 and B102 use can receive anything up to 1080P60 and convert it from HDMI to CSI2 data.
The TC358743 advertises an EDID. As I have already stated, the source then uses that to choose an appropriate mode to produce.
You can read what is encoded in the EDID you've downloaded with edid-decode:

Code: Select all

pi@raspberrypi:~/tmp $ edid-decode 1080P50EDID.txt
Extracted contents:
header:          00 ff ff ff ff ff ff 00
serial number:   52 62 88 88 00 88 88 88 1c 15
version:         01 03
basic params:    80 00 00 78 0a
chroma info:     ee 91 a3 54 4c 99 26 0f 50 54
established:     00 00 00
standard:        01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
descriptor 1:    01 1d 00 72 51 d0 1e 20 6e 28 55 00 c4 8e 21 00 00 1e
descriptor 2:    8c 0a d0 8a 20 e0 2d 10 10 3e 96 00 13 8e 21 00 00 1e
descriptor 3:    00 00 00 fc 00 54 6f 73 68 69 62 61 2d 48 32 43 0a 20
descriptor 4:    00 00 00 fd 00 3b 3d 0f 2e 0f 1e 0a 20 20 20 20 20 20
extensions:      01
checksum:        00

Manufacturer: TSB Model 8888 Serial Number 2290649088
Made week 28 of 2011
EDID version: 1.3
Digital display
Image size is variable
Gamma: 2.20
Supported color formats: RGB 4:4:4, YCrCb 4:4:4
First detailed timing is preferred timing
Established timings supported:
Standard timings supported:
Detailed mode: Clock 74.250 MHz, 708 mm x 398 mm
               1280 1390 1430 1650 hborder 0
                720  725  730  750 vborder 0
               +hsync +vsync 
Detailed mode: Clock 27.000 MHz, 531 mm x 398 mm
                720  736  798  858 hborder 0
                480  489  495  525 vborder 0
               +hsync +vsync 
Monitor name: Toshiba-H2C
Monitor ranges (invalid): 59-61Hz V, 15-46kHz H, max dotclock 150MHz
Has 1 extension blocks
Checksum: 0x0 (should be 0x4f)

CEA extension block
Extension version: 3
29 bytes of CEA data
  Video data block
    VIC   4 1280x720@60Hz (native)
    VIC  19 1280x720@50Hz 
    VIC   3 720x480@60Hz 
    VIC   2 720x480@60Hz 
    VIC  18 720x576@50Hz 
    VIC  17 720x576@50Hz 
    VIC   1 640x480@60Hz 
    VIC  32 1920x1080@24Hz 
    VIC  33 1920x1080@25Hz 
    VIC  34 1920x1080@30Hz 
    VIC  60 1280x720@24Hz 
    VIC  61 1280x720@25Hz 
    VIC  62 1280x720@30Hz 
    VIC  31 1920x1080@50Hz 
  Audio data block
    Linear PCM, max channels 2
    Supported sample rates (kHz): 48 44.1 32
    Supported sample sizes (bits): 24 20 16
  Vendor-specific data block, OUI 000c03 (HDMI)
    Source physical address 3.0.0.0
    Supports_AI
  Extended tag: video capability data block
    YCbCr quantization: No Data (0)
    RGB quantization: Selectable (via AVI Q) (1)
    PT scan behaviour: Support both over- and underscan (3)
    IT scan behaviour: Support both over- and underscan (3)
    CE scan behaviour: Support both over- and underscan (3)
Basic audio support
3 native detailed modes
Detailed mode: Clock 27.000 MHz, 708 mm x 398 mm
                720  736  798  858 hborder 0
                480  489  495  525 vborder 0
               -hsync -vsync 
Detailed mode: Clock 27.000 MHz, 531 mm x 398 mm
                720  736  798  858 hborder 0
                480  489  495  525 vborder 0
               -hsync -vsync 
Detailed mode: Clock 27.000 MHz, 531 mm x 398 mm
               1440 1478 1602 1716 hborder 0
                240  244  247  262 vborder 0
               -hsync -vsync interlaced 
Checksum: 0x0 (should be 0x28)

EDID block does not conform at all!
	Block has broken checksum
	Detailed blocks filled with garbage
	Range descriptor contains garbage
Note that it has a "native" flag against 1280x720@60Hz - your source has chosen to select this. You can alter the EDID to your heart's content (there are various tools to help you do this), but I'm not doing it for you.

Changing timing or resolution settings on the TC358743 will not change what the source is generating - only the source, or via the EDID, can you change that.
Choosing a timing that doesn't match what the source is producing will generate weird results. As to why the V4L2 folk chose to require this way of configuring things, I have no idea.
dasse wrote:what am I suppose to enter here where parameter stays. I tried this:

Code: Select all

pi@raspberrypi:~ $ v4l2-ctl --set-dv-bt-timings<11>
bash: Syntaxfehler beim unerwarteten Wort `11'
.
11 is one the index of "v4l2-ctl --list-dv-timings".

pi@raspberrypi:~ $ v4l2-ctl --set-dv-bt-timings<parameters>
bash: Syntaxfehler beim unerwarteten Wort `newline'
Thanks

Code: Select all

v4l2-ctl --set-dv-bt-timings index=11
"v4l2-ctl --help-stds" will give you the complete syntax for all those commands. "v4l2-ctl --help-all" for all the available commands from v4l2-ctl.

Sorry, enough hand holding. This isn't a Raspberry Pi produced device, and enough others have got it working that I know the drivers are all good.
HDMI capture isn't a trivial subject, but it's also not rocket science for those with a basic level of Linux knowledge (ie ability to read help text).
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.

Jacky Chen
Posts: 9
Joined: Thu Sep 27, 2018 8:08 am

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

Wed Nov 07, 2018 10:02 am

Hi 6by9, I tried to compile the last gst-omx. I got a error: "Requested 'gstreamer-1.0 >= 1.15.0.1' ". The last stable version of Gstreamer seems to be 1.14.4. How to fix this issue? Many thanks.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7273
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

Wed Nov 07, 2018 10:09 am

Jacky Chen wrote:
Wed Nov 07, 2018 10:02 am
Hi 6by9, I tried to compile the last gst-omx. I got a error: "Requested 'gstreamer-1.0 >= 1.15.0.1' ". The last stable version of Gstreamer seems to be 1.14.4. How to fix this issue? Many thanks.
You generally can't build gst-omx in isolation, you have to update all the gstreamer libraries. Choose the same release point for all of them, whether that be a stable tag or top of tree, and build the lot.
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.

dasse
Posts: 39
Joined: Thu Sep 27, 2018 10:21 am

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

Wed Nov 07, 2018 3:36 pm

Hello and big thanks again for your Help,
On a CM or CM3, you need to decide which pins you're connecting up, and then choose either the same as the 3B/3B+ if 44&45, or the 0/0W/B+/2B if using 28&29. Yes you could use 0&1, but I haven't added parameters for that. You can also add "4lane=1" if using the CAM1 connector and have a B102 to be able to achieve 1080P60 (1080P50 UYVY is the maximum available on 2 lanes). I have not added support for the original A/B as there are too many variations for this round.
The B102 is now walking well on my CM3. But wenn I mesure the MIPI data-lane signal with the scope, only the data-lanes 0 and 1 seem to work. I have already added "4lane=1" to /boot/config.txt and install

Code: Select all

wget https://raw.githubusercontent.com/6by9/RPiTest/master/1080P60EDID.txt
is there anything we can do to make all 4 work at the same time?
Thanks

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7273
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

Wed Nov 07, 2018 3:51 pm

dasse wrote:
Wed Nov 07, 2018 3:36 pm
The B102 is now walking well on my CM3. But wenn I mesure the MIPI data-lane signal with the scope, only the data-lanes 0 and 1 seem to work. I have already added "4lane=1" to /boot/config.txt and install

Code: Select all

wget https://raw.githubusercontent.com/6by9/RPiTest/master/1080P60EDID.txt
is there anything we can do to make all 4 work at the same time?
Thanks
It uses the number of lanes that are required to carry the data.

The default configuration from the overlay is for a link frequency of 486MHz, so 972Mbit/s per lane.
Roughly speaking (there are overheads), for 1080p50 UYVY 1920 * 1080 * 16 * 50 = 1658880000 Mbit/s, so can be carried on two lanes.
For 1080p50 RGB3 1920 * 1080 * 24 * 50 = 2488320000 Mbit/s, so requires three lanes.
1080p60 UYVY is 1920 * 1080 * 16 * 60 = 1990656000 Mbit/s, so again requires three lanes.
1080p60 RGB3 is 1920 * 1080 * 24 * 60 = 2985984000 Mbit/s, so requires four lanes.

Enable the logging in the bcm2835-unicam driver (the debug kernel module parameter) and it should log "Running with N data lanes" as you start streaming.

If you felt the need then there is also a configuration for a 297MHz link frequency (594Mbit/s) which would use more lanes at a lower frequency for no particular gain. It's also insufficient to carry 1080p60 RGB3. "dtoverlay=tc358743,4lane=1,link-frequency=297000000".
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.

dasse
Posts: 39
Joined: Thu Sep 27, 2018 10:21 am

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

Wed Nov 07, 2018 4:11 pm

Thank you verry much
I'm gonna try it now.
is the "h264" from

Code: Select all

"./yavta --capture=1000 -n 3 --encode-to=file.h264 -f UYVY -m -T /dev/video0"
support the RGB3 video format?
Thanks

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7273
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

Wed Nov 07, 2018 4:27 pm

dasse wrote:
Wed Nov 07, 2018 4:11 pm
Thank you verry much
I'm gonna try it now.
is the "h264" from

Code: Select all

"./yavta --capture=1000 -n 3 --encode-to=file.h264 -f UYVY -m -T /dev/video0"
support the RGB3 video format?
Thanks
The H264 video codec always works on YUV data. The standard supports 10bit data and YUV422, but the encoder on the Pi doesn't.

The pipeline in yavta is configured to use the ISP to convert whatever format is requested via the -f option into YUV for encoding.
Should you wish to get the increased data rate from the TC358743 for RGB3 over UYVY then you can, but it'll still be converted to YUV420 for encoding.

And please note all the previous discussion that the encoder is designed for a maximum of 1080p30. You can get higher with overclocking, but don't expect miracles.
There have been a couple of tweaks to video_encode recently so that it can take UYVY and RGB3 directly, but yavta hasn't been updated to accomodate that and still sends the images through the ISP first. I suspect the double conversion will end up maxing out the ISP and/or memory bandwidth.
It doesn't help that the display hardware can't accept UYVY, therefore a conversion would be required there.
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.

dasse
Posts: 39
Joined: Thu Sep 27, 2018 10:21 am

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

Thu Nov 08, 2018 11:23 am

Code: Select all

pi@raspberrypi:~ $ v4l2-ctl --query-dv-timings
	Active width: 1920
	Active height: 1080
	Total width: 2200
	Total height: 1125
	Frame format: progressive
	Polarities: -vsync -hsync
	Pixelclock: 148500000 Hz (60.00 frames per second)
	Horizontal frontporch: 0
	Horizontal sync: 280
	Horizontal backporch: 0
	Vertical frontporch: 0
	Vertical sync: 45
	Vertical backporch: 0
	Standards: 
	Flags: 
pi@raspberrypi:~ $ cd yavta/
pi@raspberrypi:~/yavta $ ./yavta --capture=100000 -n 3 -m -T /dev/video0
Device /dev/video0 opened.
Device `unicam' on `platform:unicam 3f801000.csi1' (driver 'unicam') is a video capture (without mplanes) device.
QUERY_DV_TIMINGS returned 1920x1080 pixclk 148500000
Framerate is 60
Video format: UYVY (59565955) 1920x1080 (stride 3840) field none buffer size 4177920
vc.ril.isp:in:0(UYVY)(0xbd7fb0)type: video, fourcc: UYVY bitrate: 0, framed: 0 extra data: 0, (nil) width: 1920, height: 1088, (0,0,1920,1080) pixel aspect ratio: 0/0, frame rate: 0/0 buffers num: 3(opt 1, min 1), size: 4177920(opt 4177920, min: 4177920), align: 0Created pool of length 3, size 0
Create pool of 3 buffers of size 0 for render
Create pool of 3 buffers of size 3133440 for encode/render
3 buffers requested.
length: 4177920 offset: 0 timestamp type/source: mono/EoF
Buffer 0/0 mapped at address 0x72516000.
Importing DMABUF 6 into VCSM...
...done. vcsm_handle 1261568
Exported buffer 0 to dmabuf 6, vcsm handle 1261568
Linking V4L2 buffer index 0 ptr 0xbdded0 to MMAL header 0xbdc070. mmal->data 0xC0000009
length: 4177920 offset: 4177920 timestamp type/source: mono/EoF
Buffer 1/0 mapped at address 0x7211a000.
Importing DMABUF 7 into VCSM...
...done. vcsm_handle 1265664
Exported buffer 1 to dmabuf 7, vcsm handle 1265664
Linking V4L2 buffer index 1 ptr 0xbddf40 to MMAL header 0xbdc248. mmal->data 0xC0000008
length: 4177920 offset: 8355840 timestamp type/source: mono/EoF
Buffer 2/0 mapped at address 0x71d1e000.
Importing DMABUF 8 into VCSM...
...done. vcsm_handle 1269760
Exported buffer 2 to dmabuf 8, vcsm handle 1269760
Linking V4L2 buffer index 2 ptr 0xbddfb0 to MMAL header 0xbdc420. mmal->data 0xC0000002
[color=#FF4000]Unable to start streaming: Invalid argument (22).[/color]
Releasing vcsm handle 1261568
Closing dma_buf 6
Releasing vcsm handle 1265664
Closing dma_buf 7
Releasing vcsm handle 1269760
Closing dma_buf 8
3 buffers released.
pi@raspberrypi:~/yavta $ ^C
pi@raspberrypi:~/yavta $
That's what happened when I try to capture 1080P60 frame :oops: :oops:
is it only supports only support up to 1080P50?
Last edited by dasse on Thu Nov 08, 2018 3:22 pm, edited 1 time in total.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7273
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

Thu Nov 08, 2018 11:30 am

dasse wrote:
Thu Nov 08, 2018 11:23 am
That's what happened when I try to capture 1080P60 frame :oops: :oops:
is it only supports only support up to 1080P50?
So you checked the kernel logs? Turned on the module debug logs for tc358743 and bcm2835-unicam? Did any troubleshooting?
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.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7273
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

Thu Nov 08, 2018 12:09 pm

Tested (admittedly on 4.19.1). Can receive the data as RGB3 1080P60 fine. Trying to encode results in lots of dropped frames (as expected).

Code: Select all

[  190.456971] tc358743 0-000f: tc358743_query_dv_timings: 1920x1080p60.0 (2200x1125)
[  190.562500] unicam 3f801000.csi: Running with 4 data lanes
[  190.564628] unicam 3f801000.csi: wr_dma_addr e9300000-e98fa000
[  190.564643] tc358743 0-000f: enable_stream: enable
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.

dasse
Posts: 39
Joined: Thu Sep 27, 2018 10:21 am

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

Thu Nov 08, 2018 12:43 pm

Donc, vous avez vérifié les journaux du noyau? Activé les journaux de débogage du module pour tc358743 et bcm2835-unicam? Avez-vous eu des problèmes?
not yet. I woulk first like to know if it possible to make all 4 lane work with 1080P60 RGB888.
Is it event possible with yavta?
Sorry to bother you so much.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7273
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

Thu Nov 08, 2018 1:00 pm

dasse wrote:
Thu Nov 08, 2018 12:43 pm
Donc, vous avez vérifié les journaux du noyau? Activé les journaux de débogage du module pour tc358743 et bcm2835-unicam? Avez-vous eu des problèmes?
not yet. I woulk first like to know if it possible to make all 4 lane work with 1080P60 RGB888.
Is it event possible with yavta?
Sorry to bother you so much.
Please read the post I just made - viewtopic.php?f=38&t=120702&start=450#p1389590
The log line

Code: Select all

[  190.562500] unicam 3f801000.csi: Running with 4 data lanes
has answered your question.

Sorry, I'm not hand-holding anymore.
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.

dasse
Posts: 39
Joined: Thu Sep 27, 2018 10:21 am

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

Thu Nov 08, 2018 3:27 pm

So you checked the kernel logs? Turned on the module debug logs for tc358743 and bcm2835-unicam? Did any troubleshooting?

Code: Select all

pi@raspberrypi:~/linux $ make -j4 zImage modules dtbs
scripts/kconfig/conf  --silentoldconfig Kconfig
  ............................................................................................
  ..................................................................................................
In file included from ./include/linux/backing-dev.h:17:0,
                 from fs/super.c:32:
[color=#FF0000]./include/linux/blk-cgroup.h:168:1: internal compiler error: Speicherzugriffsfehler
 };
 ^[/color]
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-6/README.Bugs> for instructions.
scripts/Makefile.build:328: die Regel für Ziel „fs/super.o“ scheiterte
make[1]: *** [fs/super.o] Fehler 1
Makefile:1039: die Regel für Ziel „fs“ scheiterte
make: *** [fs] Fehler 2
make: *** Es wird auf noch nicht beendete Prozesse gewartet..
........................................
I got an error by install the bcm2835-unicam driver :| :|

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7273
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

Thu Nov 08, 2018 3:36 pm

dasse wrote:
Thu Nov 08, 2018 3:27 pm
So you checked the kernel logs? Turned on the module debug logs for tc358743 and bcm2835-unicam? Did any troubleshooting?

Code: Select all

pi@raspberrypi:~/linux $ make -j4 zImage modules dtbs
scripts/kconfig/conf  --silentoldconfig Kconfig
  ............................................................................................
  ..................................................................................................
In file included from ./include/linux/backing-dev.h:17:0,
                 from fs/super.c:32:
[color=#FF0000]./include/linux/blk-cgroup.h:168:1: internal compiler error: Speicherzugriffsfehler
 };
 ^[/color]
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-6/README.Bugs> for instructions.
scripts/Makefile.build:328: die Regel für Ziel „fs/super.o“ scheiterte
make[1]: *** [fs/super.o] Fehler 1
Makefile:1039: die Regel für Ziel „fs“ scheiterte
make: *** [fs] Fehler 2
make: *** Es wird auf noch nicht beendete Prozesse gewartet..
........................................
I got an error by install the bcm2835-unicam driver :| :|
??? What the heck are you doing? There's no need to compile the kernel.

You can set module parameters in one of 3 ways:
1) In the modprobe call "sudo modprobe tc358743 debug=5". Seeing as device tree is automatically loading these modules it's not the most useful in this case.
2) Via sysfs

Code: Select all

sudo su -
echo 5 > /sys/module/tc358743/parameters/debug
echo 5 > /sys/module/bcm2835_unicam/parameters/debug
ctrl-D
3) Via /etc/modprobe.d. Create files in there for each module you wish to set up parameters for:
bcm2835-unicam.conf

Code: Select all

options bcm2835-unicam debug=5
tc358743.conf

Code: Select all

options tc358743 debug=5
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.

dasse
Posts: 39
Joined: Thu Sep 27, 2018 10:21 am

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

Fri Nov 09, 2018 1:50 pm

Thank your for your help and your patience with me,
get one more question and I hope it's going to be my lasst one concerning this topic :) .
Yavta, GStreamer ou FFmpeg are the tree ways the capture images with v4l2 if Iunderstood correctly?
You may have already answered this question but please do it again for me.
with which one of them can I encode RGB888 image with 1080P 60? and how?
I have already used the first one.

Code: Select all

./yavta --capture=1000 -n 3 -m -T /dev/video0

YUVY 16 1080P60 ON 3 datalanes.
Thanks

andes
Posts: 13
Joined: Tue Oct 09, 2018 3:41 am

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

Sat Nov 10, 2018 12:04 pm

Dear 6by9,
After running two commands

Code: Select all

pi@raspberrypi:~ $ v4l2-ctl --set-edid=file=1080P50EDID.txt --fix-edid-checksums

CEA-861 Header
  IT Formats Underscanned: yes
  Audio:                   yes
  YCbCr 4:4:4:             no
  YCbCr 4:2:2:             no

HDMI Vendor-Specific Data Block
  Physical Address:        3.0.0.0
  YCbCr 4:4:4 Deep Color:  no
  30-bit:                  no
  36-bit:                  no
  48-bit:                  no

CEA-861 Video Capability Descriptor
  RGB Quantization Range:  yes
  YCC Quantization Range:  no
  PT:                      Supports both over- and underscan
  IT:                      Supports both over- and underscan
  CE:                      Supports both over- and underscan
pi@raspberrypi:~ $ v4l2-ctl --query-dv-timings  
	Active width: 1280
	Active height: 720
	Total width: 1980
	Total height: 750
	Frame format: progressive
	Polarities: -vsync -hsync
	Pixelclock: 74250000 Hz (50.00 frames per second)
	Horizontal frontporch: 0
	Horizontal sync: 700
	Horizontal backporch: 0
	Vertical frontporch: 0
	Vertical sync: 30
	Vertical backporch: 0
	Standards: 
	Flags: 
Is the command "v4l2-ctl --set-dv-bt-timings index=6" required to make Raspberry Pi work properly with 1280x720p50 input source? I ignored that command and tried to test gstreamer by

Code: Select all

gst-launch-1.0 -v videotestsrc pattern=colors ! video/x-raw,width=1280,height=720 ! autovideosink
and everything seems to be fine. But I got like only 1/4 of the source's image when trying

Code: Select all

gst-launch-1.0 -v v4l2src device=/dev/video0 ! omxh264enc ! h264parse ! omxh264dec ! autovideosink
I think it is 640x480 resolution detected (or shown) to the monitor. Here is what I see on the monitor
https://imgur.com/a/9kAq0aT
Then I tried to run

Code: Select all

v4l2-ctl --set-dv-bt-timings index=6
before trying gstreamer, but nothing shown on the monitor. Gstreamer stucks forever :(

Code: Select all

pi@raspberrypi:~ $ gst-launch-1.0 -v v4l2src device=/dev/video0 ! omxh264enc ! h264parse ! omxh264dec ! autovideosink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Got context from element 'autovideosink0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)100/1, format=(string)I420, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt601
My gstreamer version is 1.10.4 (it is the gkreidl's package from viewtopic.php?p=1255387#p1255387). Soneone claims that gstreamer is broken with Raspbian Stretch, I am not sure but the command below doesn't work too

Code: Select all

pi@raspberrypi:~ $ gst-launch-1.0 -vvv -e v4l2src ! video/x-raw,format=UYVY,framerate=60/1 ! omxh264enc target-bitrate=2000000 control-rate=variable ! h264parse ! matroskamux ! filesink location=foo.mkv
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, format=(string)UYVY, framerate=(fraction)60/1, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt601
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)UYVY, framerate=(fraction)60/1, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt601
**
ERROR:gstomxvideoenc.c:1130:gst_omx_video_enc_set_format: code should not be reached
Aborted
yavta works fine, the only issue is about the mkvmerge. It requires v4 timecode for merging

Code: Select all

pi@raspberrypi:~ $ mkvmerge -o video.mkv --timecodes 0:file.pts video.h264
mkvmerge v9.8.0 ('Kuglblids') 32bit
'video.h264': Using the demultiplexer for the format 'AVC/h.264'.
Error: The timecode v2 file 'file.pts' contains timecodes that are not ordered. Due to a bug in mkvmerge versions up to and including v1.5.0 this was necessary if the track to which the timecode file was applied contained B frames. Starting with v1.5.1 mkvmerge now handles this correctly, and the timecodes in the timecode file must be ordered normally. For example, the frame sequence 'IPBBP...' at 25 FPS requires a timecode file with the first timecodes being '0', '40', '80', '120' etc and. not '0', '120', '40', '80' etc.

If you really have to specify non-sorted timecodes then use the timecode format v4. It is identical to format v2 but allows non-sorted timecodes.

Jacky Chen
Posts: 9
Joined: Thu Sep 27, 2018 8:08 am

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

Fri Nov 16, 2018 6:27 am

Dear 6by9, I had successfully compiled the Gstreamer 1.15 .0.0 from source code. But failed to compile the git--omx which cloned from https://github.com/6by9/gst-omx.git.
I got following error message:
"/usr/bin/ld: testegl-testegl.o: undefined reference to symbol 'glVertexAttribPointer'
//usr/lib/arm-linux-gnueabihf/libGL.so.1: error adding symbols: DSO missing from command line"
It looks like a DSO issue. Maybe I miss some prefix parameters in configure or make? I can't find a way to fix it.
Many thanks for your help.

mubb
Posts: 1
Joined: Sun Nov 18, 2018 12:17 pm

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

Sun Nov 18, 2018 12:35 pm

Hi all,

It looks like i'm not the only one trying to get HDMI recording to work on Pi !
Unfortunately, i have absolutely no knowledge in video driver, advanced linux kernels and such... i just expected to be able to record an HDMI feed using the B102 board from auvideo and the standard PiCamera() commands.

And it actually hasn't been going that bad...:
- using a clean install of raspbian stretch on pi zero w
- using a mac as source, i've been recording good video and image (with auto resolution detection)
- using the hdmi source (that i really want to record), i've been capturing *some* video, but the resolution is not right, and it only works the first time i use the python piCamera() commands after startup, and never when i try to record it again without a proper shutdown (and power cable disconnect/reconnect). Otherwise i get the same error as samir_sogay on page 1 in 2013: "mmal: No data received from sensor. Check all connections, including the Sunny one on the camera board".

what i get : https://ibb.co/jDpGc0

PS: i'm not actually interested in video, for my project i'd like to capture one frame every 5 seconds and then i'll imageprocess it using OCR

I've tried reading through the thread but it doesn't look clear what i'm supposed to do from here....
- Run through this tutorial ? https://www.linux-projects.org/uv4l/installation/
- something about delaying EDID at launch ?

Thank you very much !

Jacky Chen
Posts: 9
Joined: Thu Sep 27, 2018 8:08 am

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

Mon Nov 19, 2018 5:59 am

If you want to use gstreamer or other V4L2 driver based application with B101or B102.
The first step is to check whether tc358743 V4L2 driver had been successfully updated. The yavta is a good way to check it.
Just following 6by9' steps to update system(the following steps is just for RPi3 B+ and B101)
download raspbian-2018-06-29
sudo apt-get update
sudo apt-get upgrade -y
sudo rpi-update
add cma=32M into /boot/cmdline.txt
add dtoverlay=tc358743 into /boot/config.txt
sudo reboot
sudo git clone https://github.com/6by9/yavta.git
wget https://raw.githubusercontent.com/6by9/ ... 50EDID.txt
sudo v4l2-ctl --set-edid=file=1080P50EDID.txt --fix-edid-checksums
sudo ./yavta --capture=1000 -n 3 --encode-to=file.h264 -f UYVY -m -T /dev/video0
The tc358743 V4L2 driver works very well with my Gopro4 and B101.
The Gopro5 indeed had some problem with B101. But it was not a V4L2 issue.
I had succefully compiled the lastest gstreamer and 6by9' gst-omx.
Over the next few days, I will check whether the new driver can work with Gstreamer.

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

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

Mon Nov 19, 2018 8:39 am

First of all, many thanks to everyone for the very informative thread! 6by9 - you're great! )

I've read the thread, and have a question regarding a quite special mode - I'd like to get a video from the 800x600_58 RGB source. Is this mode supported by B102? Just correct EDID file needed?

Thank you!

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7273
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

Mon Nov 19, 2018 11:13 am

mubb wrote:
Sun Nov 18, 2018 12:35 pm
It looks like i'm not the only one trying to get HDMI recording to work on Pi !
Unfortunately, i have absolutely no knowledge in video driver, advanced linux kernels and such... i just expected to be able to record an HDMI feed using the B102 board from auvideo and the standard PiCamera() commands.
You're asking for support from RPF for a third party product? That's backwards and unreasonable. Please go and ask for support from AuVidea that you bought the module from (others will tell you what response you can expect). Or do you ask Ford for support a 3rd party GPS in your car?

PiCamera supports the Pi camera modules, so OV5647 and IMX219.
(The number of these requests is pushing me towards putting a watermark on the first few seconds of video captured through the firmware drivers. The informational message from raspivid obviously isn't sufficient.)
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”