bryanbailes
Posts: 6
Joined: Sat Jul 08, 2017 12:10 am
Contact: Website

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

Sat Jul 08, 2017 12:34 am

carlos.rodriguez wrote:First of all, I've "solved" my issue with the GoPro Hero 5 and the B101 board. I don't know the reason but if I connect an HDMI switch between the GoPro and the board everything works great. (link to the switch used: http://www.tecknet.co.uk/hdmi03.html). No need to power the switch with the MicroUSB included.
I've been sniffing EDID data and the switch does not change it so the issue is not there. I also tried with a GoPro Hero 3 and it works fine without the need of the switch. Anyway, I can live with that.
The reason is because the GoPro Hero 5 utilizes HDCP, while the GoPro Hero 3 does not (nor does the Hero 4). Your HDMI switch is then stripping out the HDCP. The B101 board does not support HDCP.

bortek
Posts: 2
Joined: Thu Feb 23, 2017 7:25 am

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

Mon Jul 10, 2017 12:50 pm

Can anyone confirm that Auvidea B102 is working?

ChrisR20XX
Posts: 1
Joined: Thu Jul 13, 2017 2:05 pm

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

Thu Jul 13, 2017 2:21 pm

I am using EZ-Wifibroadcast which is a software solution to broadcast video wireless between Pi's. It's using raspivid and as such it does work with the B101.
However when I connect my Laptop to the B101 is being recognized as a Toshiba device with a highest resolution of 720p.

From reading this thread up and down I understand that this is because the EDID information being fed by raspivid to the tc358743 is not correct. Using raspi_tc358743.c would make more resolutions up to 1080p25 selectable on my Laptop? Does raspi_tc358743.c behave like raspivid apart from sending more EDIDs to the chip? Is it supporting all the parameters you can use on raspivid? Or is raspi_tc358743.c a rather different application just for displaying the video from the B101?

A rather different approach that came to my mind was using raspivid and an EDID Override Tool on my Laptop. Has anyone got experience in doing that or is there a reason why this expected to fail?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5081
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 Jul 13, 2017 3:48 pm

ChrisR20XX wrote:I am using EZ-Wifibroadcast which is a software solution to broadcast video wireless between Pi's. It's using raspivid and as such it does work with the B101.
However when I connect my Laptop to the B101 is being recognized as a Toshiba device with a highest resolution of 720p.

From reading this thread up and down I understand that this is because the EDID information being fed by raspivid to the tc358743 is not correct. Using raspi_tc358743.c would make more resolutions up to 1080p25 selectable on my Laptop? Does raspi_tc358743.c behave like raspivid apart from sending more EDIDs to the chip? Is it supporting all the parameters you can use on raspivid? Or is raspi_tc358743.c a rather different application just for displaying the video from the B101?

A rather different approach that came to my mind was using raspivid and an EDID Override Tool on my Laptop. Has anyone got experience in doing that or is there a reason why this expected to fail?
Using raspivid, if the source produces anything other than 720P you will get corruption. The GPU side is set up only to handle 720P input.

raspi_tc358743.c is a totally separate app at https://github.com/6by9/userland/blob/h ... tc358743.c. It displays and optionally encodes the stream from the TC358743.
No it doesn't have all the options of raspivid, although it can be modified to support many of them. None of the image controls (eg saturation, contrast, brightness, etc) are currently supported by the pipeline, and it will require firmware mods to do so. Nor does it have circular buffering, inline motion vectors, or the other encoding parameters, but those can probably be copy and pasted fairly easily.
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.

Glurt
Posts: 2
Joined: Fri Aug 11, 2017 10:35 pm

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

Fri Aug 11, 2017 11:06 pm

Hi guys, sorry if this isn't the right place.

I was looking at buying the B101 but I couldn't find any available, I did find these Aducam modules however https://www.amazon.com/Arducam-Extensio ... B06XDNBM63

The problem is that I can't get them to work, which is how I found this thread.

I've installed OSMC and connected one of the modules to the board and then plugged a Chromecast/Laptop into the hdmi port. Running

Code: Select all

vcgencmd get_camera
gives me
support=1 detected=0
. I've also tried using a HDMI splitter in case it was a hdcp issue.

I'm starting to think these might not be suitable as a replacement to the B101 as they don't appear to have the TC358742 chip but I'm not sure if that's necessary or not.

Could someone let me know if those modules aren't going to work and if not, why?

Similarly, if they should work, what I can try to detect input on the Rpi?

Thanks

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5081
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 Aug 12, 2017 5:23 am

Glurt wrote:
Fri Aug 11, 2017 11:06 pm
Hi guys, sorry if this isn't the right place.

I was looking at buying the B101 but I couldn't find any available, I did find these Aducam modules however https://www.amazon.com/Arducam-Extensio ... B06XDNBM63

The problem is that I can't get them to work, which is how I found this thread.

I've installed OSMC and connected one of the modules to the board and then plugged a Chromecast/Laptop into the hdmi port. Running

Code: Select all

vcgencmd get_camera
gives me
support=1 detected=0
. I've also tried using a HDMI splitter in case it was a hdcp issue.

I'm starting to think these might not be suitable as a replacement to the B101 as they don't appear to have the TC358742 chip but I'm not sure if that's necessary or not.

Could someone let me know if those modules aren't going to work and if not, why?

Similarly, if they should work, what I can try to detect input on the Rpi?
Those aren't going to work. They are a pair of boards that allow the use of an hdmi lead to place a Pi camera module further away from the Pi. They do not convert hdmi to csi2.
I wouldn't be surprised if you've actually blown part of the Pi, or potentially even your hdmi source.
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.

Glurt
Posts: 2
Joined: Fri Aug 11, 2017 10:35 pm

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

Sat Aug 12, 2017 10:34 am

Those aren't going to work. They are a pair of boards that allow the use of an hdmi lead to place a Pi camera module further away from the Pi. They do not convert hdmi to csi2.
Thanks for the straightforward reply, looks like they were a waste of money then! If I was to find one of the B101 boards is it still going to be a pain to setup like this thread indicates or have things progressed recently?
I wouldn't be surprised if you've actually blown part of the Pi, or potentially even your hdmi source.
What makes you say this? My Chromecast/Laptop are still working fine as is the Pi.

Thanks again for the help.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5081
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 Aug 14, 2017 11:50 am

Glurt wrote:
Sat Aug 12, 2017 10:34 am
If I was to find one of the B101 boards is it still going to be a pain to setup like this thread indicates or have things progressed recently?
Finding is easy enough, though not cheap - https://auvidea.com/b101-hdmi-to-csi-2- ... 5-pin-fpc/ and https://auvidea.com/product/70501/
The drivers are still under development. It depends what exactly you want to do - the raspi_tc358743 app does a reasonable job at automatically switching to the appropriate input, and encoding the data.
Even once we have kernel support, that isn't the end of the story as something has to consume that data and do something useful with it.
Glurt wrote:
I wouldn't be surprised if you've actually blown part of the Pi, or potentially even your hdmi source.
What makes you say this? My Chromecast/Laptop are still working fine as is the Pi.
Have you checked the Pi camera input using a camera module? IIRC The HDMI and CSI2 signal levels differ by several volts, and there is certainly only minimal input protection on the CSI2 input on the Pi. Push it too far and you will have fried things.
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.

RpiName
Posts: 649
Joined: Sat Jul 06, 2013 3:14 am

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

Tue Aug 15, 2017 6:56 pm

Glurt wrote:
Sat Aug 12, 2017 10:34 am
If I was to find one of the B101 boards is it still going to be a pain to setup like this thread indicates or have things progressed recently?
In case you missed this one:
https://www.linux-projects.org/2017/07/ ... -tc358743/

paolohu
Posts: 1
Joined: Thu Jan 07, 2016 10:26 pm

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

Thu Aug 24, 2017 9:52 pm

Orbital6 wrote:
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).
Orbital6,

