6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7895
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 Feb 27, 2016 8:59 pm

I'll try myself later, but I think you have some misunderstandings.

With a camera, the client app (in this case raspivid) can instruct the source to produce a particular frame rate. All nice and simple - you get what you ask for.

TC358743 is accepting data in from an external source at whatever frame rate that source is producing, and that is governed by the EDID (unless it is ignored). There's nothing in the processing pipeline that will alter that frame rate other than dropping whole frames due to the pipeline stalling. Your raspivid parameter is not going to do anything other than possibly affecting the codec rate control algorithm for computing bitrate.
Your source Pi will be producing output on the HDMI port at the rate that HDMI port is configured at (by EDID or forced mode), not the video clip you're playing. So in this case it should be producing 720P50 based on your mode 19. The processing pipe under raspivid should therefore be seeing 50fps at source, and will be attempting to process at that rate, and that is what should be present in the output stream.

Without trying it I couldn't comment on whether it will actually keep up with that or whether it does drop frames.
The easiest way to tell is to dump the frame timestamps out from raspivid - there was a patch from ethanol100 ages ago that added an option to save all the timestamps to file - I don't think it ever got merged though. Basically it is look at buffer->pts at around https://github.com/raspberrypi/userland ... id.c#L1119 and measure the differences between frames (units of nsecs IIRC). There was also a method for getting avconv to take those timestamps in when it muxed the h264 stream into a container, at which point things will always play back at the correct rate.
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.

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

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

Sat Feb 27, 2016 10:11 pm

Cheers Dave, reading that put a smile on my face as it was what i thought (the 'Hz' under hdmi_mode had me second guessing; i imagine it is treated as a refresh rate, and hence an overriding frame rate?)

Last night i got perfect behaviour playing my captured video at 2.00x (after wrapping it at 25 fps given the source fps was 25, though i tried repeating the experiment and got h264 playback at 0.75x today (not 0.5x), i will do a few more experiments and wrap videos from now on at 50 fps). I'll also look into the other methods you mentioned if i continue having problems though i hope it's solved now.

So far i've seen great performance from the pi when capturing/encoding h264 from the tosh. Though i'm wondering, would dropped frames be obvious or is something to watch out for purely from the preview?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7895
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 Feb 27, 2016 11:04 pm

Yes, HDMI refresh rate is equivalent to frame rate. Being a serial connection it obviously takes some time to get the data from source to destination, and you don't have scanning in the same way as CRTs used to.

Dropped frames may or may not be obvious. First question would be what refresh rate is your display on the Pi with the Tosh? That may well be 60Hz(fps), so would beatwith the 50Hz video received by the Tosh.
Typically it looks like a slight stutter in the video - fairly obvious at 25 or 30fps, possibly not so much at 50fps.

The simplest way though is to compare timestamps. You know what the frame period should be (20ms for 50fps), so print a message out if the difference is greater than that (plus a small tolerance).
Having done a quick search, https://github.com/ethanol100/userland/tree/savePts looks to be the branch where he added saving the timestamps, and viewtopic.php?f=43&t=98541&p=691558&hil ... ps#p684870 gives the runes as

Code: Select all

./raspivid -pts timecodes.txt -o video.h264
mkvmerge -o video.mkv --timecodes 0:timecodes.txt video.h264
to record with timestamps, and then mux the stream and timestamps together correctly. I'll ping him to see if he objects to me creating a PR for them as it would be a useful standard feature.
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.

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

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

Sat Feb 27, 2016 11:40 pm

Thanks for helping with the timestamps, i will look into that hopefully next week to see if there's any bad behaviour, though as i said it is looking flawless so far.
6by9 wrote:Dropped frames may or may not be obvious. First question would be what refresh rate is your display on the Pi with the Tosh? That may well be 60Hz(fps), so would beatwith the 50Hz video received by the Tosh.
Typically it looks like a slight stutter in the video - fairly obvious at 25 or 30fps, possibly not so much at 50fps.
The preview on the tv (60 hz) looks good with no (obvious) beat (never thought 'beating' would be a stutter in the video realm - learnt something new), though i am usually piping the video through nc or vlc, so i don't know if i'd drop frames on a pc output. It seems it'd be a safer to set the source pi to hdmi_mode=4 (720p60) given most monitors are 60 Hz (also the max fps for the tosh) - does that sound sane?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7895
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 Feb 28, 2016 12:06 am

If your display is at 60Hz when the source is at 25Hz, then you'll get some video frames shown for 2 * 1/60 seconds, and some for 3 * 1/60 seconds, so it'll show up as a very slight jitter on the screen, hence my comparison to beating. That's why good media playback devices will switch HDMI mode to match the source. Kodi on the Pi will even tweak the HDMI clock to get even better accuracy.
Read the A/V forums and you'll hear all the gory details on the old NTSC 3:2 pull down for converting from 24Hz film to 30Hz NTSC. Digital has just made it a more common issue as everyone's TV and Bluray player has to deal with it.
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.

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

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

Sun Feb 28, 2016 12:14 am

6by9 wrote:If your display is at 60Hz when the source is at 25Hz, then you'll get some video frames shown for 2 * 1/60 seconds, and some for 3 * 1/60 seconds, so it'll show up as a very slight jitter on the screen, hence my comparison to beating. That's why good media playback devices will switch HDMI mode to match the source. Kodi on the Pi will even tweak the HDMI clock to get even better accuracy.
Read the A/V forums and you'll hear all the gory details on the old NTSC 3:2 pull down for converting from 24Hz film to 30Hz NTSC. Digital has just made it a more common issue as everyone's TV and Bluray player has to deal with it.
So the key is to set the hdmi_mode to a refresh rate that is divisible by the display Hz (display Hz % hdmiModeHz == 0), and a factor of the source video fps [hdmiModeHz % sourceFPS == 0] (ish)?. I'll need to learn more, as I seem to have just opened a horrible box of worms; for e.g. don't know what to do if the source video is 29.nn fps or 30 fps. I shall experiment.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7895
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 Feb 28, 2016 12:40 pm

Simple answer is don't worry about the rendering side (at least not on this thread). Worry about the encoded data and that the timestamps on that are sensible with no gaps.
Get that bit right and then the rendering issue is one for whoever plays back the file. They can do whatever they like by resampling audio, altering HDMI clocks, or sacrificing first born on a new moon. Frame drops and synchronisation is a tricky subject, though in reality you have to get it quite wrong to make the issue that noticeable.

(Apologies that I've been a little quiet on this issue for a while. It is still one of the top 3 things on my list, but I'm just not finding time to do very much beyond forum support at the moment)
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.

richardtheboffin
Posts: 33
Joined: Thu Apr 19, 2012 12:04 pm

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

Mon Feb 29, 2016 6:12 pm

I've been looking for a reliable way to get composite video into the RPi, usb capture devices seem to be very hit and miss (both units I bought failed to work). I understand that there is some flaw in the RPi USB...

Anyway I found the Auvidea product and wondered if I connected a composite to HDMI converter to the B101 and then to the CSI port, would I be able to capture the video?

The Auvidea board appears to be the only method out there for getting video into the RPi without using the camera or a webcam.

I don't really want to blow £65 to find out!

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

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

Wed Mar 02, 2016 1:23 pm

richardtheboffin wrote:I've been looking for a reliable way to get composite video into the RPi, usb capture devices seem to be very hit and miss (both units I bought failed to work). I understand that there is some flaw in the RPi USB...

Anyway I found the Auvidea product and wondered if I connected a composite to HDMI converter to the B101 and then to the CSI port, would I be able to capture the video?

The Auvidea board appears to be the only method out there for getting video into the RPi without using the camera or a webcam.

I don't really want to blow £65 to find out!
I don't see why it wouldn't work provided you find a composite to hdmi converter (that outputs at a supported hdmi-mode). Is there a cheap converter on the market? Most of what i found are very expensive big box type units.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7895
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 02, 2016 1:36 pm

Orbital6 wrote:
richardtheboffin wrote:I've been looking for a reliable way to get composite video into the RPi, usb capture devices seem to be very hit and miss (both units I bought failed to work). I understand that there is some flaw in the RPi USB...

Anyway I found the Auvidea product and wondered if I connected a composite to HDMI converter to the B101 and then to the CSI port, would I be able to capture the video?

The Auvidea board appears to be the only method out there for getting video into the RPi without using the camera or a webcam.

I don't really want to blow £65 to find out!
I don't see why it wouldn't work provided you find a composite to hdmi converter (that outputs at a supported hdmi-mode). Is there a cheap converter on the market? Most of what i found are very expensive big box type units.
That could be slightly tricky as interlaced video is not handled. Unless the composite to HDMI converter deinterlaces as well, then you may hit a stumbling block there.

