Jetson Tx2 camera WDR mode setup

Hello All,

I’m developing New custom image sensor with support WDR.

It supports short / long exposetime setup register.
but it not like WDR-DOL method of imx274 .

is it possible to setup WDR on/off by gst-launch command?
otherwise, it loading set mode by image set files table with wdr register setup?

please, let me know how to setup for using two expose register with WDR.

Thanks.

hello jpchae,

there’re different sensor modes, you may also look into the kernel sources of IMX274.
it’s user-space to choose which sensor mode to enable for streaming, while switch to mode2 will be the DOL-WDR results.
for example,

                                mode0 { // IMX274_MODE_3840X2160
                                        mode_type = "bayer";
                                        pixel_phase = "rggb";

...
                                mode2 { // IMX274_MODE_3840X2160_DOL_30FPS
                                        mode_type = "bayer_wdr_dol";
                                        pixel_phase = "rggb";

Hello JerryChang,

As you recommended, i added mode2 in setting table as shown below.

static const struct camera_common_frmfmt s5k2x5_frmfmt = {
{{5760, 4312}, S5K2X5_30fps, 1, 0, S5K2X5_MODE_5760X4312},
{{2880, 2156}, S5K2X5_100fps, 1, 0, S5K2X5_MODE_2880X2156},
{{5760, 4312}, S5K2X5_30fps, 1, 0, S5K2X5_MODE_5760X4312_WDR},

};

how to apply to gst-launch command of mode2?

as you know, gst-launch-1.0 command is mode change by depend of resolution information.

hello jpchae,

it’s correct.

so, there’s argus_camera application which provide user-interface for choose the mode index to initial camera stream.
you may install MMAPI via SDKManager, or, using the commands to install the multimedia component.
i.e. sudo apt-get install nvidia-l4t-jetson-multimedia-api
thanks

hello JerryChang,

You mean nvidia-l4t-jetson-multimedia-api file install in Jetson Tx2?
and then, is it nessary to compile for using application ?

thanks

hello jpchae,

it’s commands to install multimedia API components. you may found they locate as below.
i.e. /usr/src/jetson_multimedia_api/

there’s README file of Argus for the steps for building Argus samples and application.
thanks

Hello JerryChang,

I added wdr setting mode in device driver.
i was register device driver and it was fail to register as shown below.

livsmed@livsmed-desktop:~/Documents$ sudo insmod s5k2x5sp_a1.ko
[sudo] password for livsmed:
[ 47.729457] extract_pixel_format: Need to extend formatbayer_wdr_dol_grbg10
[ 47.736468] s5k2x5 2-0010: Unsupported pixel format
[ 47.741383] s5k2x5 2-0010: Failed to read mode2 image props
[ 47.747043] s5k2x5 2-0010: Could not initialize sensor properties.
[ 47.753254] s5k2x5 2-0010: Failed to initialize s5k2x5
[ 47.758446] s5k2x5 2-0010: tegra camera driver registration failed
[ 47.767217] s5k2x5: probe of 2-0010 failed with error -22

what am i missed setup?

hello jpchae,

please refer to VI kernel driver, you may also extend the support pixel formats.
for example,
$L4T_Sources/r32.4.3/Linux_for_Tegra/source/public/kernel/nvidia/drivers/media/platform/tegra/camera/ sensor_common.c

static int extract_pixel_format(
        const char *pixel_t, u32 *format)
{
...
        else if (strncmp(pixel_t, "bayer_wdr_pwl_rggb12", size) == 0)
                *format = V4L2_PIX_FMT_SRGGB12;
        else if (strncmp(pixel_t, "bayer_wdr_dol_rggb10", size) == 0)
                *format = V4L2_PIX_FMT_SRGGB10;
...

Hello JerryChang,

As you recommended, i edited pixel formats in sensor_common.c

	else if (strncmp(pixel_t, "bayer_wdr_pwl_rggb12", size) == 0)
		*format = V4L2_PIX_FMT_SRGGB12;
	else if (strncmp(pixel_t, "bayer_wdr_dol_rggb10", size) == 0)
		*format = V4L2_PIX_FMT_SRGGB10;
	else if (strncmp(pixel_t, "bayer_wdr_dol_grbg10" , size) == 0)
		*format = V4L2_PIX_FMT_SGRBG10;

I run kernel compile .
and then I flash kernel Image using flash.sh tool as shown below.
sudo ./flash.sh -k kernel jetson-tx2 mmcblk0p1

but I think modified code was not apply in kernel.
device driver register also display extract_pixel_format error.

kernel compile and fuse kernel are sequence as below.
please , tell me if any wrong sequence.

  1. kernel compile
    $cd public_sources/
    $JETSON_TX2_KERNEL_SOURCE=$(pwd)
    $cd $JETSON_TX2_KERNEL_SOURCE
    $CROSS_COMPILE=$HOME/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
    $export LOCALVERSION=-tegra // compile in non tegra system
    $KERNEL_OUT=$JETSON_TX2_KERNEL_SOURCE/build
    $KERNEL_MODULES_OUT=$JETSON_TX2_KERNEL_SOURCE/modules
    $make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT tegra_defconfig
    $make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j2 Image

  2. kernel flash.
    $public_souces/build/arch/arm64/boot dirictory → cp Image /Linux_for_Tegra/kernel/
    $Linux_for_Tegra/ sudo ./flash.sh -k kernel jetson-tx2 mmcblk0p1

hello jpchae,

please note that’s cboot to choose the kernel image while boot-up, it’s refer to /boot/extlinux/extlinux.conf for the LINUX entry.
hence, please have a try to copy your compile /boot/Image to your TX2 platform and replace it, doing warm-reboot to take effect.
thanks

hello JerryChang,

Image file was copy to boot folder in Jetson Tx2.
and reboot was stop as below picture.

The kernel source has not been changed so far.

my kernel version is 4.9.140-tegra-32.3.1

hello jpchae,

you may rule out what’s the modification you’d done to cause the failure.
suggest you may setup serial console to gather all bootloader logs for checking,
thanks