Have you documented getting audio to work anywhere? If not could you share? I've gotten other I2S audio input boards to work but am not having a lot of luck with the auvidea one thus far.

bryanbailes
Posts: 6
Joined: Sat Jul 08, 2017 12:10 am
Contact: Website

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

Sat Aug 26, 2017 12:06 am

paolohu wrote:
Thu Aug 24, 2017 9:52 pm
Orbital6 wrote:
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).
Orbital6,

Have you documented getting audio to work anywhere? If not could you share? I've gotten other I2S audio input boards to work but am not having a lot of luck with the auvidea one thus far.
+1. Has anybody been able to do this successfully? I have also had no luck.

acayulao
Posts: 2
Joined: Fri Sep 15, 2017 2:44 pm

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

Fri Sep 15, 2017 3:25 pm

Hi guys,
I read a bit in this thread and I have this situation:

1) I have connected raspberry Pi 3 to B101 to HDMI wire to GoPro Hero 4 Black using the micro hdmi port and I have video signal output using gstreamer. I use the software 'Companion Computer' from ArduSub and I have the video stream when I open QGroundControl in my computer. I have connected Raspberry Pi and my computer using ethernet port and with a static ip direction.


2) I have three problems:
2.1) When I push the buton to record in the gopro camera, the video signal is lost. I can feed the gopro camera using usb port and I still have video stream, but if I want record in gopro camera (this record of video remains in ultraHD and I need). the stream video is lost and the only way to recovered is restarting de raspberry Pi, not works killall with raspivid and gstreamer.

