sorbonne
Posts: 49
Joined: Thu Jan 14, 2016 10:25 am

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

Wed Mar 15, 2017 1:29 pm

Orbital6 wrote:Did you ever manage to get the b101 working? If not then you may have a problem with the physical connection, as that's when i saw that error most.
Sadly, I never managed to get it work with the latest software of everything. What kind of physical connection could it be in your opinion?

The only other thing I ultimately tried is to send a software reset the card with the official script in the repo (that internally runs gpio). The LED turned on and i2cdetect -y 0 showed something (0f), but the ENOSPC error was still there after running raspivid.

Orbital6
Posts: 124
Joined: Sat Aug 08, 2015 6:32 pm

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

Wed Mar 15, 2017 1:35 pm

possibly the ribbon, HPD or DDC. You want to see above 2V on HPD when raspivid or the app is running, and you want to see sporadic activity on the DDC lines when you first call the app.

I do advise you to try the userapp first otherwise those in the know may be reluctant to help.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4595
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 Mar 15, 2017 2:07 pm

sorbonne wrote:
6by9 wrote:Ongoing development by Orbital6 and myself has been merged to https://github.com/6by9/userland/tree/hdmi_in_hack. Still unofficial, but almost all in the open, and should be automatically detecting the input resolution and adopting it so no restriction on 720P.
Many thanks for your hard work on this. Are you talking about using this in particular, right (not the version of raspivid in that branch)?
https://github.com/6by9/userland/blob/h ... tc358743.c
Yes.
sorbonne wrote:Thanks, I will try the above as well. My aim for now is to (try) to push raspivid to its *actual* limits (720p would be ok) and switch to the new software if it's absolutely necessary. The thing is that I am already using raspivid everywhere in my deployments and want to postpone any software changes in the future if possible.
"Everywhere in your deployments"? With B101? You're obviously not risk adverse then :shock:
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

sorbonne
Posts: 49
Joined: Thu Jan 14, 2016 10:25 am

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

Wed Mar 15, 2017 6:36 pm

Orbital6 wrote:I do advise you to try the userapp first otherwise those in the know may be reluctant to help.
Sorry guys, but I am 100% confused now. What should I expect from the raspi_tc358743 binary?

It terminates immediately right after printing out this:
pi@raspberrypi:~ $ userland/build/bin/raspi_tc358743 -t 0
Filename is test_encode.h264
Playing back indefinitely
I double checked my connection and cables and everything looks okay.

If I first run the script in the hdmi_hack_in branch I can turn on the LED which should indicate that a software RESET has been done, if I am not wrong:
pi@raspberrypi:~ $ ./script.sh
setting GPIO for board revsion: a02082
Raspberry Pi3
Set state of 133 to 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- 0f
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

