Is there any bug in ISP demosaic?

from datasheet, bayer pattern of our camera is bggr, I configure pixel_phase = “bggr” in DTSI file.
I use this command open camera:
gst-launch-1.0 nvarguscamerasrc ! ‘video/x-raw(memory:NVMM),width=4208, height=3120, framerate=30/1, format=NV12’ ! nvvidconv ! nvegltransform ! nveglglessink -e

The color channel of the video is wrong:

if I configure pixel_phase = “rggb” , color channel is correct.

is there anything wrong in ISP ?

hello camera_bring_up,

may I know which camera sensor it is?
could you please also double confirm with sensor vendor for the sensor output formats.
in addition,
could you please refer to Applications Using V4L2 IOCTL Directly to use V4L2 IOCTL to dump raw files for confirmation.
thanks

Hello,JerryChang:

our sensor is ov13b10

I can confirm our sensor’s bayer pattern is bggr, because our other platform project used this sensor and configured bayer pattern =bggr,it works well.

Hello,JerryChang:

our sensor is ov13b10

I can confirm our sensor’s bayer pattern is bggr, because our other platform project used this sensor and configured bayer pattern =bggr,it works well.

hello camera_bring_up,

you should use the following properties, may I know the complete sensor formats you’d reported in the device tree.
i.e.
• mode_type
• csi_pixel_bit_depth
• pixel_phase

