Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for camera module/ CSIconnector on Pi Zero 2W #146

Open
ctacke opened this issue Apr 21, 2024 · 3 comments
Open

Support for camera module/ CSIconnector on Pi Zero 2W #146

ctacke opened this issue Apr 21, 2024 · 3 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@ctacke
Copy link

ctacke commented Apr 21, 2024

I am trying to get this up and running on a Raspberry Pi Zer 2W. I can enumerate the capture devices, and it find 6. All of the devices, however, report zero characteristics, so I can't open them for frame capture.

var devices = new CaptureDevices();
if (devices == null)
{
    Console.WriteLine($"There are no capture devices found");
    return;
}

var en = devices.EnumerateDescriptors();
Console.WriteLine($"There are {en.Count()} capture devices");

foreach (var descriptor in en)
{
    Console.WriteLine("---");
    Console.WriteLine($" {descriptor.Name}");
    Console.WriteLine($" {descriptor.Description}");
    Console.WriteLine($" {descriptor.DeviceType}");
    if (descriptor.Characteristics.Length == 0)
    {
        Console.WriteLine($" descriptor has zero characteristics");
    }
    else
    {
        foreach (var c in descriptor.Characteristics)
        {
            Console.WriteLine($"   {c.Width}x{c.Height} @ {c.PixelFormat}");
        }
    }
}

Gives an output of

There are 6 capture devices
---
 unicam
 platform:3f801000.csi: unicam
 V4L2
 descriptor has zero characteristics
---
 unicam
 platform:3f801000.csi: unicam
 V4L2
 descriptor has zero characteristics
---
 bcm2835-isp
 platform:bcm2835-isp: bcm2835-isp
 V4L2
 descriptor has zero characteristics
---
 bcm2835-isp
 platform:bcm2835-isp: bcm2835-isp
 V4L2
 descriptor has zero characteristics
---
 bcm2835-isp
 platform:bcm2835-isp: bcm2835-isp
 V4L2
 descriptor has zero characteristics
---
 bcm2835-isp
 platform:bcm2835-isp: bcm2835-isp
 V4L2
 descriptor has zero characteristics
@kekyo
Copy link
Owner

kekyo commented Apr 23, 2024

Thanks reached out!

I am not sure where the problem lies, as I do not have a camera that connects via MIPI.

Maybe some hack is needed to enumerate V4L2 in RPi's MIPI connection. I found some information about this on a Japanese blog, but I could not find any technical background.

Link for reference: https://syurecat.hatenablog.com/entry/2022/09/11/230339

@kekyo kekyo added help wanted Extra attention is needed question Further information is requested labels Apr 23, 2024
@Oblivionburn
Copy link

Oblivionburn commented May 15, 2024

You might have to enable LegacyCamera in raspi-config and install the following libraries in order for .NET Core to fully interact with the camera hardware:
sudo apt-get install v4l-utils
sudo apt-get install libc6-dev libgdiplus libx11-dev

Example project of someone getting a .NET Core project working with a Raspberry Pi 3's camera (different camera lib, but maybe similar dependency requirements):
https://neilsnotes.net/Software/Coding/dotnetPiCam.html

@kekyo
Copy link
Owner

kekyo commented May 16, 2024

Thanks provided infos!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants