6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5808
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 Oct 16, 2018 7:56 am

andes wrote:
Tue Oct 16, 2018 2:04 am

Code: Select all

audio_present (bool)   : default=0 value=0 flags=read-only
There's no audio being received by the TC358743 over the HDMI link.
And because of that

Code: Select all

audio_sampling_rate (int)    : min=0 max=768000 step=1 default=0 value=0 flags=read-only
the sampling rate can't be identified.
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.

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

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

Wed Oct 17, 2018 4:38 pm

6by9 wrote:
Tue Oct 16, 2018 7:56 am
andes wrote:
Tue Oct 16, 2018 2:04 am

Code: Select all

audio_present (bool)   : default=0 value=0 flags=read-only
There's no audio being received by the TC358743 over the HDMI link.
And because of that

Code: Select all

audio_sampling_rate (int)    : min=0 max=768000 step=1 default=0 value=0 flags=read-only
the sampling rate can't be identified.
Thanks, I am not aware of DSP. Do you know how to fix it? I just play a video which contains audio on my camcorder and preview it as source though the B101 cable.

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

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

Sat Oct 20, 2018 12:52 pm

I re-installed Raspbian and did everything follow the tutorial. Now the audio_sampling_rate is 4800, but I still have the same error. Not sure what is wrong here :(

Code: Select all

[email protected]:~/MyFiles/Media $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: tc358743 [tc358743], device 0: bcm2835-i2s-dir-hifi dir-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

[email protected]:~ $ v4l2-ctl --list-ctrls

User Controls

            audio_sampling_rate (int)    : min=0 max=768000 step=1 default=0 value=48000 flags=read-only
                  audio_present (bool)   : default=0 value=1 flags=read-only

Digital Video Controls

                  power_present (bitmask): max=0x00000001 default=0x00000000 value=0x00000001 flags=read-only


[email protected]:~ $ sudo arecord -D hw:1,0 -d 25 -f cd test2.wav
Recording WAVE 'test2.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
arecord: pcm_read:2103: read error: Input/output error
                 

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5808
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 Oct 20, 2018 2:55 pm

andes wrote:
Sat Oct 20, 2018 12:52 pm
I re-installed Raspbian and did everything follow the tutorial. Now the audio_sampling_rate is 4800, but I still have the same error. Not sure what is wrong here :(

Code: Select all

[email protected]:~/MyFiles/Media $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: tc358743 [tc358743], device 0: bcm2835-i2s-dir-hifi dir-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

[email protected]:~ $ v4l2-ctl --list-ctrls

User Controls

            audio_sampling_rate (int)    : min=0 max=768000 step=1 default=0 value=48000 flags=read-only
                  audio_present (bool)   : default=0 value=1 flags=read-only

Digital Video Controls

                  power_present (bitmask): max=0x00000001 default=0x00000000 value=0x00000001 flags=read-only


[email protected]:~ $ sudo arecord -D hw:1,0 -d 25 -f cd test2.wav
Recording WAVE 'test2.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
arecord: pcm_read:2103: read error: Input/output error
                 
It doesn't support sample rate conversion, hence why it tells you the sampling rate via V4L2. "-f cd" is 44.1kHz, whilst the source has said 48kHz. It therefore fails. "-f dat" should work.
I've never had to add the -D information either - you only have one audio capture device, so it will select it.
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.

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

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

Sun Oct 21, 2018 6:33 am

6by9 wrote:
Sat Oct 20, 2018 2:55 pm
andes wrote:
Sat Oct 20, 2018 12:52 pm
I re-installed Raspbian and did everything follow the tutorial. Now the audio_sampling_rate is 4800, but I still have the same error. Not sure what is wrong here :(

Code: Select all

[email protected]:~/MyFiles/Media $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: tc358743 [tc358743], device 0: bcm2835-i2s-dir-hifi dir-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

[email protected]:~ $ v4l2-ctl --list-ctrls

User Controls

            audio_sampling_rate (int)    : min=0 max=768000 step=1 default=0 value=48000 flags=read-only
                  audio_present (bool)   : default=0 value=1 flags=read-only

Digital Video Controls

                  power_present (bitmask): max=0x00000001 default=0x00000000 value=0x00000001 flags=read-only


[email protected]:~ $ sudo arecord -D hw:1,0 -d 25 -f cd test2.wav
Recording WAVE 'test2.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
arecord: pcm_read:2103: read error: Input/output error
                 
It doesn't support sample rate conversion, hence why it tells you the sampling rate via V4L2. "-f cd" is 44.1kHz, whilst the source has said 48kHz. It therefore fails. "-f dat" should work.
I've never had to add the -D information either - you only have one audio capture device, so it will select it.
Thanks, I replaced "-f cd" with "-f dat" and it worked! But just one time. I tried to record again and got the same error as before, audio sampling rate is gone. After rebooting, it remains as 0.

EDIT: Need to reload EDID file after rebooting to reconfigure video/audio sampling rates. But I don't understand what for? My input video is mHD and it should be played with default setting, why do I need to load EDID file of full HD mode?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5808
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 Oct 22, 2018 1:11 pm

andes wrote:
Sun Oct 21, 2018 6:33 am
Thanks, I replaced "-f cd" with "-f dat" and it worked! But just one time. I tried to record again and got the same error as before, audio sampling rate is gone. After rebooting, it remains as 0.

EDIT: Need to reload EDID file after rebooting to reconfigure video/audio sampling rates. But I don't understand what for? My input video is mHD and it should be played with default setting, why do I need to load EDID file of full HD mode?
Please try to avoid posting edits with significant updates - I'd read the post before you'd edited it, and the edit does not then mark the post as unread, so I assumed I'd seen everything you had written.

The EDID is stored in the TC358743 chip. Every time you reboot the Pi the chip gets fully reinitialised, and therefore needs to be provided with an EDID.
Every time you disconnect and reconnect an HDMI source, the source will read the EDID and determine what mode to use, so the TC358743 needs to have something valid stored in it.

You can use udev to run a script when devices are loaded. Either devices /devices/platform/soc/3f801000.csi1/video4linux/v4l-subdev0 or /devices/platform/soc/3f801000.csi1/video4linux/video0 would be a sensible ones to hook off. (Probably ../video0 as that is the easiest one to call v4l2-ctl on). Please google for "udev run script on connecting device" for examples. That way the EDID can be automatically loaded as the driver is loaded.
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: 140
Joined: Sat Aug 08, 2015 6:32 pm

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

Mon Oct 22, 2018 3:13 pm

I've just been reading the past few pages of this thread.

It's been a long time since i've been here, and given i spent so long working on this a year or so ago, I'm now very keen on knowing if you got audio working and properly muxed with the video (without using the dirty existing methods i've been using).

You've done brilliant work 6by9.

Lastly, is the app ready to use? I want to see if it's ready use to pipe and feed the video through UDP via ffmpeg.

Again, great work.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5808
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 Oct 22, 2018 3:24 pm

Orbital6 wrote:
Mon Oct 22, 2018 3:13 pm
It's been a long time since i've been here, and given i spent so long working on this a year or so ago, I'm now very keen on knowing if you got audio working and properly muxed with the video (without using the dirty existing methods i've been using).
You've done brilliant work 6by9.

Lastly, is the app ready to use? I want to see if it's ready use to pipe and feed the video through UDP via ffmpeg.
[/quote]
The intent is to ditch using any specialist app and use GStreamer, at which point all sync issues become pretty much solved. You do need to do the EDID and mode selection stuff manually though.

V4L2 codec drivers are imminent, which allows zero copy between v4l2src and v4l2h264enc components. video_encode now natively accepts a larger range of formats by internally using the ISP (including the YUYV family, and RGB), so no need for extra conversion steps unless you want to display stuff (the HVS can't accept YUYV).

I do recognise that some people just want raspivid but for this device, so I have got sufficiently hacked off to start taking raspivid and replacing the camera component with V4L2. At least that way people get the same command line options, but independent audio.
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: 140
Joined: Sat Aug 08, 2015 6:32 pm

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

Mon Oct 22, 2018 3:27 pm

Great, thanks for the update.

So if i was after a auto-muxed video and audio piped to UDP, i should wait just a little longer?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5808
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 Oct 22, 2018 4:06 pm

Orbital6 wrote:
Mon Oct 22, 2018 3:27 pm
Great, thanks for the update.

So if i was after a auto-muxed video and audio piped to UDP, i should wait just a little longer?
Hopefully.
I haven't played too much with the audio codecs under GStreamer, but hopefully it should all fall out easily (famous last words).
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.

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

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

Wed Oct 24, 2018 10:26 pm

Hi all, I've read the whole topic carefully (I am just a semi-IT guy and know nothing about chip programming) and here is what I got:
1) Assume that I have a system: camcorder --> HDMI cable --> B101 module --> Raspberry Pi 3.
2) TC358743 chip on B101 module needs to load EDID right after booting to configure what resolutions/framerates it can handle as input.
3) When the video source is connected to Rasberry Pi throught HDMI cable and B101 module, the TC chip will try to pick one supported resolution/framerate which is closest to the resolution/framerate of the source video. Is it correct?
4) Then if we want to record/stream the video from B101 module using video frameworks (like ffmpef, gstreamer, etc...), we can set the resolution/framerate later depends on how much power/flexible the frameworks are. Is it correct?