If I can get this all working properly under V4L2, then you should be able to use the Analog Devices ADV7280-M to convert composite to CSI2. There are drivers for the chip already in the kernel for it (part of the adv7180 driver), so it may just work once I've got my stuff working. There is an eval board (http://uk.farnell.com/analog-devices/ev ... dp/2378643), but if works I suspect someone will build their own for Pi.
As you can probably guess, a few other things have crept up in the last week or so, so I haven't looked at this.
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.

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

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

Wed Mar 02, 2016 1:52 pm

6by9 wrote:
Orbital6 wrote:
richardtheboffin wrote:I've been looking for a reliable way to get composite video into the RPi, usb capture devices seem to be very hit and miss (both units I bought failed to work). I understand that there is some flaw in the RPi USB...

Anyway I found the Auvidea product and wondered if I connected a composite to HDMI converter to the B101 and then to the CSI port, would I be able to capture the video?

The Auvidea board appears to be the only method out there for getting video into the RPi without using the camera or a webcam.

I don't really want to blow £65 to find out!
I don't see why it wouldn't work provided you find a composite to hdmi converter (that outputs at a supported hdmi-mode). Is there a cheap converter on the market? Most of what i found are very expensive big box type units.
That could be slightly tricky as interlaced video is not handled. Unless the composite to HDMI converter deinterlaces as well, then you may hit a stumbling block there.

If I can get this all working properly under V4L2, then you should be able to use the Analog Devices ADV7280-M to convert composite to CSI2. There are drivers for the chip already in the kernel for it (part of the adv7180 driver), so it may just work once I've got my stuff working. There is an eval board (http://uk.farnell.com/analog-devices/ev ... dp/2378643), but if works I suspect someone will build their own for Pi.
As you can probably guess, a few other things have crept up in the last week or so, so I haven't looked at this.
I was eyeing this IC, good to know there's an existing driver for it. Making a small board for the ADV7280 might be something I could look into, though it's something Jurgen could probably do in a night, hint hint.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7895
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 02, 2016 2:00 pm

Orbital6 wrote:I was eyeing this IC, good to know there's an existing driver for it. Making a small board for the ADV7280 might be something I could look into, though it's something Jurgen could probably do in a night, hint hint.
Let's get the TC358743 working first! No point having the board with no software to use it.

Board layout would require some expertise as we're dealing with some pretty high frequency signals, they should be impedance matched, and various other considerations. At least the chip is easy enough to get (Farnell have some stock and will sell them singly).
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.

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

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

Wed Mar 02, 2016 3:24 pm

6by9 wrote:
Orbital6 wrote:I was eyeing this IC, good to know there's an existing driver for it. Making a small board for the ADV7280 might be something I could look into, though it's something Jurgen could probably do in a night, hint hint.
Let's get the TC358743 working first! No point having the board with no software to use it.

Board layout would require some expertise as we're dealing with some pretty high frequency signals, they should be impedance matched, and various other considerations. At least the chip is easy enough to get (Farnell have some stock and will sell them singly).
That is a pleasant surprise from the toshiba chip, where the MoQ is something like 5k.

I won't really pursue any ideas until your app is close to finished (with v4l2)

I'm well aware of all the horrible requirements for a successful high-speed layout to work, though this doesn't mean i'm competent at designing one! One could go about seeing if there's any existing open-hardware that uses it, or seeing if analog devices could supply a template layout (which they essentially do in the datasheet).

Bertold
Posts: 5
Joined: Sun Apr 27, 2014 6:48 pm

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

Wed Mar 02, 2016 6:40 pm

I would like to help if I can be useful. I understand that a task needing to be completed is creating a program that will generate an EDID blob with the desired modelines. The kernel driver also needs this as userspace needs to provide it. Is this correct?

I also see you talk about the ADV7280. I can easily get access to a board with this chip and connect it to a Pi if I can do any useful testing with it.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7895
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 02, 2016 8:50 pm

Bertold wrote:I would like to help if I can be useful. I understand that a task needing to be completed is creating a program that will generate an EDID blob with the desired modelines. The kernel driver also needs this as userspace needs to provide it. Is this correct?

I also see you talk about the ADV7280. I can easily get access to a board with this chip and connect it to a Pi if I can do any useful testing with it.
Thanks for the offer of help - it's much appreciated.

