Regarding state of the successful RAW12 capture and related queries

Hello,

I am using Jetpack 35.1 and working on custom camera driver. I am using a closed source application which is trying to capture the RAW12 data. I used pxel format as BG12

I added the below lines to common_camera.c in the

static const struct camera_common_colorfmt camera_common_color_fmts[] = {

  • {*
  •            MEDIA_BUS_FMT_SBGGR12_1X12,*
    
  •            V4L2_COLORSPACE_SRGB,*
    
  •            V4L2_PIX_FMT_SBGGR12*
    
  •    },*
    


};

and pixel_t = “bayer_bggr12”; to my device tree node for mode[n]

So are these the only two places where I shall add for RAW12 format?

I did the kernel tracing and get the below output:

# cat /sys/kernel/debug/tracing/traceuntu:/tmp/bin# sudo echo 0 > /sys/kernel/debug/tracing/events/v4l2/enable 
# tracer: nop
#
# entries-in-buffer/entries-written: 529/529   #P:4
#
#                                _-----=> irqs-off
#                               / _----=> need-resched
#                              | / _---=> hardirq/softirq
#                              || / _--=> preempt-depth
#                              ||| /     delay
#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION
#              | |         |   ||||      |         |
 sampleRetrieveD-2597    [001] ....  3332.579426: tegra_channel_open: vi-output, irs2381c 12-003d
 sampleRetrieveD-2597    [001] ....  3332.717053: v4l2_qbuf: minor = 0, index = 0, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = ANY, timestamp =
 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
 sampleRetrieveD-2597    [001] ....  3332.729689: v4l2_qbuf: minor = 0, index = 1, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = ANY, timestamp =
 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
 sampleRetrieveD-2597    [001] ....  3332.742463: v4l2_qbuf: minor = 0, index = 2, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = ANY, timestamp =
 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
 sampleRetrieveD-2597    [001] ....  3332.755456: v4l2_qbuf: minor = 0, index = 3, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = ANY, timestamp =
 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
 sampleRetrieveD-2597    [001] ....  3332.786829: tegra_channel_set_power: irs2381c 12-003d : 0x1
 sampleRetrieveD-2597    [001] ....  3332.786869: camera_common_s_power: status : 0x1
 sampleRetrieveD-2597    [001] ....  3332.814161: tegra_channel_set_power: 13e10000.host1x:nvcsi@15a00000- : 0x1
 sampleRetrieveD-2597    [001] ....  3332.814201: csi_s_power: enable : 0x1
 sampleRetrieveD-2597    [001] ....  3332.814366: tegra_channel_capture_setup: vnc_id 0 W 224 H 865 fmt c4
 sampleRetrieveD-2597    [000] ....  3332.821194: tegra_channel_set_stream: enable : 0x1
 sampleRetrieveD-2597    [000] ....  3332.822215: tegra_channel_set_stream: 13e10000.host1x:nvcsi@15a00000- : 0x1
 sampleRetrieveD-2597    [000] ....  3332.822219: csi_s_stream: enable : 0x1
 sampleRetrieveD-2597    [000] ....  3332.822588: tegra_channel_set_stream: irs2381c 12-003d : 0x1
 vi-output, irs2-2603    [003] ....  3332.861046: tegra_channel_capture_frame: sof:3355.739334848
 vi-output, irs2-2603    [003] ....  3332.861050: tegra_channel_capture_frame: eof:3355.746241760
 sampleRetrieveD-2604    [002] ....  3332.861079: v4l2_dqbuf: minor = 0, index = 0, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 3355
739334000, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
 sampleRetrieveD-2604    [002] ....  3332.916205: v4l2_qbuf: minor = 0, index = 0, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp 
= 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
 vi-output, irs2-2603    [003] ....  3332.927697: tegra_channel_capture_frame: sof:3355.805991648
 vi-output, irs2-2603    [003] ....  3332.927699: tegra_channel_capture_frame: eof:3355.812898848
 sampleRetrieveD-2604    [002] ....  3332.928996: v4l2_dqbuf: minor = 0, index = 1, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 3355
805991000, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 1
 vi-output, irs2-2603    [003] ....  3332.994398: tegra_channel_capture_frame: sof:3355.872664768
 vi-output, irs2-2603    [003] ....  3332.994401: tegra_channel_capture_frame: eof:3355.879571680
 sampleRetrieveD-2604    [002] ....  3332.996526: v4l2_qbuf: minor = 0, index = 1, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp 
= 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
 sampleRetrieveD-2604    [002] ....  3333.009554: v4l2_dqbuf: minor = 0, index = 2, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 3355
872664000, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 2
 vi-output, irs2-2603    [003] ....  3333.061041: tegra_channel_capture_frame: sof:3355.939337216
 vi-output, irs2-2603    [003] ....  3333.061043: tegra_channel_capture_frame: eof:3355.946244448
 sampleRetrieveD-2604    [002] ....  3333.076614: v4l2_qbuf: minor = 0, index = 2, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp 
= 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
 sampleRetrieveD-2604    [002] ....  3333.089645: v4l2_dqbuf: minor = 0, index = 3, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 3355