So now I face a issue in step 4: After trying to record video with command

Code: Select all

./yavta --capture=1000 -n 3 --encode-to=file.h264 -f UYVY -m -T /dev/video0
I realized that the recorded video file.h264 is always 25fps with YUYV filter. Maybe that is why people confirm B101 works only with 25fps input? And unfortunately my camcorder output video at 50fps with RGB filter, so omxplayer plays the video file.h264 like with a 2x speed. I also tried to use MPC-HC player on my Windows computer and surprisingly the video file.h264 ran as same as in my camcorder. The issue happens even when I already set the camcorder as 720p50fps.
Could you please advice me how to change the framerate for recording/streaming to avoid the issue? I found one solution 6by9 suggested in the page 3

Code: Select all

./raspivid -pts timecodes.txt -o file.h264
mkvmerge -o file.mkv --timecodes 0:timecodes.txt file.h264
but I didn't try it yet because raspivid doesn't work with the lastest kernel driver and encoding file.h264 may be not suitable as I want to stream in real-time what I get from the camcorder. I really appreciate your help.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5808
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 Oct 25, 2018 9:45 am

andes wrote:
Wed Oct 24, 2018 10:26 pm
Hi all, I've read the whole topic carefully (I am just a semi-IT guy and know nothing about chip programming) and here is what I got:
1) Assume that I have a system: camcorder --> HDMI cable --> B101 module --> Raspberry Pi 3.
2) TC358743 chip on B101 module needs to load EDID right after booting to configure what resolutions/framerates it can handle as input.
3) When the video source is connected to Rasberry Pi throught HDMI cable and B101 module, the TC chip will try to pick one supported resolution/framerate which is closest to the resolution/framerate of the source video. Is it correct?
No, the source device (camcorder) reads the EDID that the TC advertises and chooses a mode to use.
andes wrote:4) Then if we want to record/stream the video from B101 module using video frameworks (like ffmpef, gstreamer, etc...), we can set the resolution/framerate later depends on how much power/flexible the frameworks are. Is it correct?
Changing the frame rate is almost never supported. Other than only taking 1 frame in every N to reduce the rate by 1/2, 1/3, 1/4, etc, there is no way to easily interpolate between discrete frames.
None of the code I have written supports dropping frames.
Resizing images is relatively straightforward, but can be expensive to do in software.
andes wrote:So now I face a issue in step 4: After trying to record video with command