As I currently understand the framework we need an app that talks to v4l2, sets an edid, and then listens for the resolution changed event before setting the resolution and queuing buffers. We have an edid that does basically work, but understanding it would be useful.
I'm not an expert on the graphics frameworks, but there are a couple of v4l2 demo apps that may be of use (qv4l2 or yavta iirc). If I were doing it alone I'd be doing it all command line driven and abuse mmal for rendering :-)

Adv7280-m (and it does have to be the m version to have a csi interface) is a secondary project. If I get things right then it should just be a device tree config job and adapt the client app to get it working.
If you do have access to a board with this chip then I may come back to you. I may post on the linux-media mailing list too to see if there are any other boards with it on.
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.

Bertold
Posts: 5
Joined: Sun Apr 27, 2014 6:48 pm

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

Wed Mar 02, 2016 8:54 pm

I understand. I have some experience with V4L, I will take a deeper look at it.

PS: I was indeed talking about the ADV7280 with the CSI interface, the m-version.

vcarlon
Posts: 12
Joined: Tue Dec 01, 2015 7:46 am

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

Wed Mar 16, 2016 9:39 am

Hello,

I have been trying for a while to use raspi_tc358743.c to capture images from tc358746 and display them directly on the screen.

Right now, I have managed to produce a colorbar test image on my screen by modifying the I2C data for the Start_Streaming and Stop_Streaming functions.

Has somebody else tried to do this? I'm wondering whether my efforts will eventually be futile in the end and I should just start using the raw capture alternative.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7895
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 16, 2016 12:16 pm

vcarlon wrote:I have been trying for a while to use raspi_tc358743.c to capture images from tc358746 and display them directly on the screen.
Do you mean tc358746? That's a different chip doing parallel camera interfaces to CSI2.
vcarlon wrote:Right now, I have managed to produce a colorbar test image on my screen by modifying the I2C data for the Start_Streaming and Stop_Streaming functions.
Has somebody else tried to do this? I'm wondering whether my efforts will eventually be futile in the end and I should just start using the raw capture alternative.
I haven't tried it. If you're meaning raspiraw as the alternative, then it's basically the same app but with a different I2C register set.
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.

vcarlon
Posts: 12
Joined: Tue Dec 01, 2015 7:46 am

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

Wed Mar 16, 2016 2:27 pm

6by9,

Yes, I meant the CSI-2 to parallel converter chip from Toshiba (tc358746). It just suits the project better than the CSI-2 to HDMI chip (tc358743).

Thank you for giving us raspiraw and raspi_tc358743. I would never even try to do what I'm doing now without it.

Upon reading the forums, it seems that you prefer to recommend the raspiraw to people attempting to use cameras other than the one from Omnivision. So I feel that there would be a better community support around that code.

But I have to try to make raspi_tc358743 to work first before going on to raspiraw because it displays the captured video to the monitor with the help of the gpu, which would give me a better frame rate.

The thing that worries me right now is that I've read other people asking about tc358746, but I haven't read anyone saying that they made it work, so it gives me the impression that there might be a problem that I just don't know yet.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7895
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 16, 2016 3:19 pm

vcarlon wrote:Upon reading the forums, it seems that you prefer to recommend the raspiraw to people attempting to use cameras other than the one from Omnivision. So I feel that there would be a better community support around that code.
Mainly as there is no other option as yet.
- The GPU code is closed source, so they can't modify that, and it only supports OV5647 (and unofficially TC358743).
- The kernel driver is in progress, but I'm not getting huge amounts of spare time to work on it.
- Raspiraw exposes the functionality, but I won't claim it 100% stable (I know there is a double buffer return that causes a hard lockup, but haven't been able to track down the sequence of events to trigger it)
vcarlon wrote:But I have to try to make raspi_tc358743 to work first before going on to raspiraw because it displays the captured video to the monitor with the help of the gpu, which would give me a better frame rate.
video_render can only display some formats. TC358743 (HDMI->CSI2) outputs BGR888 by default and that can be consumed. Many cameras will put out YUYV and that can't be. I do have something working that may help with that, but need to get some changes into a firmware update and update my userland repo.
vcarlon wrote:The thing that worries me right now is that I've read other people asking about tc358746, but I haven't read anyone saying that they made it work, so it gives me the impression that there might be a problem that I just don't know yet.
AFAIK There is no kernel driver for TC358746, I suspect mainly as it isn't a sensor of itself (it's yet another layer of conversion), so you'd need a sensor driver on top of that. It's all possible, but would require you to understand V4L2 subdevices and device tree to configure it all. You would also need a datasheet for the Toshiba chip first to know how to set it up, and I don't see one publicly available, nor any reference to anyone having it working. I believe Toshiba are more open than some companies, but I don't know if they will release that to you.
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.

