1

I have a fun one - I'm trying to get an analogue camera input (AHD using a normal BNC connector) over a CSI-2 cable/bus (standard RPi one, not the dual-lane Google ones), and be usable through the CSI port on my RPi4B 8GB.

I couldn't find anything that could directly convert AHD to CSI-2 out there just yet. So my daisy-chain solution has been connecting the camera to an AHD to HDMI converter (Techview AC-1778), HDMI male-to-male, to a Geekworm HDMI to CSI-2 Module (Toshiba TC358743XBG chip, likely a copy), and finally through a CSI-2 cable to the Pi itself.

AHD analogue camera -> (Coax BNC) -> AHD to HDMI converter Techview AC-1778 -> (HDMI male-to-male) -> Geekworm HDMI to CSI-2 Module -> (CSI-2 cable) -> Raspberry Pi4B 8GB.

Sounds glorious right? Well, unfortunately running a raspistill -o test.jpg gives me a generic ENOSPC error, and the picamera Python3 library spits out the following exception: PiCameraMMALError: Failed to enable connection: Out of resources.

I've done the following to try and resolve this, but no success:

  • New install of Debian Buster via the Raspberry Pi Imager.
  • Made sure no other services are using the CSI bus or camera module.
  • Generic updates: sudo apt update, and a firmware upgrade sudo rpi-update (firmware 5.10.36).
  • Toggled enable settings of the camera interface in raspi-config multiple times, throughout this whole process.
  • Confirmed a normal Raspberry Pi Camera V2 is working with raspistill and Python3 lib.
  • Running vcgencmd get_camera returns supported=1 detected=1 when the daisy chain is set up. ls shows /dev/video0 exists, and a dmesg dump shows bcm2835-v4l2-0: V4L2 device registered as video0 - stills mode > 1280x720.
  • Increased GPU_MEM to 256 and tested. Increased it again to 512 and tested. I thought this might've the problem, because analogue video is quite memory intensive, but the AHD to HDMI converter specs says HDMI output is 1080p @ 60Hz or 720p @ 60Hz. Which I thought 512MB of GPU memory should handle easily? A little button on the unit allows you to switch between the modes; I tested with both.
  • Made sure the camera and ADH to HDMI converter actually works by connecting it to a couple monitors, worked on all of them in both resolution modes.
  • Other mentions: I initially clipped the CSI-2 cable upside down in the Geekworm module, and running raspistill -o test.jpg actually displayed an image for a second, it was just static and then what looked like color bars. I thought maybe I damaged the CSI-2 cable, so I tried with 3 other cables of varying lengths (the correct way this time), but same error.

raspistill -o testshot.jpg output:

~ $ raspistill -o testshot.jpg
mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates```

**Python3 picamera library output:**

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))0x3b83440 (ENOSPC) mmal: mmal_connection_enable: output port couldn't be enabled ...code callstack here... /lib/python3.7/site-packages/picamera/exc.py", line 184, in mmal_check raise PiCameraMMALError(status, prefix) picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resources```

I'm stumped. Any thoughts or advice on what to do next? Is there a better, or working, method of getting an analogue video signal over CSI-2? Has anyone actually got analogue input into a Pi over CSI?

Edit: I've been reading some technical documentation the Toshiba TC358743XBG chip, and I might have found the problem. This chip (or maybe the RPi CSI bus) may only support up to 1080p25 input. And the HDMI converter specs indicate 30hz at the lowest.

Not sure if this is 100% the issue, but if so downsampling the video pre-CSI-2 conversion might be a fix.

Does anyone know a straightforward way to do this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.