pi@raspberrypi:~ $ sudo vcdbg log msg
001396.972: HDMI:EDID version 1.3, 1 extensions, screen size 48x27 cm
001397.038: HDMI:EDID features - videodef 0x80 !standby !suspend active off; colour encoding:RGB444|YCbCr444|YCbCr422; sRGB is default colourspace; preferred format is native; does not support GTF
001397.100: HDMI:EDID found preferred CEA detail timing format: 1920x1080p @ 60 Hz (16)
001397.143: HDMI:EDID found DMT format: code 4, 640x480p @ 60 Hz in established timing I/II
001397.180: HDMI:EDID found DMT format: code 6, 640x480p @ 75 Hz in established timing I/II
001397.219: HDMI:EDID found DMT format: code 9, 800x600p @ 60 Hz in established timing I/II
001397.257: HDMI:EDID found DMT format: code 11, 800x600p @ 75 Hz in established timing I/II
001397.297: HDMI:EDID found DMT format: code 16, 1024x768p @ 60 Hz in established timing I/II
001397.337: HDMI:EDID found DMT format: code 18, 1024x768p @ 75 Hz in established timing I/II
001397.378: HDMI:EDID found DMT format: code 36, 1280x1024p @ 75 Hz in established timing I/II
001397.466: HDMI:EDID standard timings block x 8: 0xD1C0 81C0 8100 8180 A9C0 B300 0101 0101
001397.531: HDMI:EDID found DMT format: code 82, 1920x1080p @ 60 Hz (16:9) in standard timing 0
001397.588: HDMI:EDID found DMT format: code 85, 1280x720p @ 60 Hz (16:9) in standard timing 1
001397.637: HDMI:EDID found DMT format: code 28, 1280x800p @ 60 Hz (16:10) in standard timing 2
001397.688: HDMI:EDID found DMT format: code 35, 1280x1024p @ 60 Hz (5:4) in standard timing 3
001397.743: HDMI:EDID found DMT format: code 83, 1600x900p @ 60 Hz (16:9) in standard timing 4
001397.796: HDMI:EDID found DMT format: code 58, 1680x1050p @ 60 Hz (16:10) in standard timing 5
001410.810: HDMI:EDID parsing v3 CEA extension 0
001410.850: HDMI:EDID monitor support - underscan IT formats:yes, basic audio:yes, yuv444:yes, yuv422:yes, #native DTD:1
001410.895: HDMI:EDID found CEA detail timing format: 1920x1080p @ 60 Hz (16)
001410.939: HDMI:EDID found CEA detail timing format: 1920x1080i @ 60 Hz (5)
001410.980: HDMI:EDID found CEA detail timing format: 1280x720p @ 60 Hz (4)
001411.021: HDMI:EDID found CEA detail timing format: 720x480p @ 60 Hz (2)
001411.060: HDMI:EDID found CEA format: code 16, 1920x1080p @ 60Hz (native)
001411.095: HDMI:EDID found CEA format: code 31, 1920x1080p @ 50Hz
001411.127: HDMI:EDID found CEA format: code 5, 1920x1080i @ 60Hz
001411.162: HDMI:EDID found CEA format: code 20, 1920x1080i @ 50Hz
001411.195: HDMI:EDID found CEA format: code 4, 1280x720p @ 60Hz
001411.228: HDMI:EDID found CEA format: code 19, 1280x720p @ 50Hz
001411.261: HDMI:EDID found CEA format: code 3, 720x480p @ 60Hz
001411.295: HDMI:EDID found CEA format: code 18, 720x576p @ 50Hz
001411.328: HDMI:EDID found CEA format: code 7, 1440x480i @ 60Hz
001411.361: HDMI:EDID found CEA format: code 22, 1440x576i @ 50Hz
001411.395: HDMI:EDID found CEA format: code 21, 1440x576i @ 50Hz
001411.428: HDMI:EDID found CEA format: code 1, 640x480p @ 60Hz
001411.461: HDMI:EDID found CEA format: code 6, 1440x480i @ 60Hz
001411.495: HDMI:EDID found CEA format: code 17, 720x576p @ 50Hz
001411.526: HDMI:EDID found CEA format: code 2, 720x480p @ 60Hz
001411.580: HDMI:EDID found audio format 2 channels PCM, sample rate: 32|44|48 kHz, sample size: 16|20|24 bits
001411.600: HDMI:EDID found HDMI VSDB length 5
001411.626: HDMI:EDID HDMI VSDB has physical address 1.0.0.0
001411.643: HDMI:EDID HDMI VSDB has no extension fields
001411.686: HDMI:EDID filtering formats with pixel clock > 162 MHz or h. blanking > 1023
001411.864: HDMI:EDID preferred mode remained as CEA (16) 1920x1080p @ 60 Hz with pixel clock 148 MHz
001427.180: HDMI:Setting property pixel encoding to Default
001427.201: HDMI:Setting property pixel clock type to PAL
001427.220: HDMI:Setting property content type flag to No data
001427.240: HDMI:Setting property fuzzy format match to enabled
001671.428: hdmi: HDMI:>>>>>>>>>>>>>Rx sensed, reading EDID<<<<<<<<<<<<<
001683.493: hdmi: HDMI:EDID version 1.3, 1 extensions, screen size 48x27 cm
001683.564: hdmi: HDMI:EDID features - videodef 0x80 !standby !suspend active off; colour encoding:RGB444|YCbCr444|YCbCr422; sRGB is default colourspace; preferred format is native; does not support GTF
001683.630: hdmi: HDMI:EDID found preferred CEA detail timing format: 1920x1080p @ 60 Hz (16)
001683.676: hdmi: HDMI:EDID found DMT format: code 4, 640x480p @ 60 Hz in established timing I/II
001683.716: hdmi: HDMI:EDID found DMT format: code 6, 640x480p @ 75 Hz in established timing I/II
001683.758: hdmi: HDMI:EDID found DMT format: code 9, 800x600p @ 60 Hz in established timing I/II
001683.799: hdmi: HDMI:EDID found DMT format: code 11, 800x600p @ 75 Hz in established timing I/II
001683.843: hdmi: HDMI:EDID found DMT format: code 16, 1024x768p @ 60 Hz in established timing I/II
001683.886: hdmi: HDMI:EDID found DMT format: code 18, 1024x768p @ 75 Hz in established timing I/II
001683.930: hdmi: HDMI:EDID found DMT format: code 36, 1280x1024p @ 75 Hz in established timing I/II
001684.020: hdmi: HDMI:EDID standard timings block x 8: 0xD1C0 81C0 8100 8180 A9C0 B300 0101 0101
001684.090: hdmi: HDMI:EDID found DMT format: code 82, 1920x1080p @ 60 Hz (16:9) in standard timing 0
001684.149: hdmi: HDMI:EDID found DMT format: code 85, 1280x720p @ 60 Hz (16:9) in standard timing 1
001684.204: hdmi: HDMI:EDID found DMT format: code 28, 1280x800p @ 60 Hz (16:10) in standard timing 2
001684.258: hdmi: HDMI:EDID found DMT format: code 35, 1280x1024p @ 60 Hz (5:4) in standard timing 3
001684.317: hdmi: HDMI:EDID found DMT format: code 83, 1600x900p @ 60 Hz (16:9) in standard timing 4
001684.374: hdmi: HDMI:EDID found DMT format: code 58, 1680x1050p @ 60 Hz (16:10) in standard timing 5
001697.392: hdmi: HDMI:EDID parsing v3 CEA extension 0
001697.436: hdmi: HDMI:EDID monitor support - underscan IT formats:yes, basic audio:yes, yuv444:yes, yuv422:yes, #native DTD:1
001697.485: hdmi: HDMI:EDID found CEA detail timing format: 1920x1080p @ 60 Hz (16)
001697.531: hdmi: HDMI:EDID found CEA detail timing format: 1920x1080i @ 60 Hz (5)
001697.575: hdmi: HDMI:EDID found CEA detail timing format: 1280x720p @ 60 Hz (4)
001697.620: hdmi: HDMI:EDID found CEA detail timing format: 720x480p @ 60 Hz (2)
001697.662: hdmi: HDMI:EDID found CEA format: code 16, 1920x1080p @ 60Hz (native)
001697.700: hdmi: HDMI:EDID found CEA format: code 31, 1920x1080p @ 50Hz
001697.735: hdmi: HDMI:EDID found CEA format: code 5, 1920x1080i @ 60Hz
001697.774: hdmi: HDMI:EDID found CEA format: code 20, 1920x1080i @ 50Hz
001697.810: hdmi: HDMI:EDID found CEA format: code 4, 1280x720p @ 60Hz
001697.847: hdmi: HDMI:EDID found CEA format: code 19, 1280x720p @ 50Hz
001697.883: hdmi: HDMI:EDID found CEA format: code 3, 720x480p @ 60Hz
001697.920: hdmi: HDMI:EDID found CEA format: code 18, 720x576p @ 50Hz
001697.957: hdmi: HDMI:EDID found CEA format: code 7, 1440x480i @ 60Hz
001697.994: hdmi: HDMI:EDID found CEA format: code 22, 1440x576i @ 50Hz
001698.031: hdmi: HDMI:EDID found CEA format: code 21, 1440x576i @ 50Hz
001698.068: hdmi: HDMI:EDID found CEA format: code 1, 640x480p @ 60Hz
001698.104: hdmi: HDMI:EDID found CEA format: code 6, 1440x480i @ 60Hz
001698.142: hdmi: HDMI:EDID found CEA format: code 17, 720x576p @ 50Hz
001698.177: hdmi: HDMI:EDID found CEA format: code 2, 720x480p @ 60Hz
001698.234: hdmi: HDMI:EDID found audio format 2 channels PCM, sample rate: 32|44|48 kHz, sample size: 16|20|24 bits
001698.258: hdmi: HDMI:EDID found HDMI VSDB length 5
001698.288: hdmi: HDMI:EDID HDMI VSDB has physical address 1.0.0.0
001698.308: hdmi: HDMI:EDID HDMI VSDB has no extension fields
001698.355: hdmi: HDMI:EDID filtering formats with pixel clock > 162 MHz or h. blanking > 1023
001698.539: hdmi: HDMI:EDID preferred mode remained as CEA (16) 1920x1080p @ 60 Hz with pixel clock 148 MHz
001698.562: hdmi: HDMI: hotplug attached with HDMI support
001698.602: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
001701.028: hdmi: HDMI: power_on to CEA mode 1080p60
001704.212: hdmi: HDMI: Action callback added to queue to happen at frame 2
001704.234: hdmi: HDMI: Action stop_3d_mode added to queue to happen at frame 2
001704.258: hdmi: HDMI: Action unmute added to queue to happen at frame 3
001704.285: hdmi: HDMI: Action cec_init added to queue to happen at frame 3
001756.828: *** Restart logging
001759.341: Read command line from file 'cmdline.txt'
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
002094.608: Loading 'kernel7.img' to 0x8000 size 0x409fd8
002098.268: No kernel trailer (run mkknlimg to fix) - assuming DT-capable
002105.043: Loading 'bcm2710-rpi-3-b.dtb' to 0x411fd8 size 0x3e78
002206.588: dtparam: i2c_arm=on
002216.660: dtparam: audio=on
003274.061: Device tree loaded to 0x1efebd00 (size 0x42c5)
003279.692: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
004037.446: vchiq_core: vchiq_init_state: slot_zero = 0xde880000, is_master = 1
004041.990: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
004047.802: TV service:host side not connected, dropping notification 0x00000002, 0x00000001, 0x00000010
008432.988: camsubs: Looking for camera 0: i2c_port = 0, led gpio = 134, power enable gpio = 133
008433.714: camsubs: Camera not found
008433.757: camsubs: Looking for camera 0: i2c_port = 0, led gpio = 134, power enable gpio = 133
008434.474: camsubs: Camera not found
008434.510: camsubs: Looking for camera 0: i2c_port = 0, led gpio = 134, power enable gpio = 133
008435.040: camsubs: Camera found OK
008440.462: gpioman: gpioman_get_pin_num: pin CAMERA_LED not defined
Both the camera and the I2C stuff have been initially enabled with raspi-config.
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.4.50-v7+ #970 SMP Mon Feb 20 19:18:29 GMT 2017 armv7l GNU/Linux
What else should I do?
Last edited by sorbonne on Wed Mar 15, 2017 6:41 pm, edited 1 time in total.