2.2) When I want reload the program to send video this not works, and sometimes have a strange behavior. Also when the raspberry connect to (temporarily) a raspi monitor this device also is frozen when the program is stopped or when I start record in Gopro camera.

2.3) If I want see the video in the raspberry -with a monitor connected- using VLC I can't find where is the device. I use for this:
$ ls /dev/

I also updated the raspberry Pi today with:

sudo apt-get update
sudo apt-get dist-upgrade
sudo rpi-update
sudo reboot

I think that the problem is the software raspivid for my first problem, but I don't know how detect that this is stopped and reload it with success.
The most strange for me is that sometime ago, the record of video in gopro camera hero 4 worked fine.

About recharge the raspivid I don't know why this happen.

And when the device is not detected in Raspberry Pi, to be show in vlc, but I still have the video stream in my computer is very weird for me and I don't know what think.

Sorry if the problem is not for here, I hope that someone can help me.
Greetings!

bryanbailes
Posts: 6
Joined: Sat Jul 08, 2017 12:10 am
Contact: Website

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

Mon Sep 18, 2017 8:02 pm

I think that the problem is the software raspivid for my first problem, but I don't know how detect that this is stopped and reload it with success.
I think all of your problems are because of raspivid. Quit using it. 6by9 has posted several times that raspivid is not supported, and has released userspace applications to replace it.

acayulao
Posts: 2
Joined: Fri Sep 15, 2017 2:44 pm

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

Tue Sep 26, 2017 7:20 pm

bryanbailes wrote:
Mon Sep 18, 2017 8:02 pm
I think that the problem is the software raspivid for my first problem, but I don't know how detect that this is stopped and reload it with success.
I think all of your problems are because of raspivid. Quit using it. 6by9 has posted several times that raspivid is not supported, and has released userspace applications to replace it.
I was searching and I couldn't found some app that make this, Do you suggest that I use pycamera instead?

I need make only this:

raspivid --nopreview \
--mode 5 \
--bitrate 15000000 \
--intra 1 \
--awb auto \
--brightness 55 \
--saturation 10 \
--sharpness 50 \
--contrast 15 \
--drc medium \
-roi 0.02,0.0,0.81,0.85 \
-fl \
--timeout 0 \
--output - | \
gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=10 pt=96 ! \
udpsink host=192.168.2.1 port=5600

Any suggestions? please :c
Greetings

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5081
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 Sep 26, 2017 8:02 pm

acayulao wrote:
Tue Sep 26, 2017 7:20 pm
I was searching and I couldn't found some app that make this, Do you suggest that I use pycamera instead?

I need make only this:

raspivid --nopreview \
--mode 5 \
--bitrate 15000000 \
--intra 1 \
--awb auto \
--brightness 55 \
--saturation 10 \
--sharpness 50 \
--contrast 15 \
--drc medium \
-roi 0.02,0.0,0.81,0.85 \
-fl \
--timeout 0 \
--output - | \
gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=10 pt=96 ! \
udpsink host=192.168.2.1 port=5600

Any suggestions? please :c
Greetings
Read this thread and you will be directed at https://github.com/6by9/userland/blob/h ... tc358743.c

Code: Select all

git clone https://github.com/6by9/userland.git
cd userland
git checkout -t -b hdmi_in_hack origin/hdmi_in_hack
./buildme
raspi_tc358743
Options of "-o <filename> -n" to encode and save the data.

Almost certainly your issue is that raspivid will ONLY work with 720P input, and from previous reports the GoPro decides that it wants to put out 1080P. As already stated there will be no updates to the firmware to change the behaviour of raspivid in this regard.