Code: Select all

./yavta --capture=1000 -n 3 --encode-to=file.h264 -f UYVY -m -T /dev/video0
I realized that the recorded video file.h264 is always 25fps with YUYV filter. Maybe that is why people confirm B101 works only with 25fps input? And unfortunately my camcorder output video at 50fps with RGB filter, so omxplayer plays the video file.h264 like with a 2x speed. I also tried to use MPC-HC player on my Windows computer and surprisingly the video file.h264 ran as same as in my camcorder. The issue happens even when I already set the camcorder as 720p50fps.
Could you please advice me how to change the framerate for recording/streaming to avoid the issue? I found one solution 6by9 suggested in the page 3

Code: Select all

./raspivid -pts timecodes.txt -o file.h264
mkvmerge -o file.mkv --timecodes 0:timecodes.txt file.h264
but I didn't try it yet because raspivid doesn't work with the lastest kernel driver and encoding file.h264 may be not suitable as I want to stream in real-time what I get from the camcorder. I really appreciate your help.
You seem confused as to what is in an elementary stream (ES). It contains the encoded video stream and nothing else. Timestamps are generally presented as additional metadata and stored alongside in a container (eg MP4 or MKV). When a player is given an ES it has nothing to go on as to the framerate, so it tends to guess at 25fps.
raspivid allows you to store the timestamps in a format that mkvmerge will combine with an ES. So does yavta - it always saves the timestamps to a file called file.pts, therefore