939337000, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 3
 vi-output, irs2-2603    [003] ....  3333.127732: tegra_channel_capture_frame: sof:3356.6010176
 vi-output, irs2-2603    [003] ....  3333.127734: tegra_channel_capture_frame: eof:3356.12917120
 sampleRetrieveD-2604    [002] ....  3333.157171: v4l2_qbuf: minor = 0, index = 3, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp 
= 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
 sampleRetrieveD-2604    [002] ....  3333.169969: v4l2_dqbuf: minor = 0, index = 0, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 3356
006010000, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 4
 vi-output, irs2-2603    [003] ....  3333.194382: tegra_channel_capture_frame: sof:3356.72682688
 vi-output, irs2-2603    [003] ....  3333.194384: tegra_channel_capture_frame: eof:3356.79589920
 sampleRetrieveD-2604    [002] ....  3333.237519: v4l2_qbuf: minor = 0, index = 0, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp 
= 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
 sampleRetrieveD-2604    [002] ....  3333.250556: v4l2_dqbuf: minor = 0, index = 1, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 3356
072682000, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 5
 vi-output, irs2-2603    [003] ....  3333.261047: tegra_channel_capture_frame: sof:3356.139355712
 vi-output, irs2-2603    [003] ....  3333.261049: tegra_channel_capture_frame: eof:3356.146262656
 sampleRetrieveD-2604    [002] ....  3333.317589: v4l2_qbuf: minor = 0, index = 1, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp 
= 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
...
...
...
 = 0
 sampleRetrieveD-2604    [002] ....  3342.652081: v4l2_dqbuf: minor = 0, index = 2, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 3365
340194000, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 122
 vi-output, irs2-2603    [001] ....  3342.661897: tegra_channel_capture_frame: sof:3365.540212096
 vi-output, irs2-2603    [001] ....  3342.661899: tegra_channel_capture_frame: eof:3365.547119360
 sampleRetrieveD-2604    [002] ....  3342.719608: v4l2_qbuf: minor = 0, index = 2, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp 
= 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
 vi-output, irs2-2603    [001] ....  3342.728572: tegra_channel_capture_frame: sof:3365.606885216
 vi-output, irs2-2603    [001] ....  3342.728574: tegra_channel_capture_frame: eof:3365.613792160
 sampleRetrieveD-2604    [002] ....  3342.732644: v4l2_dqbuf: minor = 0, index = 3, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 3365
406866000, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 123
 sampleRetrieveD-2604    [002] ....  3342.799709: v4l2_qbuf: minor = 0, index = 3, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp 
= 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
 sampleRetrieveD-2604    [002] ....  3342.812966: v4l2_dqbuf: minor = 0, index = 0, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 3365
473539000, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 124
 vi-output, irs2-2603    [001] ....  3342.861913: tegra_channel_capture_frame: sof:3365.740230688
 vi-output, irs2-2603    [001] ....  3342.861915: tegra_channel_capture_frame: eof:3365.747137600
 sampleRetrieveD-2597    [000] ....  3342.866783: tegra_channel_set_stream: enable : 0x0
 sampleRetrieveD-2597    [000] ....  3342.866786: tegra_channel_set_stream: irs2381c 12-003d : 0x0
 sampleRetrieveD-2597    [000] ....  3342.873919: tegra_channel_set_stream: 13e10000.host1x:nvcsi@15a00000- : 0x0
 sampleRetrieveD-2597    [000] ....  3342.873922: csi_s_stream: enable : 0x0
 sampleRetrieveD-2597    [000] ....  3342.875871: tegra_channel_set_power: irs2381c 12-003d : 0x0
 sampleRetrieveD-2597    [000] ....  3342.875893: camera_common_s_power: status : 0x0
 sampleRetrieveD-2597    [000] ....  3342.891624: tegra_channel_set_power: 13e10000.host1x:nvcsi@15a00000- : 0x0
 sampleRetrieveD-2597    [000] ....  3342.891628: csi_s_power: enable : 0x0
 sampleRetrieveD-2604    [002] ....  3342.891690: v4l2_qbuf: minor = 0, index = 0, type = VIDEO_CAPTURE, bytesused = 387520, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp 
= 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
 sampleRetrieveD-2597    [000] ....  3343.411100: tegra_channel_close: vi-output, irs2381c 12-003d
root@ubuntu:/tmp/bin#

I have the a few queries:
1)
I believe (seeing from the logs) the frame capture is happening (sof, eof are updated)?
But why it might be the case that only sequence number is getting increased? There is no update in the times (h,m,s) and frame numbers. At least the application runs for 7 seconds.
2)
What is the flag TIMESTAMP_UNKNOWN? Is it being passed by application?
3)
Is it possible that I can dump the v4l2 buffer (it is m’mapped by app I guess), in the kernel?

Many thanks.

Get the trace log. without v4l2 events.

echo 1 > /sys/kernel/debug/tracing/tracing_on
echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb
echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
echo 1 > /sys/kernel/debug/tracing/events/freertos/enable
echo 3 > /sys/kernel/debug/camrtc/log-level
echo 1 > /sys/kernel/debug/tracing/events/camera_common/enable
echo > /sys/kernel/debug/tracing/trace
cat /sys/kernel/debug/tracing/trace

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.