could you please also adding some debug message to check fourcc reports.
you may look into below kernel sources,
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)
{
...
        if (strncmp(pixel_t, "bayer_bggr10", size) == 0)
                *format = V4L2_PIX_FMT_SBGGR10;

dtsi:
image

I use command :sudo media-ctl -p -d /dev/media0

it shows:

Media controller API version 0.1.0

Media device information

driver tegra194-vi5
model NVIDIA Tegra Video Input Device
serial
bus info
hw revision 0x3
driver version 0.0.0

Device topology

  • entity 1: 15a00000.nvcsi–3 (2 pads, 2 links)
    type V4L2 subdev subtype Unknown flags 0
    device node name /dev/v4l-subdev0
    pad0: Sink
    ← “ov13b10 2-0036”:0 [ENABLED]
    pad1: Source
    → “vi-output, ov13b10 2-0036”:0 [ENABLED]

……

……

  • entity 10: ov13b10 2-0036 (1 pad, 1 link)
    type V4L2 subdev subtype Sensor flags 0
    device node name /dev/v4l-subdev3
    pad0: Source
    [fmt:SBGGR10_1X10/4208x3120 field:none colorspace:srgb]
    → “15a00000.nvcsi–3”:0 [ENABLED]

  • entity 12: vi-output, ov13b10 2-0036 (1 pad, 1 link)
    type Node subtype V4L flags 0
    device node name /dev/video0
    pad0: Sink
    ← “15a00000.nvcsi–3”:1 [ENABLED]

and I have check code in sensor_common,it is correct

hello camera_bring_up,

could you please have a try to modify the device tree property as below.
please have a try to use pixel_t instead of mode_type/csi_pixel_bit_depth/pixel_phase to report pixel formats.
for example,

pixel_t = "bayer_bggr";

ov13b10_4208X3120_BGGR_10.raw (25.0 MB)

v4l2-ctl -d /dev/video0 --set-fmt-video=width=4208,height=3120,pixelformat=BG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=ov13b10_4208X3120_BGGR_10.raw

Dear JerryChang:

image
judge from code in sensor_common.c ,I think I should configured pixel_t ="bayer_bggr10"and delete mode_type/csi_pixel_bit_depth/pixel_phase

I have try it. With this configure,I can not open camera

may I know what’s the failure, could you please attach them for reference,
thanks

wait a moment please , I upload the dmesg log

log shows :

[ 127.108632] [RCE] WARNING: t194/isp5.c:901 [config_channel] “All error notifications not enabled: correctable=0x00 uncorrectable=0x00

[ 70.799546] ov13b10 2-0036: probing v4l2 sensor.
[ 70.799692] ov13b10 2-0036: tegracam_device_register start
[ 70.799710] ov13b10 2-0036: regmap addr : 54
[ 70.799972] ov13b10 2-0036: regmap init success
[ 70.800070] ov13b10 2-0036: !tc_dev->sensor_ops
[ 70.800080] ov13b10 2-0036: mclk in DT extperiph1
[ 70.800329] ov13b10 2-0036: pwdn_gpio:412
[ 70.800423] ov13b10 2-0036: camera avdd-reg has in DT,vana
[ 70.800532] ov13b10 2-0036: camera avdd-reg has in DT
,vif
[ 70.801145] ov13b10 2-0036: camera have get mclk
[ 70.801263] ov13b10 2-0036: sifei common regulator get vana
[ 70.801579] ov13b10 2-0036: camera_common_regulator_get: vana
[ 70.801692] ov13b10 2-0036: sifei common regulator get vif
[ 70.801927] ov13b10 2-0036: camera_common_regulator_get: vif
[ 70.802069] ov13b10 2-0036: camera request pwdn_gpio success!
[ 70.802201] ov13b10 2-0036: camera power get successed
[ 70.802305] ov13b10 2-0036: camera_common_initialize
[ 70.802439] ov13b10 2-0036: camera_common_parse_ports: port 4 num of lanes 4
[ 70.802694] ov13b10 2-0036: ov13b10_probe: name ov13b10_e
[ 70.802857] ov13b10 2-0036: camera_common_create_debugfs ov13b10_e
[ 70.805155] ov13b10 2-0036: tegracam sensor driver:ov13b10_v2.0.6
[ 70.805162] ov13b10 2-0036: camera driver has registed
[ 70.810232] ov13b10 2-0036: ov13b10_board_setup++
[ 70.814964] ov13b10 2-0036: camera_common_mclk_enable: enable MCLK with 19200000 Hz
[ 70.823095] ov13b10 2-0036: camera turing on mclk success
[ 70.828155] ov13b10 2-0036: ov13b10_power_on: power on
[ 70.837694] ov13b10 2-0036: camera power on succeed
[ 70.838242] ov13b10 2-0036: camera ov13b10_board_setup has succeed

[ 70.846164] ov13b10 2-0036: initialized control ops
[ 70.846213] ov13b10 2-0036: ov13b10_set_gain: gain 0 val: 0
[ 70.852524] ov13b10 2-0036: ov13b10_set_exposure: val: 4
[ 70.857363] ov13b10 2-0036: ov13b10_set_exposure_short: val: 0
[ 70.863395] ov13b10 2-0036: ov13b10_set_frame_rate: val: 0
[ 70.868767] ov13b10 2-0036: frame_length is 0

[ 70.874356] ov13b10 2-0036: 0 in control hdl setup
[ 70.879521] ov13b10 2-0036: 0 adding controls
[ 70.884231] ov13b10 2-0036: setup string controls success
[ 70.889279] ov13b10 2-0036: ov13b10_set_gain: gain 16 val: 16
[ 70.895328] ov13b10 2-0036: ov13b10_set_exposure: val: 4
[ 70.900959] ov13b10 2-0036: ov13b10_set_exposure_short: val: 4
[ 70.906853] ov13b10 2-0036: ov13b10_set_frame_rate: val: 47619
[ 70.912539] ov13b10 2-0036: frame_length is 47619

[ 70.918609] ov13b10 2-0036: 0 updating control ranges
[ 70.923955] ov13b10 2-0036: init ctrls success: ov13b10
[ 70.929203] tegra194-vi5 15c10000.vi: subdev ov13b10 2-0036 bound
[ 70.929648] ov13b10 2-0036: camera_common_g_fmt++
[ 70.934924] ov13b10 2-0036: tegra camera subdev registration success
[ 70.940089] ov13b10 2-0036: creating debugfs interface success!
[ 70.942484] ov13b10 2-0036: camera_common_mclk_enable: enable MCLK with 19200000 Hz
[ 70.942808] ov13b10 2-0036: camera_common_dpd_disable: csi 4
[ 70.942840] ov13b10 2-0036: camera_common_dpd_disable: csi 5
[ 70.942853] ov13b10 2-0036: ov13b10_power_on: power on
[ 70.947056] ov13b10 2-0036: camera power on succeed
[ 70.949179] ov13b10 2-0036: ov13b10_power_off: power off
[ 70.950876] ov13b10 2-0036: ov13b10_open:
[ 70.953572] ov13b10 2-0036: camera_common_dpd_enable: csi 4
[ 70.953610] ov13b10 2-0036: camera_common_dpd_enable: csi 5
[ 70.953614] ov13b10 2-0036: camera_common_mclk_disable: disable MCLK
[ 71.002715] ov13b10 2-0036: Detected OV13B10 sensor
[ 90.236066] RTW: Turbo EDCA =0xa42b
[ 106.356013] RTW: Turbo EDCA =0x5ea42b
[ 108.371499] RTW: Turbo EDCA =0xa42b
[ 116.433888] RTW: Turbo EDCA =0x5ea42b
[ 118.449632] RTW: Turbo EDCA =0xa42b
[ 126.652069] ov13b10 2-0036: ov13b10_open:
[ 126.653792] ov13b10 2-0036: camera_common_mclk_enable: enable MCLK with 19200000 Hz
[ 126.654234] ov13b10 2-0036: camera_common_dpd_disable: csi 4
[ 126.654368] ov13b10 2-0036: camera_common_dpd_disable: csi 5
[ 126.654478] ov13b10 2-0036: ov13b10_power_on: power on
[ 126.658907] ov13b10 2-0036: camera power on succeed
[ 126.660592] ov13b10 2-0036: ov13b10_power_off: power off
[ 126.663089] ov13b10 2-0036: camera_common_dpd_enable: csi 4
[ 126.663259] ov13b10 2-0036: camera_common_dpd_enable: csi 5
[ 126.663393] ov13b10 2-0036: camera_common_mclk_disable: disable MCLK
[ 127.108632] [RCE] WARNING: t194/isp5.c:901 [config_channel] “All error notifications not enabled: correctable=0x00 uncorrectable=0x00”

hello camera_bring_up,

may I know which JetPack release version you’re working with,
please check release tag $ cat /etc/nv_tegra_release for more details.
thanks

R32(release),REVISION:4.3,GCID: 21589087,BOARD: t186ref,EABI: aarch64 DATE:……

Sorry JerryChang, the problem have been solved

because we configure
vertical-flip;
horizontal-mirror;
in dtsi

hello camera_bring_up,

thanks for confirmation,
so there’s no further issue need for tracking, right?

1 Like

yes,thans for you help,there is no issue recently!

hello camera_bring_up,

let’s close this topic,
please initial another new forum discussion thread for further supports.
thanks