Orbital6
Posts: 124
Joined: Sat Aug 08, 2015 6:32 pm

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

Wed Mar 15, 2017 6:38 pm

can you try on a pi 1 or 2?

Tavalin
Posts: 59
Joined: Mon Apr 16, 2012 9:53 pm

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

Wed Mar 15, 2017 6:56 pm

Apologies if this has already been addressed...

I would like to use the B101 to replace a USB grabber in my Hyperion Ambilighting set up. As I understand it, the USB grabber is presented as a video capture device via v4l drivers. Hypothetically if a v4l driver existed for this chip/B101, would the B101 be presented as a video capture device in the same way?

If the answer is yes, is that on anyone's radar here or is that down to Auvidea to provide?

Thanks

Orbital6
Posts: 124
Joined: Sat Aug 08, 2015 6:32 pm

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

Wed Mar 15, 2017 7:00 pm

Tavalin wrote: If the answer is yes, is that on anyone's radar here or is that down to Auvidea to provide?
Auvidea don't do software. At least not for the B1xx.

Tavalin
Posts: 59
Joined: Mon Apr 16, 2012 9:53 pm

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

Wed Mar 15, 2017 7:21 pm

OK thanks.

Given the work that has been done on raspivid and raspi_tc358743 so far, have you any thoughts on how feasible a v4l driver is? I'm trying to get a feel for whether you can use a B101 for this purpose.