The CSI-2 receiver driver is on v4 of code review for merging in to the mainline kernel, so all being well that should happen in the next couple of weeks. That'll then give you a full V4L2 driver for the TC358743, and then people can do whatever they like with it as it is all fully open source.
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.

Torna
Posts: 41
Joined: Thu Nov 24, 2011 8:59 pm

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

Mon Oct 23, 2017 3:57 pm

Hi everyone,

I have been reading the whole thread and i'm still a bit confused.

I have RPi 3 running Jessie and the B101 rev 4 connected to a GoPro4. I can get the images with raspivid and v4l2-ctl.

But, I'm trying to save a video file in mp4, in 1080p25/30 or 720p25/30 but I don't get any result.

I always get slow videos, and one minute recording produce a 1m20s video file :/

Is their something i can test to see what's wrong ?

Thank you very with anticipation,

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5081
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 24, 2017 9:24 am

Torna wrote:
Mon Oct 23, 2017 3:57 pm
I have RPi 3 running Jessie and the B101 rev 4 connected to a GoPro4. I can get the images with raspivid and v4l2-ctl.
Which V4L2 driver are you using? If bcm2835-v4l2 then you are using the firmware driver for the TC358743 the same as raspivid. That is not a supported option, and will only ever accept 720P60.
Torna wrote:But, I'm trying to save a video file in mp4, in 1080p25/30 or 720p25/30 but I don't get any result.

I always get slow videos, and one minute recording produce a 1m20s video file :/

Is their something i can test to see what's wrong ?
raspivid (and v4l2-ctl if using bcm2835-v4l2) will be saving an H264 elementary stream. Elementary streams have no timestamp or frame rate information within the stream. The application you are using to convert it into a container is therefore having to make an assumption, and that is normally 25fps. 60seconds * 30 / 25 = 72, so I would expect 1min12secs of video.
Add an appropriate flag (normally "-r 30" for avformat or ffmpeg) to tell the application the correct frame rate for the stream.
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.

dineshbkumaar
Posts: 1
Joined: Wed Oct 25, 2017 8:57 am

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

Wed Oct 25, 2017 9:15 am

I am testing Auvidea B101 connector with Rpi3 both in Jessie and stretch using the raspivid command.
I am feeding 720p60 FPS video from Sony Handycam HDMI output to Rpi3 through B101 connector.
The raspivid preview shows the objects in the video bit shaking, moving up and down, kind of flickering. Anyone else have observed?
Is this the problem with Toshiba chip or B101 connector?

User avatar
madnerd
Posts: 10
Joined: Wed Nov 01, 2017 6:43 am
Location: Montpellier, France
Contact: Website Twitter

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

Wed Nov 01, 2017 7:00 am

I made a bunch of test using auvidea B101 and a go pro at 1080p25 but I always end up with a slow down video (tried it with the camera module and it works fine) when I use raspivid

I managed to use ffmpeg with video4linux (/dev/video0) to have a video at a normal speed but the frame rate (despite being set up using -r) is at 38fps.

I also tried using a different camera and to change the settings on the gopro but I had the same issue.

I was wondering what could but the issue, it seems the B101 doesn't record the video at 25fps but at a faster rate and I can't find out why.

Thanks in advance for your help!
Last edited by madnerd on Fri Nov 03, 2017 7:59 am, edited 1 time in total.

natxo
Posts: 27
Joined: Mon Sep 18, 2017 3:47 pm

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

Thu Nov 02, 2017 12:33 pm

Hello

I have compiled raspi_tc358743.c but when running im getting this msg and no video is created.

Im doing something wrong?

Code: Select all

Filename is test_encode.h264
Playing back indefinitely

UPDATE: im able to make it work, running after camera_i2c and adding "dtoverlay=i2c0-bcm2708,sda0_pin=28,scl0_pin=29" to config.txt

it starts on 720 and when i change to 1080 i get glitched frames...

User avatar
madnerd
Posts: 10
Joined: Wed Nov 01, 2017 6:43 am
Location: Montpellier, France
Contact: Website Twitter

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

Mon Nov 06, 2017 1:54 pm

I don't know if this is of any help, but here is how to recompile the kernel with tc358743 drivers.
Compile raspberry pi 3 kernel to add drivers (tc358743)
https://gist.github.com/maditnerd/01195 ... 1682f1727b

Image
Last edited by madnerd on Tue Nov 07, 2017 4:57 pm, edited 2 times in total.

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

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

