Custom sensor mipi RAW8 format error in TX2

Hello,

I develop 5M pixel Custom senor on jetson TX2.

I checked image in mipi RAW10 format.
I want to change RAW10 to RAW8 .

so I changed device tree (dtsi) as shown below.

mode_type = "bayer";
pixel_phase = "grbg";  
csi_pixel_bit_depth = "8";    //"10";

When device driver registed, serial-error log messege shown.
[ 80.466053] extract_pixel_format: Need to extend formatbayer_grbg8
[ 80.472408] s5k5e8 2-0018: Unsupported pixel format
[ 80.477408] s5k5e8 2-0018: Failed to read mode0 image props
[ 80.483078] s5k5e8 2-0018: Could not initialize sensor properties.
[ 80.489645] s5k5e8 2-0018: Failed to initialize s5k5e8
[ 80.495281] s5k5e8 2-0018: tegra camera driver registration failed
[ 80.504974] s5k5e8: probe of 2-0018 failed with error -22

please, give me some advise.

Sorry to tell TX2 not support raw8

Hi @jpchae,

As @ShaneCCC mentioned, the Nvidia kernel source code does not include support for the RAW8 format, meaning that you won’t be able to use for example nvarguscamerasrc plugin on gstreamer. However, you can extend the support and use v4l2src to capture frames using gstreamer.

You can find useful information in the L4T programming guide: https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3231/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide%2Fjetson_xavier_camera_soft_archi.html

You will need to add support on the following files:

kernel/nvidia/drivers/media/platform/tegra/camera/camera_common.c

at struct,

static const struct camera_common_colorfmt camera_common_color_fmts[] = {
        ...
	{
		MEDIA_BUS_FMT_SRGGB8_1X8,
		V4L2_COLORSPACE_SRGB,
		V4L2_PIX_FMT_SRGGB8,
	},
	{
		MEDIA_BUS_FMT_SBGGR8_1X8,
		V4L2_COLORSPACE_SRGB,
		V4L2_PIX_FMT_SBGGR8,
	},
        ...

Also you need to add the pixel format at:

kernel/nvidia/drivers/media/platform/tegra/camera/sensor_common.c

In the extract_pixel_format method:


static int extract_pixel_format(
	const char *pixel_t, u32 *format)
{
	size_t size = strnlen(pixel_t, OF_MAX_STR_LEN);

       ...
	else if (strncmp(pixel_t, "bayer_bggr8", size) == 0)
		*format = V4L2_PIX_FMT_SBGGR8;
	else if (strncmp(pixel_t, "bayer_rggb8", size) == 0)
		*format = V4L2_PIX_FMT_SRGGB8;
      ...

Be sure just to add the RAW8 support and do not modify anything else. I have successfully worked with RAW8 sensors on Jetson platforms.

Regards,
Fabian
www.ridgerun.com

1 Like