Orbital6
Posts: 124
Joined: Sat Aug 08, 2015 6:32 pm

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

Wed Mar 15, 2017 7:22 pm

Tavalin wrote:OK thanks.

Given the work that has been done on raspivid and raspi_tc358743 so far, have you any thoughts on how feasible a v4l driver is? I'm trying to get a feel for whether you can use a B101 for this purpose.
6by9 is the man with the answers :lol:

sorbonne
Posts: 49
Joined: Thu Jan 14, 2016 10:25 am

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

Wed Mar 15, 2017 9:52 pm

Orbital6 wrote:can you try on a pi 1 or 2?
Same as before:

pi@raspberrypi:~ $ ./script.sh
setting GPIO for board revsion: a01041
A+, B+, and B2 all revisions - I2C 0 on GPIOs 28 & 29. GPIOs 32 & 41 for LED and power

Code: Select all

pi@raspberrypi:~ $ userland/build/bin/raspi_tc358743 
Filename is test_encode.h264
Playing back indefinitely
Please help.

sorbonne
Posts: 49
Joined: Thu Jan 14, 2016 10:25 am

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

Wed Mar 15, 2017 9:53 pm

Orbital6 wrote:can you try on a pi 1 or 2?
RPI2, Same as before:

Code: Select all

pi@raspberrypi:~ $ ./script.sh 
setting GPIO for board revsion: a01041
A+, B+, and B2 all revisions - I2C 0 on GPIOs 28 & 29. GPIOs 32 & 41 for LED and power