Mon Nov 06, 2017 2:17 pm

madnerd wrote:
Mon Nov 06, 2017 1:54 pm
I don't know if this is of any help, but here is how to recompile the kernel with tc358743 drivers.
Compile raspberry pi 3 kernel to add drivers (tc358743)
https://gist.github.com/maditnerd/01195 ... 682f1727bh

Image
That won't be actually useful unless you have something to make use of that V4L2 subdevice and receive the CSI2 data.

I'll make a new post soon, but https://github.com/6by9/linux/tree/unicam_v4_4.14 is my latest kernel branch which includes such a driver. It's now on V4 with the Linux mailing lists (well when I send those emails) which I hope will answer all of their review comments. Yes you need to build your own kernel, and be aware that the branch is likely to get rebased should I need to make further changes.
Load it all with "dtoverlay=tc358743-fast" in /boot/config.txt.

You need an EDID file to program into the chip via "v4l2-ctl --set-edid=file=1080P50EDID.txt --fix-edid-checksums". You can find that file at https://raw.githubusercontent.com/6by9/ ... 50EDID.txt to support up to 1080P50 (>1080P30 only works in UYVY mode from the TC358743, not RGB888).
Encoding to >1080P30 requires overclocking the GPU, but I'll cover that later when I make the announcement post.
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.

User avatar
madnerd
Posts: 10
Joined: Wed Nov 01, 2017 6:43 am
Location: Montpellier, France
Contact: Website Twitter

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

Tue Nov 07, 2017 5:54 pm

'll make a new post soon, but https://github.com/6by9/linux/tree/unicam_v4_4.14 is my latest kernel branch which includes such a driver. It's now on V4 with the Linux mailing lists (well when I send those emails) which I hope will answer all of their review comments. Yes you need to build your own kernel, and be aware that the branch is likely to get rebased should I need to make further changes.
Load it all with "dtoverlay=tc358743-fast" in /boot/config.txt.

You need an EDID file to program into the chip via "v4l2-ctl --set-edid=file=1080P50EDID.txt --fix-edid-checksums". You can find that file at https://raw.githubusercontent.com/6by9/ ... 50EDID.txt to support up to 1080P50 (>1080P30 only works in UYVY mode from the TC358743, not RGB888).
Encoding to >1080P30 requires overclocking the GPU, but I'll cover that later when I make the announcement post.
Thanks for the info! I managed to compile the drivers , I update my gist, with what I did, if anyone is interested.
https://gist.github.com/maditnerd/01195 ... 1682f1727b