Code: Select all

mkvmerge -o file.mkv --timecodes 0:file.pts file.h264
should save a file with the correct timestamps applied.
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.

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

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

Fri Oct 26, 2018 12:24 pm

6by9 wrote:
Thu Oct 25, 2018 9:45 am
andes wrote:
Wed Oct 24, 2018 10:26 pm
Hi all, I've read the whole topic carefully (I am just a semi-IT guy and know nothing about chip programming) and here is what I got:
1) Assume that I have a system: camcorder --> HDMI cable --> B101 module --> Raspberry Pi 3.
2) TC358743 chip on B101 module needs to load EDID right after booting to configure what resolutions/framerates it can handle as input.
3) When the video source is connected to Rasberry Pi throught HDMI cable and B101 module, the TC chip will try to pick one supported resolution/framerate which is closest to the resolution/framerate of the source video. Is it correct?
No, the source device (camcorder) reads the EDID that the TC advertises and chooses a mode to use.
andes wrote:4) Then if we want to record/stream the video from B101 module using video frameworks (like ffmpef, gstreamer, etc...), we can set the resolution/framerate later depends on how much power/flexible the frameworks are. Is it correct?
Changing the frame rate is almost never supported. Other than only taking 1 frame in every N to reduce the rate by 1/2, 1/3, 1/4, etc, there is no way to easily interpolate between discrete frames.
None of the code I have written supports dropping frames.
Resizing images is relatively straightforward, but can be expensive to do in software.
andes wrote:So now I face a issue in step 4: After trying to record video with command

Code: Select all

./yavta --capture=1000 -n 3 --encode-to=file.h264 -f UYVY -m -T /dev/video0
I realized that the recorded video file.h264 is always 25fps with YUYV filter. Maybe that is why people confirm B101 works only with 25fps input? And unfortunately my camcorder output video at 50fps with RGB filter, so omxplayer plays the video file.h264 like with a 2x speed. I also tried to use MPC-HC player on my Windows computer and surprisingly the video file.h264 ran as same as in my camcorder. The issue happens even when I already set the camcorder as 720p50fps.
Could you please advice me how to change the framerate for recording/streaming to avoid the issue? I found one solution 6by9 suggested in the page 3

Code: Select all

./raspivid -pts timecodes.txt -o file.h264
mkvmerge -o file.mkv --timecodes 0:timecodes.txt file.h264
but I didn't try it yet because raspivid doesn't work with the lastest kernel driver and encoding file.h264 may be not suitable as I want to stream in real-time what I get from the camcorder. I really appreciate your help.
You seem confused as to what is in an elementary stream (ES). It contains the encoded video stream and nothing else. Timestamps are generally presented as additional metadata and stored alongside in a container (eg MP4 or MKV). When a player is given an ES it has nothing to go on as to the framerate, so it tends to guess at 25fps.
raspivid allows you to store the timestamps in a format that mkvmerge will combine with an ES. So does yavta - it always saves the timestamps to a file called file.pts, therefore

Code: Select all

mkvmerge -o file.mkv --timecodes 0:file.pts file.h264
should save a file with the correct timestamps applied.
Hi 6by9, thank you so much for the reply. Feel like I have just had a good lesson about video processing.
As I understand, the output video flow from B101 doesn't store any time information internally. And it means if we stream video directly to other devices without merging with pts file, we still face the same issue of wrong fps at the receiver's side? It could be incorrect assumption because I see people stream mjpeg over http without doing anything with timestamp.
My main goal I expect to reach is muxing video and audio into a container and streaming it away in real-time, so recording video on HDD and then merging with pts seems not a good solution. Could you please point me a direction to go? I am a newbie, don't know much but willing to try.
And last question, how to make raspidvid work with "dtoverlay=tc358743" added into config file? If I don't commend it out then there is an error "mmal: mmal_vc_component_enable: failed to enable component: ENOSPC"
Last edited by andes on Fri Oct 26, 2018 4:10 pm, edited 1 time in total.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5808
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 Oct 26, 2018 12:54 pm