Code: Select all

pi@raspberrypi:~ $ userland/build/bin/raspi_tc358743 
Filename is test_encode.h264
Playing back indefinitely
Please help.

Orbital6
Posts: 124
Joined: Sat Aug 08, 2015 6:32 pm

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

Wed Mar 15, 2017 9:57 pm

probe the HDP and DDC lines. If they're good then the B101 unit is fine.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4595
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 Mar 16, 2017 2:56 pm

Orbital6 wrote:
Tavalin wrote:OK thanks.

Given the work that has been done on raspivid and raspi_tc358743 so far, have you any thoughts on how feasible a v4l driver is? I'm trying to get a feel for whether you can use a B101 for this purpose.
6by9 is the man with the answers :lol:
A V4L2 subdevice for the CSI2 receiver is in progress, and now that I'm employed by Pi Towers I'm actually getting time to work on it.

There is already a TC358743 V4L2 subdevice driver upstream (which is where this particular thread started), so you'll need a V4L2 app and not raspi_tc358743 or raspivid.
Whether a straight cheese or similar app will work waits to be seen. The driver needs an EDID to be provided, although only once per boot and v4l2-ctl should be able to do it from a file. It will also be advertising resolution changes. Exactly how that is handled if the app ignores these is likely undefined (probably uninitialised data, or cropping).
There's also no video encoding options in V4L2, solely receiving the incoming data. There's nothing stopping you sending the V4L2 frames into the encoder (if they're in an appropriate format), although the memory usage optimisation on that is my task after the V4L2 driver.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Tavalin
Posts: 59
Joined: Mon Apr 16, 2012 9:53 pm

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

Thu Mar 16, 2017 10:37 pm

Thanks 6by9.

Just so I'm clear (and please explain like I'm stupid):

