Gstreamer / V4L support for MIPI CSI transmitter device

Matt Redfearn matt.redfearn at thinci.com
Tue Apr 9 15:39:25 UTC 2019


Hi,

I'm writing a Linux driver for a MIPI CSI transmitter device. This 
hardware allows the Linux system to transmit a MIPI CSI stream to a 
suitable MIPI CSI receiver i.e. Linux behaves like a camera.
So far I have added a V4L output driver for the hardware and I am able 
to transmit a video stream. To do this I am using gstreamer with v4l2sink:

gst-launch-1.0 videotestsrc  ! 
video/x-bayer,width=640,height=480,format=bggr ! v4l2sink device=/dev/video0

The issue is that the MIPI CSI transmitter needs to know the video 
timings (pixelclock & blanking periods) that it should drive to the MIPI 
CSI bus. For now, I just hardcoded 640x480 at 60fps numbers into the driver.
Ideally, I think I need to add support for DV_TIMINGS ioctls such that 
userspace can enumerate the possible video timings (probably just a 
subset of v4l2_dv_timings_presets)

I would then need to add support to Gstreamer's v4l2sink to get the 
dv_timings, if supported, pick one compatible with the video caps, and 
set it, along with the pixel format.

Is this the best approach? Are there any gotchas in this or other things 
I should consider doing instead? One possibility is that I should 
instead make the driver in the DRM subsystem. I didn't initially do that 
do to missing support for the more exotic pixel formats that MIPI CSI 
has e.g. raw bayer. But of course, DRM would give me much easier access 
to video timings...

Thanks for any advice.
Matt


More information about the gstreamer-devel mailing list