andes wrote:
Fri Oct 26, 2018 12:24 pm
Hi 6by9, thank you so much for the reply. Feel like I have just had a good lesson video processing.
As I understand, the out put video flow from B101 doesn't store any time information internally. And it means if we stream video directly to other devices without merging with pts file, we still face the same issue of wrong fps at the receiver's side? It could be incorrect assumption because I see people stream mjpeg over http without doing anything with timestamp.
If you're streaming over the internet then you decode at the rate the data comes in with no scheduling, therefore you don't care about timestamps.
As soon as you are storing the data and removing the realtime element, then you have to worry about timestamps.
andes wrote:My main goal I expect to reach is muxing video and audio into a container and streaming it away in real-time, so recording video on HDD and then merging with pts seems not a good solution. Could you please point me a direction to go? I am a newbie, don't know much but willing to try.
If streaming then you should be looking at transport streams, not containers.
As I replied to Orbital6 a few posts up, I'm trying to get a set of V4L2 video codec components polished off, at which point GStreamer should be able to work efficiently with the TC358743 and you get A/V synchronisation thrown in almost for free.
At the moment in GStreamer there are a set of image copies required to get the images around the place, and there is an image conversion required to be done on the ARM. Those will compromise performance quite significantly.
andes wrote:And last question, how to make raspidvid work with "dtoverlay=tc358743" added into config file? If I don't commend it out then there is an error "mmal: mmal_vc_component_enable: failed to enable component: ENOSPC"
It very deliberately does not work.
You have one CSI2 receiver in the Pi. You have 2 processors (the ARM and the VPU). If both try talking to the peripheral at the same time VERY bad things will happen, up to and including the peripheral writing image data all over memory.
Should the VPU find that the ARM has been configured to use the CSI2 receiver (ie dtoverlay=tc358743 is present), then it will not try talking to the peripheral to avoid this situation.
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.

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

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

Mon Oct 29, 2018 1:59 pm

Hello everyone,
thanks for all those informations about the B100 and B101. Are those information also valid for the B102?
I'm trying to test the B102 with the Compute Module 3. but the maximal resolution I got is 720p and I also got this error message from the CM3: “The Driver for the TC358743 HDMI to CSI2 chip you are using is NOT supported. They were written for a demo purpose only, and are in the firmware on an as-is basis and therefore request for support or changes will not be acted on.”
does it meant that I have to install the driver of TC358743 to have the Full resolution?
if yes how can I install it on the CM3?
Thanks

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5808
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 Oct 29, 2018 2:25 pm

dasse wrote:
Mon Oct 29, 2018 1:59 pm
Hello everyone,
thanks for all those informations about the B100 and B101. Are those information also valid for the B102?
I'm trying to test the B102 with the Compute Module 3. but the maximal resolution I got is 720p and I also got this error message from the CM3: “The Driver for the TC358743 HDMI to CSI2 chip you are using is NOT supported. They were written for a demo purpose only, and are in the firmware on an as-is basis and therefore request for support or changes will not be acted on.”
does it meant that I have to install the driver of TC358743 to have the Full resolution?
if yes how can I install it on the CM3?
Thanks
Don't use raspivid to try and use the B101 or B102. You're being told exactly the reason why - it was demo code and is not supported.

Use the kernel drivers and appropriate V4L2 program and you can do what you fancy with it.

*edit* I see I gave exactly the same answer to you before - viewtopic.php?f=63&t=224895&p=1380989#p1381019
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.

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

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

Mon Oct 29, 2018 3:03 pm

"Use the kernel drivers and appropriate V4L2 program and you can do what you fancy with it."
sorry I don't really understand what you mean with this.
what I'm suppose to do for getting it work on Compute Module?
Thanks

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5808
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 Oct 29, 2018 3:32 pm

dasse wrote:
Mon Oct 29, 2018 3:03 pm
"Use the kernel drivers and appropriate V4L2 program and you can do what you fancy with it."
sorry I don't really understand what you mean with this.
what I'm suppose to do for getting it work on Compute Module?
Thanks
All of this is included in this thread.

Add "dtoverlay=tc358743" to /boot/config.txt.
I2C to the module needs to be wired to either GPIOs 28&29, or 44&45. If using 28&29 then amend the line to read "dtoverlay=tc358743,i2c_pins_28_29=1"
Edit /boot/cmdline.txt to add "cam=64M" to the comma separated list. Do not break it into more than one line.
Reboot.
You should now have a V4L2 device, probably as /dev/video0.

The EDID in HDMI terms tells the source what resolutions and framerates the "display" (or in this case capture chip) supports. You need to provide one. You can grab an example one using

Code: Select all