I didn't manage to use /dev/video0 with ffmpeg but I didn't spend a lot of times trying (I'm tired :D )
I'll try again tomorrow.

Code: Select all

ffmpeg
[video4linux2,v4l2 @ 0x29c5230] ioctl(VIDIOC_REQBUFS): Cannot allocate memory
/dev/video0: Cannot allocate memory

dmesg
[  232.948018] cma: cma_alloc: alloc failed, req-size: 1020 pages, ret: -16
[  232.948037] unicam 3f801000.csi1: dma_alloc_coherent of size 4177920 failed

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5081
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 Nov 07, 2017 6:08 pm

madnerd wrote:
Tue Nov 07, 2017 5:54 pm
'll make a new post soon, but https://github.com/6by9/linux/tree/unicam_v4_4.14 is my latest kernel branch which includes such a driver. It's now on V4 with the Linux mailing lists (well when I send those emails) which I hope will answer all of their review comments. Yes you need to build your own kernel, and be aware that the branch is likely to get rebased should I need to make further changes.
Load it all with "dtoverlay=tc358743-fast" in /boot/config.txt.

You need an EDID file to program into the chip via "v4l2-ctl --set-edid=file=1080P50EDID.txt --fix-edid-checksums". You can find that file at https://raw.githubusercontent.com/6by9/ ... 50EDID.txt to support up to 1080P50 (>1080P30 only works in UYVY mode from the TC358743, not RGB888).
Encoding to >1080P30 requires overclocking the GPU, but I'll cover that later when I make the announcement post.
Thanks for the info! I managed to compile the drivers , I update my gist, with what I did, if anyone is interested.
https://gist.github.com/maditnerd/01195 ... 1682f1727b

I didn't manage to use /dev/video0 with ffmpeg but I didn't spend a lot of times trying (I'm tired :D )
I'll try again tomorrow.

Code: Select all

ffmpeg
[video4linux2,v4l2 @ 0x29c5230] ioctl(VIDIOC_REQBUFS): Cannot allocate memory
/dev/video0: Cannot allocate memory

dmesg
[  232.948018] cma: cma_alloc: alloc failed, req-size: 1020 pages, ret: -16
[  232.948037] unicam 3f801000.csi1: dma_alloc_coherent of size 4177920 failed
Your lines

Code: Select all

echo "dtparam=i2c_vc" > /boot/config.txt
echo "dtoverlay=tc358743-fast" > /boot/config.txt
look dubious - I think you want >> to append to the file!

It looks like I did miss one bit - you need to allocate some CMA memory. Add "cma=128M" to /boot/cmdline.txt for 128M (how much you need depends on what you're streaming - 1080P frames as RGB3 are 6MB a shot, so even 32M is probably sufficient).

I have got a hacked test app based on yavta that feeds the data into MMAL for ISP, rendering, and encoding. See https://github.com/6by9/yavta. Command line something like

Code: Select all

./yavta --capture=1000 -n 3 --encode-to=file.h264 -f UYVY -m -T /dev/video0
It also queries the current DV_TIMINGS (or STD for analogue video capture) and sets the current format, so you don't have to worry about doing that manually. It doesn't handle changes in format whilst streaming.
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.

User avatar
madnerd
Posts: 10
Joined: Wed Nov 01, 2017 6:43 am
Location: Montpellier, France
Contact: Website Twitter

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

Thu Nov 09, 2017 12:25 pm

Your lines look dubious - I think you want >> to append to the file!
:oops: I fixed it

I added cma=128M to /boot/cmdline
Tried ffmpeg again and got errors in dmesg

Code: Select all

[video4linux2,v4l2 @ 0x1c7d230] ioctl(VIDIOC_G_PARM): Inappropriate ioctl for device
[video4linux2,v4l2 @ 0x1c7d230] Time per frame unknown

Code: Select all

[  216.319375] unicam 3f801000.csi1: dma_alloc_coherent of size 4177920 failed
I added cma=256M to /boot/cmdline
ffmpeg still doesn't works, but i've got no errors in dmesg

I tried to compile yavta but got an error

Code: Select all

 undefined reference to `vcsm_import_dmabuf'
I manage to compile it by putting this variable to MMAL_FALSE but I'm pretty sure it won't work without this.

Code: Select all

#define VCSM_IMPORT_DMABUF MMAL_FALSE
When I start yavta, it just freezes and no data is written in file.h264

Code: Select all

vc.ril.isp:in:0(UYVY)(0x1ac2fb0)type: video, fourcc: UYVY bitrate: 0, framed: 0 extra data: 0, (nil) width: 1920, height: 1088, (0,0,1920,1080) pixel aspect ratio: 0/0, frame rate: 0/0 buffers num: 3(opt 1, min 1), size: 4177920(opt 4177920, min: 4177920), align: 0Created pool of length 3, size 0
Enable encoder....
Create pool of 3 buffers of size 3133440 for encode/render
Create pool of 3 buffers of size 0 for render
Create pool of 3 buffers of size 0 for encode ip
Create pool of 8 buffers of size 262144
Sent buffer 0x1acd158Sent buffer 0x1acd330Sent buffer 0x1acd508Sent buffer 0x1acd6e0Sent buffer 0x1acd8b8Sent buffer 0x1acda90Sent buffer 0x1acdc68Sent buffer 0x1acde403 buffers requested.
length: 4177920 offset: 0 timestamp type/source: mono/EoF
Buffer 0/0 mapped at address 0x71204000.
Linking V4L2 buffer index 0 ptr 0x1acea70 to MMAL header 0x1ac94c0. mmal->data 0x71204000
length: 4177920 offset: 4177920 timestamp type/source: mono/EoF
Buffer 1/0 mapped at address 0x70e08000.
Linking V4L2 buffer index 1 ptr 0x1aceae0 to MMAL header 0x1ac9698. mmal->data 0x70E08000
length: 4177920 offset: 8355840 timestamp type/source: mono/EoF
Buffer 2/0 mapped at address 0x70a0c000.
Linking V4L2 buffer index 2 ptr 0x1aceb50 to MMAL header 0x1ac9870. mmal->data 0x70A0C000

Return to “Graphics, sound and multimedia”

Who is online

Users browsing this forum: No registered users and 2 guests