tytyty wrote: ↑Thu Aug 31, 2017 3:12 am
HI,
Thank you for your reply.
Firstly ,i already know that through SPI to control registers in the drive.Do I need to do the V4L2 in the drive?
V4L2 is the standard approach for media devices under Linux. Anything else and you need to provide all the supporting framework.
V4L2 supports subdevices, so you normally have one subdevice controlling the sensor, and another controlling the hardware that receives the images and writes it to memory. The subdevice for writing CSI2 to memory is in the process of being upstreamed to the mainline Linux kernel. The sensor subdevice will be up to you if it hasn't been done already by someone else.
tytyty wrote: Secondly,OV5647 can be used properly on raspberry pie,but Why can't I find the driver for OV5647 in raspberry pi kernel?
Because all the control and processing is done in the closed source GPU firmware, and the drivers for the OV5647 and IMX219 sensors are in there.
I'll point you at the
PiCamera library docs as it gives a clear explanation of how the Pi camera stack is works, and in particular the
"division of labour" section.
tytyty wrote: Thirdly, i now want to preview the image or take pictures, using the new SNESOR.Is the test program using C or Python?
Do you have the similar test program for app?
If you must use a parallel sensor, then you've got a huge amount of work trying to get a driver working, or you need to look at something like the
TI SN65LVDS315 chip which will convert parallel to CSI1/CCP2 that is supported by the Pi.
How much expertise do you have in image processing? If very little then you'll have a step learning curve and a long way to go.
Assuming you aren't looking at a mono sensor, then you'll be dealing with
Bayer filters in the sensor, so now we have to control black level, gains, shutter speed, white balance, demosaic the image, and numerous other stages. It is not a trivial task, and you may or may not be able to utilise the hardware blocks.
There is an alternative to V4L2 written at a point where I wasn't sure we could write a fully open driver for the receiver peripheral.
viewtopic.php?f=43&t=109137 details the MMAL vc.ril.rawcam component, and with the associated
raspiraw app you can extract the raw images from CSI2 sensors. It can also runs the images through the "vc.ril.isp" component that wraps the ISP (Image Sensor Pipeline), but there aren't that many controls exposed on that yet for full control over the processing.
I'd suggest having a look through that so you can make a judgement call as to whether undertaking this is really a sensible option.
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.