johnap
Posts: 29
Joined: Fri Jun 14, 2019 5:26 pm

Simple B102 hdmi-csi2 example needed please

Mon Apr 26, 2021 2:40 pm

Hi all,

I used to use a cheap Chinese clone of these cards, the sort that used the camera interface, and a bit of python code did what I want (displayed the hdmi image fullscreen, flipped).

I had to replace it as it broke and ended up with a B102, but it seems that doesn't use the same interface.

The documentation I've found so far is all about the B101 which uses the camera interface.

Is there a really simple guide to how to just display the incoming image fullscreen please?

Thanks

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

Re: Simple B102 hdmi-csi2 example needed please

Mon Apr 26, 2021 3:38 pm

Auvidea B102 is the same interface as the B101 but using the 22 pin connector as found on the Pi0 and Compute Modules instead of the 15 pin connector found on all other Pis.

You can NOT use a Pi Zero camera cable to connect it to a normal Pi - they are not reversible.

B101, B102, and all the Chinese clones use exactly the same drivers and config.
With B102 on a Compute Module CAM1 connector you can add "4lane=1" parameter to the end of the dtoverlay=tc358743 line to get support for 1080p60.
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.

johnap
Posts: 29
Joined: Fri Jun 14, 2019 5:26 pm

Re: Simple B102 hdmi-csi2 example needed please

Mon Apr 26, 2021 5:33 pm

thanks, I am using a Pi Zero, which is why I ordered the B102 rather than B101, and the cable that came with it.

I've got the dtoverlay set (without the 4lane=1 obviously. I only need 30fps anyway, more than enough and lcd native resolution is 1366x768 anyway).

But the usual python code isn't working and raspistill -o image.jpg isn't working (cannot read camera info, keeping the defaults for OV5647" "mmal_vc_component_create: failed to create component 'vc.ril.camera' )1:ENOMEM)" etc etc ending with camera not detected

any ideas please? thanks

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

Re: Simple B102 hdmi-csi2 example needed please

Mon Apr 26, 2021 5:41 pm

Ensure you use Auvidea's FFC cable with the B102 - they chose to use contacts on the same side, whilst most other devices use opposing sides.

I think I need to refer you to the install instructions - viewtopic.php?f=38&t=281972
(I have just edited to make this planer)
Firstly, use of raspivid or Picamera with this chip is NOT supported. Any post saying that you're trying to use raspivid, Picamera, or other mechanism to use the firmware drivers with this chip will get shut down very fast and abruptly, potentially to the extent of deleting the post.
Loading "dtoverlay=tc358743" will block the use of raspivid/raspistill/Picamera. You get /dev/video0 instead, and follow the instructions on the correct way to use the V4L2 device.
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.

johnap
Posts: 29
Joined: Fri Jun 14, 2019 5:26 pm

Re: Simple B102 hdmi-csi2 example needed please

Mon Apr 26, 2021 5:49 pm

Thank you! Got to the point of the EDID file. Unicam shows up in the devices. But how do I create an EDID file please?

johnap
Posts: 29
Joined: Fri Jun 14, 2019 5:26 pm

Re: Simple B102 hdmi-csi2 example needed please

Mon Apr 26, 2021 5:50 pm

And sorry to be a pain, but I can't thank you enough for the help. I was expecting this to just work like my last one and really bummed to find it doesn't! Lost a lot of time since the last device died trying to find another chinese clone before giving in and paying for the b102, so another struggle to get this working is the last thing I need!

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

Re: Simple B102 hdmi-csi2 example needed please

Mon Apr 26, 2021 8:39 pm

You can use it like the other one (remove the dtoverlay line), just don't ask for any support with it as you'll be using the unsupported firmware drivers.
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.

johnap
Posts: 29
Joined: Fri Jun 14, 2019 5:26 pm

Re: Simple B102 hdmi-csi2 example needed please

Mon Apr 26, 2021 9:31 pm

thanks, I'll try that tomorrow. For right now, I literally just *need* it to flip the image and display it, so if it works like it used to, no support beyond this needed.

But, that said, I would prefer to be able to build on this in the future so I'd rather do it properly. Is there a guide somewhere to how I make this file?

Thanks again

johnap
Posts: 29
Joined: Fri Jun 14, 2019 5:26 pm

Re: Simple B102 hdmi-csi2 example needed please

Tue Apr 27, 2021 7:34 am