What's the difference between the subdevice for the CSI-2 receiver and the subdevice for the TC358743?

My fairly naive and probably ignorant understanding is that the TC358743 chip takes in a HDMI feed and outputs CSI-2 data.

Does this mean we need a driver (what you referred to as the TC358743 V4L2 subdevice driver upstream) to control the TC358743 chip and make it output sensible CSI-2 data from the HDMI input and then a second driver (the bit you're currently looking at) that takes the CSI-2 output and exposes as a V4L2 video capture stream?

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

Fri Mar 17, 2017 7:36 am

Tavalin wrote:Just so I'm clear (and please explain like I'm stupid):

What's the difference between the subdevice for the CSI-2 receiver and the subdevice for the TC358743?

My fairly naive and probably ignorant understanding is that the TC358743 chip takes in a HDMI feed and outputs CSI-2 data.

Does this mean we need a driver (what you referred to as the TC358743 V4L2 subdevice driver upstream) to control the TC358743 chip and make it output sensible CSI-2 data from the HDMI input and then a second driver (the bit you're currently looking at) that takes the CSI-2 output and exposes as a V4L2 video capture stream?
Keeping it modular.
The TC358743 needs controlling, and converts HDMI into a CSI2 signal. That is still external to the SoC so not much use.
The CSI-2 receiver subdevice controls the SoC, taking CSI-2 into memory buffers. It doesn't care that in this conversation we're talking about TC358743, there are drivers for multiple CSI-2 sources available (look in https://github.com/raspberrypi/linux/tr ... /media/i2c. OV5647/Pi camera V1 is in the process of being merged, and IMX219/Pi Camera V2 is on my list).

For the official docs on V4L2 subdevices, read https://linuxtv.org/downloads/v4l-dvb-a ... ubdev.html. Pi won't support a "host scaler" as shown in that diagram as the "host frontend" (the bit I'm talking about here) has to write direct to memory, and only the "V4L I/O" block has any buffer management. There are V4L memory-to-memory devices (normally video codecs or similar), and it may be that the ISP (resize/format conversion) can be done as one of those - we shall see.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

hblanken
Posts: 6
Joined: Fri May 06, 2016 11:43 am

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

Tue Apr 18, 2017 10:04 am

I have recently received the Auvidea B101 Rev 4 with audio - The Auvidea guide does not provide much info. Is anyone able to help to find a tutorial to connect the cables to the correct Pi GPIOs and examples on how to receive audio input to eg. ffmpeg or other tools? Thanks!

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

Fri May 19, 2017 11:58 am

A call for beta testers.
I now have the CSI2 receiver driver working from the kernel with the TC358743 driver :D

If you have a board with TC358743 on (eg Auvidea B100/101/102), some Linux developing/debugging skills, and some spare time, then could you drop me an email at dave.stevenson at raspberrypi dot org? I'm only after a couple of people at the moment to try throwing a range of sources (up to 1080P30) at it. I really need to shift on to getting the data further down the pipe (RGB888 and UYVY and not the easiest formats to process, so this needs to integrate into MMAL efficiently).
Thanks.

NB HDMI Audio is NOT supported, and I'm not sure what the best approach would be to get it into the system seeing as the driver is part of VIDEO for Linux 2. The exsiting driver routes the data to the I2S output of the TC358743, which isn't linked up to anything.
Last edited by 6by9 on Tue Sep 05, 2017 9:02 am, edited 1 time in total.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

auvidea
Posts: 13
Joined: Sun Nov 24, 2013 6:57 pm

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

Tue Jun 20, 2017 3:21 pm

Hi Dave,

this is great work. :-) I would be very interested in testing the beta driver. How can I get hold of it?

Just recently we introduced new versions of the B101 and B102, where we added an 8 pin connector for I2S audio, reset and cable detect. These signals can be routed to the appropriate pins of the Raspberry GPIO connector. We include the right cable set for this connection.

Also we have designed the R100, which is a carrier board for the Raspberry compute module 3 (CM3). It integrates the B102, which is connected via 4 CISI-2 lanes to the CM3. Do you see an advantage in using 4 lanes rather than the standard 2 lanes of the RPi camera connector? We are currently sampling the R100 to beta customers. I would be happy to send you one, if you are interested.

On the R100 the I2S audio is connected to the I2S lines of the CM3. However we have not tested this yet. It would be great, if you could have a look.

Below there are two pictures of the R100. The top one shows the cable connections:
1. top left: HDMI input to the integrated "B102"
2. bottom left: USB type B connector for USB to UART bridge - alternatively: USB OTG mode to emulate mouse and keyboard (FTDI FT260Q)
3. top right: 100BT Ethernet RJ45 connector
4. bottom right: USB 2.0 type A connector to the CM3 (for USB memory or LTE stick)
5. there is an extra USB 2.0 connector (J8) - we have integrated the LAN9512

regards, Jurgen

Image
Image

Orbital6
Posts: 124
Joined: Sat Aug 08, 2015 6:32 pm

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

Tue Jun 20, 2017 3:29 pm

auvidea wrote:...
Hi Jurgen, I've been trying to get 4 lanes working to allow 1080p50 to work, as i've also been helping Dave with the beta testing, as far as i know i'm the only one that's got audio working too so it won't be a bad idea if you redirect your offers for beta testing to me ;) (you seem to have ignored my previous emails).

auvidea
Posts: 13
Joined: Sun Nov 24, 2013 6:57 pm

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

Tue Jun 20, 2017 3:53 pm

Hi Orbital5, thank you for the fast reply. Sorry that I have ignored your previous emails. This was not intentional. Yes, I am happy to support you with a beta board. I would propose that you send me an email to my Auvidea email address. Regards, Jurgen

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

Tue Jun 20, 2017 4:10 pm

auvidea wrote:this is great work. :-) I would be very interested in testing the beta driver. How can I get hold of it?
As per my post, please email me.
It's not that I'm wanting to keep the driver closed, but mainly so that I know who I'm supporting as there are awkward corners (things like configuring I2C busses which vary depending on the version of Pi in use). There are some hoops to jump through to get V4L2 to work correctly too.