wget https://raw.githubusercontent.com/6by9/RPiTest/master/1080P50EDID.txt
.
Pass that to the B102 using "v4l2-ctl --set-edid=file=1080P50EDID.txt --fix-edid-checksums".

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.
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.

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

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

Wed Oct 31, 2018 7:57 am

Morning, Thanks for your help but I still have some difficulties.
After adding "dtoverlay=tc358743, i2c_pins_0_1=1" to /boot/config.txt(0&1 because my CD1_SDA and CD1_SCL are recpectively connected to GPIO0 and GPIO1. I'm using CAM1). and CAM=64 to cmdline.txt (at the end of the list without "comma". the list doesn't containt a comma.). I didn't get the "video0" or something like in the /dev file. did I do something wrong? schould I first update the CM3?
Thanks

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5808
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 9:51 am

dasse wrote:
Wed Oct 31, 2018 7:57 am
Morning, Thanks for your help but I still have some difficulties.
After adding "dtoverlay=tc358743, i2c_pins_0_1=1" to /boot/config.txt(0&1 because my CD1_SDA and CD1_SCL are recpectively connected to GPIO0 and GPIO1. I'm using CAM1). and CAM=64 to cmdline.txt (at the end of the list without "comma". the list doesn't containt a comma.). I didn't get the "video0" or something like in the /dev file. did I do something wrong? schould I first update the CM3?
Thanks
There is no overlay option for i2c_pins_0_1=1, so that will leave it on 44&45. There's also no space in "tc358743,i2c_pins_28_29=1" should you wish to use 28&29.
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.

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

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

Wed Oct 31, 2018 10:11 am

it's still not walking. no video0 in dev file. I did reset the raspbian and started everything from the beginning which means:
enable the camera, connect CD1-SDA to GPIO28 and CD1-SCK to GPIO29.
but I didn't follow this instruction from Raspi to attach the camera:
https://www.raspberrypi.org/documentati ... -camera.md
It's unfortunatly still not working.
any oder suggestion please?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5808
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 10:40 am

dasse wrote:
Wed Oct 31, 2018 10:11 am
it's still not walking. no video0 in dev file. I did reset the raspbian and started everything from the beginning which means:
enable the camera, connect CD1-SDA to GPIO28 and CD1-SCK to GPIO29.
but I didn't follow this instruction from Raspi to attach the camera:
https://www.raspberrypi.org/documentati ... -camera.md
It's unfortunatly still not working.
any oder suggestion please?
If you're using the CM3 then you're expected to be able to sort your own GPIO allocations. There are too many permutations to try and support them all.

What kernel version are you using? "uname -a". Something within the last few months would be sensible.
Check "dmesg" for errors.
Check "sudo vcdbg log msg" for errors. Ideally add "dtdebug=1" to config.txt and reboot first as it will give a load of debug whilst adding the overlays.
Check "raspi-gpio get" for which GPIOs are mapped to SCL0 and SDA0 - it should be the ones you've connected to.
You should have /dev/i2c0 present (it's enabled by the overlay). Use "i2cdetect -y 0" to probe for devices on it. The TC358743 should report as address 0F.
Check /proc/device-tree/soc/[email protected]/. Does "status" report "okay"? Is "/proc/device-tree/soc/[email protected]/port/endpoint/remote-endpoint" defined?
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.

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

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

Wed Oct 31, 2018 11:26 am

I didn't enable the I2C interface up to now. after enable it I can see the i2c-1 in the /dev file and after check "raspi-gpio get" I got: SDA1 on GPIO2 and SCL1 on GPIO3.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5808
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 11:45 am

dasse wrote:
Wed Oct 31, 2018 11:26 am
I didn't enable the I2C interface up to now. after enable it I can see the i2c-1 in the /dev file and after check "raspi-gpio get" I got: SDA1 on GPIO2 and SCL1 on GPIO3.
I didn't ask about i2c-1. The normal wiring for the camera and display is to i2c-0. You do need to load i2c-dev for the userspace devices to show up ("sudo modprobe i2c-dev", add "i2c-dev" to /etc/modules, or enable i2c via raspi-config)

If i2c-0 isn't present then you need to go back to the device tree defines and look at the debug logs from "sudo vcdbg log msg".
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.

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

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

Wed Oct 31, 2018 11:49 am

I'm now so far with the Video0 in /dev. Thank. 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

Return to “Graphics, sound and multimedia”