Got it! Works perfectly as the "camera" without using the dtoverlay, thank you! At least now I have my teleprompter the right way around (it's actually more about the UI of zoom etc from my mac secondary HDMI being readable and not backwards).

I'd still love to get the EDID file setup so I can use it properly if anyone can advise please on how to do that.

Many thanks

johnap
Posts: 29
Joined: Fri Jun 14, 2019 5:26 pm

Re: Simple B102 hdmi-csi2 example needed please

Mon Jul 19, 2021 5:52 am

Hi all,

Wonder if anyone can help. The above is still working (although it's not perfect - if the screen is turned off and then i turn it on again, I have to ssh into the PI and boot to get the screen to work again). So that's issue 1.

The other issue though is I need to take a split of the HDMI signal so I can display one on a multiview monitor connected to an ATEM mini pro iso, and the other to continue being flipped for the teleprompter.

I've tried two hdmi splitters (active), but neither work properly. I'm splitting the signal coming from my mac, with one going to the ATEM and one going to the PI.

I think the problem could be because of the confusion of what is being sent to the PI (ie, the ATEM says it is 1920x1080, and the lcd monitor for the teleprompter says it is 1280x720.

If I split after the PI has flipped it, that seems to work ok, but of course the image on my multiview monitor is now flipped! And the point of using it there is so I can more easily see and read text ' ie. chat, shared screens etc) rather than trying to read it on a small monitor 1m or so away.

So at the moment my option seems to be to buy another TC358743 and PI and use that to flip the image back to normal. Seems a long way of going around it!

Or maybe.I could use other second HDMI output on one of my RPi 4s to do it. Still a bit clunky though.

Does anyone have any better ideas please=
Thanks

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

Re: Simple B102 hdmi-csi2 example needed please

Mon Jul 19, 2021 9:14 am

You're using the unsupported firmware drivers, so largely I'm afraid you're on your own.

If I understand you, you've got.

Code: Select all

Mac->Splitter-+->Atem Mini
              +->TC358743 board->Pi->Teleprompter screen
I don't use Macs, but there must be a way to manually configure the output resolution/refresh rate of the HDMI output. Windows has it under Display Settings (right click desktop and it's there), and X has it via xrandr or one of the graphical equivalents (arandr, or Screen Display on Ubuntu).
Just tell your Mac the format that you want it to output rather than letting it/the splitter process a combined EDID in some funny way.

And the teleprompter screen is being driven at whatever resolution the Pi has chosen, nothing to do with the resolution of the Mac.
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.

johnap
Posts: 29
Joined: Fri Jun 14, 2019 5:26 pm

Re: Simple B102 hdmi-csi2 example needed please

Mon Jul 19, 2021 12:39 pm

6by9 wrote:
Mon Jul 19, 2021 9:14 am
You're using the unsupported firmware drivers, so largely I'm afraid you're on your own.

If I understand you, you've got.

Code: Select all

Mac->Splitter-+->Atem Mini
              +->TC358743 board->Pi->Teleprompter screen
I don't use Macs, but there must be a way to manually configure the output resolution/refresh rate of the HDMI output. Windows has it under Display Settings (right click desktop and it's there), and X has it via xrandr or one of the graphical equivalents (arandr, or Screen Display on Ubuntu).
Just tell your Mac the format that you want it to output rather than letting it/the splitter process a combined EDID in some funny way.

And the teleprompter screen is being driven at whatever resolution the Pi has chosen, nothing to do with the resolution of the Mac.
Thanks. Yes, there is and I've tried that before. But I just tried it again, this time connecting to the ATEM first, and then rebooting the PI. And so far, so good. But not sure what the difference is with what I've tried before. Sure I've done this. But... for now at least, it is working. Let's see on a reboot/restart of ATEM etc.

That said... I just changed the resolution again and now the PI has stopped capturing the input... The image on the teleprompter screen is frozen. Even after a reboot of the PI...

Just spent 10 mins or so trying different boot up orders etc and so far not got it back.

How do I use the drivers correctly?

All I need is for the PI to take the image in, flip it, and show it full screen. Nothing else at all, ever. One simple use. Can you please advise?

Thanks!

johnap
Posts: 29
Joined: Fri Jun 14, 2019 5:26 pm

Re: Simple B102 hdmi-csi2 example needed please

Mon Jul 19, 2021 12:43 pm

This is the error I always get, even when it works on the PI alone

Code: Select all

mmal: mmal_vc_port_enable: failed to enable port vc.null_sink:in:0(OPQV): ENOSPC
mmal: mmal_port_enable: failed to enable connected port (vc.null_sink:in:0(OPQV))0xfcbdc0 (ENOSPC)
mmal: mmal_connection_enable: output port couldn't be enabled
Traceback (most recent call last):
  File "/home/pi/Documents/camera_start.py", line 9, in <module>
    camera = PiCamera()
  File "/usr/lib/python3/dist-packages/picamera/camera.py", line 433, in __init__
    self._init_preview()
  File "/usr/lib/python3/dist-packages/picamera/camera.py", line 513, in _init_preview
    self, self._camera.outputs[self.CAMERA_PREVIEW_PORT])
  File "/usr/lib/python3/dist-packages/picamera/renderers.py", line 558, in __init__
    self.renderer.inputs[0].connect(source).enable()
  File "/usr/lib/python3/dist-packages/picamera/mmalobj.py", line 2212, in enable
    prefix="Failed to enable connection")
  File "/usr/lib/python3/dist-packages/picamera/exc.py", line 184, in mmal_check
    raise PiCameraMMALError(status, prefix)
picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resources

johnap
Posts: 29
Joined: Fri Jun 14, 2019 5:26 pm

Re: Simple B102 hdmi-csi2 example needed please

Mon Jul 19, 2021 6:48 pm

johnap wrote:
Mon Jul 19, 2021 12:43 pm
This is the error I always get, even when it works on the PI alone

Code: Select all

mmal: mmal_vc_port_enable: failed to enable port vc.null_sink:in:0(OPQV): ENOSPC
mmal: mmal_port_enable: failed to enable connected port (vc.null_sink:in:0(OPQV))0xfcbdc0 (ENOSPC)
mmal: mmal_connection_enable: output port couldn't be enabled
Traceback (most recent call last):
  File "/home/pi/Documents/camera_start.py", line 9, in <module>
    camera = PiCamera()
  File "/usr/lib/python3/dist-packages/picamera/camera.py", line 433, in __init__
    self._init_preview()
  File "/usr/lib/python3/dist-packages/picamera/camera.py", line 513, in _init_preview
    self, self._camera.outputs[self.CAMERA_PREVIEW_PORT])
  File "/usr/lib/python3/dist-packages/picamera/renderers.py", line 558, in __init__
    self.renderer.inputs[0].connect(source).enable()
  File "/usr/lib/python3/dist-packages/picamera/mmalobj.py", line 2212, in enable
    prefix="Failed to enable connection")
  File "/usr/lib/python3/dist-packages/picamera/exc.py", line 184, in mmal_check
    raise PiCameraMMALError(status, prefix)
picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resources
Sorry, this bit is a red herring. For some silly reason I had put the command to start the script in my .bashrc script so it was trying to launch it each time I ssh'd in! Will try it all again tomorrow, not at my desk now for the night.

Would still be in interested in knowing how I am meant to be using this properly though. Thanks.

johnap
Posts: 29
Joined: Fri Jun 14, 2019 5:26 pm

Re: Simple B102 hdmi-csi2 example needed please

Wed Jul 21, 2021 6:41 pm

Ok, I've got somewhere.

I've added the dtoverlay (with dtoverlay=tc358743,4lane=1) as I'm using the b102

I've added an EDIT.txt file (can't remember where I got it now, I've been searching a lot).

Done the following:

Code: Select all

v4l2-ctl --set-edid=file=edid.txt
v4l2-ctl --query-dv-timings
v4l2-ctl --set-dv-bt-timings query

Code: Select all

v4l2-ctl -V
shows

Code: Select all

Format Video Capture:
	Width/Height      : 1280/720
	Pixel Format      : 'UYVY' (UYVY 4:2:2)
	Field             : None
	Bytes per Line    : 2560
	Size Image        : 1843200
	Colorspace        : SMPTE 170M
	Transfer Function : Default (maps to Rec. 709)
	YCbCr/HSV Encoding: Default (maps to ITU-R 601)
	Quantization      : Default (maps to Limited Range)
	Flags             :
	
I've installed gstreamer (base, good and bad plugins).

I have GPU memory set to 128M

I want to run without X.

The following shows a test pattern on the CLI on the FB.

Code: Select all

gst-launch-1.0 -v videotestsrc ! fbdevsink
Now all I need is to get /dev/video0 to play on the fb sink (well, and flip it horizontally too).

I've tried so many things, but none are working.

Can someone please help with the correct pipeline to use to display from the b102 to the fb ?

Thanks!

johnap
Posts: 29
Joined: Fri Jun 14, 2019 5:26 pm

Re: Simple B102 hdmi-csi2 example needed please

Fri Jul 23, 2021 11:26 am

Well I finally managed to get a picture and flip it too. But the frame rate had to be a bit lower than I hoped for.

But before wasting more time, I tried the hdmi splitter and no matter what I do, it still doesn't go to the ATEM as well as the RPI so I may as well just revert to my original script which works fine.

I may look at using an RPI 4 for dual output instead of the RPI Zero W.

Thanks

Return to “Graphics, sound and multimedia”