The first patch set has been posted to the linux-media mailing list, and I'm just finishing off dealing with the comments/discussions from that. V2 should be tomorrow. Working with the upstream kernel is a bit of a pain though as things like DT overlays don't work. Once I've sent V2 I'll backport it to a testing Pi specific tree which is a little easier.
I also have a hybrid test app that is routing the V4L2 back into MMAL for resize (using the ISP) and display. Adding video encode should only be a plumbing job in the app, but I haven't had time to do that as yet.
auvidea wrote:Just recently we introduced new versions of the B101 and B102, where we added an 8 pin connector for I2S audio, reset and cable detect. These signals can be routed to the appropriate pins of the Raspberry GPIO connector. We include the right cable set for this connection.

Also we have designed the R100, which is a carrier board for the Raspberry compute module 3 (CM3). It integrates the B102, which is connected via 4 CISI-2 lanes to the CM3. Do you see an advantage in using 4 lanes rather than the standard 2 lanes of the RPi camera connector? We are currently sampling the R100 to beta customers. I would be happy to send you one, if you are interested.
It would be interesting to have one as a reference, likewise a B102 as our board is only 2 lane.
Sorry, at the moment I haven't time to look at audio. The kernel driver for the TC358743 in theory is set up for I2S audio, but I have no idea as to extra magic required.

I have done the calcs already on 2 vs 4 lanes.
2 lanes at ~910Mbit/s per lane should be sufficient to get 1080P50 UYVY down, which would be quite nice even if it requires an overclock on the codec block (only designed for 1080P30). 1080P60 or 1080P50 RGB24 is just beyond the available bandwidth on 2 lanes. The chroma subsampling of YUV4:2:2 is unlikely to be noticeable, particularly as most people will H264 encode which is YUV4:2:0.
The followup question is what you would do with 1080P60 seeing as it is double what the codec can cope with.....