vcarlon
Posts: 12
Joined: Tue Dec 01, 2015 7:46 am

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

Thu Mar 17, 2016 12:37 am

6by9,

I see, In that case, I'm planning to continue and see how far I can get. The camera that we are planning to use is indeed RGB888.

Right now, I have managed to produce a colorbar test image on my display. The test image is being produced only by the tc358746 chip though, I'll try to get the parallel input to work starting this week.
IMG_3537_2.JPG
colorbar test image on monitor
IMG_3537_2.JPG (33.82 KiB) Viewed 5580 times

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7895
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 18, 2016 10:20 pm

Before anyone queries me on it, yes I've just updated my hdmi_in branch.
I've rebased the tree on the latest userland, and added an ISP component which can then do resizing using the hardware. If you try it at the moment the I'm afraid the released firmware has red and blue swapped - I had wrong coefficients in a colour conversion matrix. I have a firmware patch for that to pass on to Pi Towers for release.
I had tried extending the pipe to:

Code: Select all

rawcam->isp->video_splitter-+->video_render
                            +- video_encode->app
but for some reason video_splitter wasn't doing what I expected. When I next get a few minutes to work on this I'll be looking into why.
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.

vcarlon
Posts: 12
Joined: Tue Dec 01, 2015 7:46 am

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

Wed Mar 23, 2016 7:20 am

Hello,

Thank you again 6by9 for giving us raspi_tc358743.

Right now, I can produce a moving video on my display using the TC358746 (PARALLEL to CSI-2). The video is a gradient going from blue to red (left to right) and blue/red to cyan/yellow (over time). There's also some vertical white lines moving from left to right. There's some noise and even an offset. I just connected everything using breakout boards and jumper wires at very high frequencies.


The boards are connected this way:

[FPGA board] --parallel_RGB888--> [TC358746 board] --2_lane_CSI-2--> [Camera Port of RasPi 2 Model B]


I modified three items in raspi_tc358743.c to accomplish this.

(1.) The resolution to fit my monitor
#define WIDTH DISPLAY_WIDTH
#define HEIGHT DISPLAY_HEIGHT

The I2C registers and values are modified from one that supports TC358743 to one that supports TC358746.
(2.) void start_camera_streaming(void)
(3.) void stop_camera_streaming(void)


I am also using the start_x.elf from 6by9's RPiTest.


Demo video: https://drive.google.com/file/d/0B2bs_a ... o4Y2M/view

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7895
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 24, 2016 3:52 pm

Would you mind creating a new thread for TC358746? There have been various confusions between the '743 and '746 already, and merging them on this thread doesn't help.
Your work certainly doesn't relate to kernel 4.1 supporting TC358743 (which is actually also untrue as the driver didn't get merged until 4.3)
vcarlon wrote:Right now, I can produce a moving video on my display using the TC358746 (PARALLEL to CSI-2). The video is a gradient going from blue to red (left to right) and blue/red to cyan/yellow (over time). There's also some vertical white lines moving from left to right. There's some noise and even an offset. I just connected everything using breakout boards and jumper wires at very high frequencies.
Something looks a tad nasty there. A couple of suggestions:
- try deliberately disconnecting some of your parallel interface to eliminate the possibility of interference there causing the noise.
- There are some magic timing values that get set in raspi-tc358743. Try commenting that out and running with the defaults. There was no good explanation of why all 0's was selected for '743 when the OV5647 uses other values (the defaults from the GPU - don't worry about the actual values). I can't really help you on changing those values, but you'll do no harm if you play around with timing1-5 with values from 0 to 15 (ignore the other fields).

I don't have a datasheet for '746 so can't comment on the setup there. If you have a link to a public domain datasheet, then please post it, or if it is restricted then I'm happy to switch to private message / email to discuss stuff. PM me for my email address.
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.

vcarlon
Posts: 12
Joined: Tue Dec 01, 2015 7:46 am

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

Fri Mar 25, 2016 3:46 am

I'm sorry, I don't mean to cause confusions.

This is the new thread that I created just for the TC358746 IC.

viewtopic.php?f=38&t=141682

Return to “Graphics, sound and multimedia”