Having said all that, the current kernel driver is only set up to run at 594Mbps/lane which just falls short for 720P60 RGB3 (again it is OK with UYVY). I need to update the DT overlays to increase the link frequency and see what I can get, but it's a balancing act in order to still handle the lower resolutions.
Based on correspondence with those on linux-media I get the impression that 720P60 on 2 lanes and 1080P60 on 4 lanes, both as UYVY are the only modes that have really been used. There's no reason why other resolutions/framerates won't work, but the TC358743 needs some little tweaks.
auvidea wrote:On the R100 the I2S audio is connected to the I2S lines of the CM3. However we have not tested this yet. It would be great, if you could have a look.
As I say, I haven't got the spare time to look at audio at the moment. I know Orbital6 was looking at it but I can't recall where he got to.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Orbital6
Posts: 124
Joined: Sat Aug 08, 2015 6:32 pm

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

Sat Jun 24, 2017 1:17 pm

auvidea wrote:...
Regarding the R100, I assume you tested with raspivid?

Did you make these connections:

CD0_SDA to GPIO44.
CD0_SCL to GPIO45
CAM0_IO1 to GPIO2
CAM0_IO0 to GPIO3

6by9 can confirm, but i think these connections needed to be made to work with the new userspace app, though I'm sure he can confirm if there's an overlay to reroute the i2c pins successfully as i think you routed i2c to pins 28 29.

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

Sun Jun 25, 2017 8:00 am

Orbital6 wrote:
auvidea wrote:...
Regarding the R100, I assume you tested with raspivid?

Did you make these connections:

CD0_SDA to GPIO44.
CD0_SCL to GPIO45
CAM0_IO1 to GPIO2
CAM0_IO0 to GPIO3

6by9 can confirm, but i think these connections needed to be made to work with the new userspace app, though I'm sure he can confirm if there's an overlay to reroute the i2c pins successfully as i think you routed i2c to pins 28 29.
As long as the TC358743 is routed to one of the pairs of I2C connections (0&1, 28&29, or 44&45) then things can be made to work. The Compute Module is set up to allow flexibility.
The suggested normal wiring for one "camera" is actually to GPIOs 0&1, but seeing as you have to generate a dt-blob.bin you can set it up any way you like.
The driver can handle a signal connected to the reset line of the TC358743, but none of the other versions have used it, so CAM_IO[0|1] are redundant for this chip.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

auvidea
Posts: 13
Joined: Sun Nov 24, 2013 6:57 pm

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

Mon Jun 26, 2017 2:27 pm

Hi, in the R100 the TC358743 chip is connected to the CAM1 port. So we have connected SCL to GPIO1 and SDA to GPIO0. GPIO 5 drives an LED (CAM1_IO0). GPIO 4 (CAM1_IO1) could be used to monitor the 5V on the HDMI cable (like a cable detect). However a resistor (R15) would need to be soldered. The RESET of the TC358743 is not connected. By adding R19 it would connect to GPIO4. Then the LED would reflect the RESET state. A RESET is automatically generated with an RC circuit at power up. Regards, Jurgen

User avatar
RichShumaker
Posts: 147
Joined: Tue Jul 31, 2012 4:16 pm
Location: Sunny Southern CA near downtown LA
Contact: Website

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

Tue Jun 27, 2017 6:05 am

As I always seem to start these thread posts THANKS 6by9 for all you do.

Now I have a simple question, does the HDMI to CSI workflow work currently?
I read thru a lot of the posts and I was just looking for a simple, "yes it works do this" and I was having a hard time finding that.
Is there a Wiki or place with more details on setup and usage?

Thanks everyone for all the hard work getting this going.
I had dropped External Video Inputs into the Pi using the GPU several years ago so I am excited that it has been active for as long as it has.

Have an amazing and awesome day everyone.

Rich Shumaker
Rich Shumaker

Return to “Graphics, sound and multimedia”

Who is online

Users browsing this forum: No registered users and 7 guests