Jetpack-4.6 tx2 : v4l2-ctl --stream-mmap needs nvarguscamerasrc to succeed

The nominal ‘pix_clk_hz’ for that sensor mode is 396000000 (396 Mpx/s) setting it to 450 Mpx/s does not make the things work better. Setting it to 500 Mpx/s does make the ‘v4l2-ctl --mmap’ command work directly after the reboot, but that’s only a workaround. The true value is 396 Mpx/s, and using that true value worked with previous jetpack’s. Where’s the regression ?

I can’t tell what’s the regression. Can you check the ISO bandwidth driver to figure it out …/kernel/nvidia/drivers/video/tegra/camera/tegra_camera_platform.c

WIth jetpack-4.5.1, I had the following info with ‘dmesg’ :

misc tegra_camera_ctrl: tegra_camera_update_isobw:Set iso bw 773202 kbyteps at 24163 KHz
misc tegra_camera_ctrl: tegra_camera_isomgr_request++ bw=773202, lt=4

With jetpack-4.6 it is now :

misc tegra_camera_ctrl: tegra_camera_update_isobw:Set iso bw 96650 kbyteps at 3021 KHz
misc tegra_camera_ctrl: tegra_camera_isomgr_request++ bw=96650, lt=4

There seems to be something wrong there.

Did you check below configure in your device tree.

		num_csi_lanes = <2>;
296 		max_lane_speed = <1500000>;
297 		min_bits_per_pixel = <10>;
298 		vi_peak_byte_per_pixel = <2>;
299 		vi_bw_margin_pct = <25>;
300 		max_pixel_rate = <7500000>;
301 		isp_peak_byte_per_pixel = <5>;
302 		isp_bw_margin_pct = <25>;

Here’s what I get rereading the device-tree with

dtc -I fs /proc/device-tree
                num_csi_lanes = <0x8>;  /* 8 */
                max_lane_speed = <0x16e360>;  /* 1500000 */
                min_bits_per_pixel = <0xc>; /* 12 */
                vi_peak_byte_per_pixel = <0x2>; /* 2 */
                vi_bw_margin_pct = <0x19>; /* 25 */
                isp_peak_byte_per_pixel = <0x5>; /* 5 */
                isp_bw_margin_pct = <0x19>; /* 25 */

There is no ‘max_pixel_rate’, because I started from tegra186-camera-imx185-a00.dtsi, where that value is not set, and because I do not know what to set there. What does ‘Max pixel rate in Kpixel/s for the ISP ISO case’ mean ? And also, if that value matters for the ISP case, does it matter when the ISP seems not to be involved ?

Could you set it as 450000 as you case.

I have tried setting max_pixel_rate to 450000 : that does not solve the problem.
I have also tested with a higher value (700000) computed as follows :

2464 (width) * 2066 (height) * 68.3 (fps) * 2 (sensors) / 1000 (to obtain Kpixel/s

That does not work either.

As a side note, I had also erroneously put a very bigger value (5015138), but that crashed the kernel at boot :

[    0.786678] pre_t19x_iso_plat_register(): iso bandwidth 31344612KB is not available, client tegra_camera_ctrl
[    0.786694] pre_t19x_iso_plat_register(): available bandwidth is 26870400 - 0 KB
[    0.786706] misc tegra_camera_ctrl: tegra_camera_isomgr_register: unable to register to isomgr
[    0.786718] misc tegra_camera_ctrl: tegra_camera_probe: failed to register CAMERA as isomgr client
[    0.919821] brcmfmac: brcmf_core_init: Start
[    0.924147] brcmfmac: brcmf_driver_register: Start
[    0.929071] brcmfmac: brcmf_driver_register: SDIO
[    1.722599] FAN: coudln't get the regulator
[    1.729917] smp_call_function_any yielded 0
[    1.734175] smp_call_function_any yielded 0
[    1.746063] soctherm: OC ALARM 0x00000001
[    2.506594] isp 15600000.isp: isp_probe: failed
[    2.521157] Unable to handle kernel write to read-only memory at virtual address 000000f0
[    2.529365] Mem abort info:
[    2.532174]   ESR = 0x96000045
[    2.535243]   Exception class = DABT (current EL), IL = 32 bits
[    2.541166]   SET = 0, FnV = 0
[    2.544233]   EA = 0, S1PTW = 0
[    2.547379] Data abort info:
[    2.550260]   ISV = 0, ISS = 0x00000045
[    2.554103]   CM = 0, WnR = 1
[    2.557074] [00000000000000f0] user address but active_mm is swapper
[    2.563439] Internal error: Oops: 96000045 [#1] PREEMPT SMP
[    2.569004] Modules linked in:
[    2.572066] CPU: 0 PID: 1417 Comm: kworker/u12:5 Not tainted 4.9.253-jp46-0.macq~.jp46.fix.tx2.streaming-g18096f2 #1
[    2.582572] Hardware name: quill (DT)
[    2.586238] Workqueue: events_unbound async_run_entry_fn
[    2.591553] task: ffffffc1eb1fd400 task.stack: ffffffc1ea250000
[    2.597466] PC is at tegra_channel_init_subdevices+0x74/0x790
[    2.603203] LR is at tegra_channel_init_subdevices+0x3c/0x790
[    2.608938] pc : [<ffffff8008c0af54>] lr : [<ffffff8008c0af1c>] pstate: 60400045
[    2.616324] sp : ffffffc1ea253890
[    2.619633] x29: ffffffc1ea253890 x28: 0000000000000000
[    2.624958] x27: 0000000000000000 x26: ffffffc1e9fc39c8
[    2.630284] x25: 00000000000000c0 x24: 0000000000000001
[    2.635609] x23: ffffff80095160c8 x22: ffffff80095160d8
[    2.640930] x21: ffffffc1e9fef498 x20: 0000000000000000
[    2.646254] x19: ffffffc1e9fc3018 x18: 0000000000000000
[    2.651577] x17: 0000000000000000 x16: 0000000000000000
[    2.656902] x15: 0000000000000031 x14: 00000000000134c8
[    2.662226] x13: 000000000002d688 x12: 0000000000000400
[    2.667550] x11: 0000000000000004 x10: 0101010101010101
[    2.672874] x9 : 0000000000000000 x8 : ffffffc1e9fb2580
[    2.678198] x7 : 0000000000000000 x6 : 000000000000003f
[    2.683523] x5 : 0000000000000040 x4 : 000000000200000f
[    2.688846] x3 : ffffffc1e9fef498 x2 : ffffffc1e9f72050
[    2.694172] x1 : ffffff8009432f70 x0 : ffffffc1e9fef498
[    2.699496]
[    2.700985] Process kworker/u12:5 (pid: 1417, stack limit = 0xffffffc1ea250000)
[    2.708283] Call trace:
[    2.710728] [<ffffff8008c0af54>] tegra_channel_init_subdevices+0x74/0x790
[    2.717505] [<ffffff8008c0c294>] tegra_vi_graph_notify_complete+0x2e4/0x6e0
[    2.722819] wifi_platform_bus_enumerate device present 1
[    2.729760] [<ffffff8008bef5ec>] v4l2_async_test_notify+0x104/0x120
[    2.736017] [<ffffff8008bef730>] v4l2_async_notifier_register+0x128/0x198
[    2.742794] [<ffffff8008c0d28c>] tegra_vi_graph_init+0x234/0x288
[    2.748792] [<ffffff8008c06a98>] tegra_vi_media_controller_init+0x1d0/0x208
[    2.755745] [<ffffff8008558894>] tegra_vi4_probe+0x474/0x4f0
[    2.761398] [<ffffff8008844a00>] platform_drv_probe+0x60/0xc0
[    2.767135] [<ffffff8008842208>] driver_probe_device+0x288/0x460
[    2.773132] [<ffffff80088424bc>] __driver_attach+0xdc/0x128
[    2.778697] [<ffffff800883fad4>] bus_for_each_dev+0x5c/0xa8
[    2.784260] [<ffffff8008841858>] driver_attach+0x30/0x40
[    2.789565] [<ffffff8008840090>] driver_attach_async+0x20/0x60
[    2.795389] [<ffffff80080de9a0>] async_run_entry_fn+0x48/0x158
[    2.801213] [<ffffff80080d3c1c>] process_one_work+0x1e4/0x4b0
[    2.806950] [<ffffff80080d3f38>] worker_thread+0x50/0x4c8
[    2.812341] [<ffffff80080dac04>] kthread+0xec/0xf0
[    2.817126] [<ffffff80080838a0>] ret_from_fork+0x10/0x30
[    2.822430] ---[ end trace 1fb7f58bfc2b9e9d ]---
[    2.826817] tegra-pcie 10003000.pcie-controller: link 2 down, retrying
[    2.839044] Unable to handle kernel paging request at virtual address ffffffffffffffd8
[    2.846955] Mem abort info:
[    2.849744]   ESR = 0x96000005
[    2.852793]   Exception class = DABT (current EL), IL = 32 bits
[    2.858703]   SET = 0, FnV = 0
[    2.861752]   EA = 0, S1PTW = 0
[    2.864888] Data abort info:
[    2.867762]   ISV = 0, ISS = 0x00000005
[    2.871591]   CM = 0, WnR = 0
[    2.874555] swapper pgtable: 4k pages, 39-bit VAs, pgd = ffffff8009c62000
[    2.881332] [ffffffffffffffd8] *pgd=0000000000000000, *pud=0000000000000000
[    2.888307] Internal error: Oops: 96000005 [#2] PREEMPT SMP
[    2.893868] Modules linked in:
[    2.896930] CPU: 0 PID: 1417 Comm: kworker/u12:5 Tainted: G      D         4.9.253-jp46-0.macq~.jp46.fix.tx2.streaming-g18096f2 #1
[    2.908649] Hardware name: quill (DT)
[    2.912311] task: ffffffc1eb1fd400 task.stack: ffffffc1ea250000
[    2.918222] PC is at kthread_data+0x24/0x30
[    2.922399] LR is at wq_worker_sleeping+0x20/0xd0
[    2.927095] pc : [<ffffff80080db7fc>] lr : [<ffffff80080d50a0>] pstate: 804000c5
[    2.934479] sp : ffffffc1ea253490
[    2.937788] x29: ffffffc1ea253490 x28: ffffffc1eb1fd400
[    2.943113] x27: ffffffc1ecb40000 x26: 0000000000000000
[    2.948439] x25: ffffff80080eaa7c x24: ffffffc1f665cfc0
[    2.953763] x23: ffffffc1eb1fdab0 x22: ffffff8009863000
[    2.959087] x21: ffffff80098e9000 x20: ffffff800986f000
[    2.964412] x19: ffffffc1eb1fd400 x18: 00000000fffffff8
[    2.969736] x17: 0000000000000000 x16: 0000000000000000
[    2.975061] x15: 0000000000000007 x14: 0000000000000001
[    2.980384] x13: 0000000000000019 x12: 0000000000000033
[    2.985709] x11: 000000000000004c x10: 000000000000000a
[    2.991033] x9 : 0000000000000000 x8 : 0000000002215e70
[    2.996358] x7 : 0000000000000000 x6 : 00000000000002f0
[    3.001681] x5 : 0000000000001d60 x4 : 0000000002214110
[    3.007005] x3 : 0000000000000000 x2 : 00000000ffda71e0
[    3.012328] x1 : ffffffc1f665cfc0 x0 : 0000000000000000
[    3.017654]
[    3.019141] Process kworker/u12:5 (pid: 1417, stack limit = 0xffffffc1ea250000)
[    3.026441] Call trace:
[    3.028884] [<ffffff80080db7fc>] kthread_data+0x24/0x30
[    3.034105] [<ffffff8009022cd0>] __schedule+0x3e0/0x7d0
[    3.039323] [<ffffff80080eaa7c>] do_task_dead+0x74/0x78
[    3.044542] [<ffffff80080b83a8>] do_exit+0x710/0xa88
[    3.049499] [<ffffff800808c16c>] die+0x194/0x198
[    3.054111] [<ffffff80080a1bdc>] __do_kernel_fault+0x144/0x218
[    3.059934] [<ffffff80080a1de8>] do_page_fault+0x60/0x480
[    3.065323] [<ffffff80080a2274>] do_translation_fault+0x6c/0x80
[    3.071233] [<ffffff8008080954>] do_mem_abort+0x54/0xb0
[    3.076451] [<ffffff8008082904>] el1_da+0x24/0xbc
[    3.081148] [<ffffff8008c0c294>] tegra_vi_graph_notify_complete+0x2e4/0x6e0
[    3.088099] [<ffffff8008bef5ec>] v4l2_async_test_notify+0x104/0x120
[    3.094356] [<ffffff8008bef730>] v4l2_async_notifier_register+0x128/0x198
[    3.101134] [<ffffff8008c0d28c>] tegra_vi_graph_init+0x234/0x288
[    3.107131] [<ffffff8008c06a98>] tegra_vi_media_controller_init+0x1d0/0x208
[    3.114083] [<ffffff8008558894>] tegra_vi4_probe+0x474/0x4f0
[    3.119734] [<ffffff8008844a00>] platform_drv_probe+0x60/0xc0
[    3.125471] [<ffffff8008842208>] driver_probe_device+0x288/0x460
[    3.131469] [<ffffff80088424bc>] __driver_attach+0xdc/0x128
[    3.137032] [<ffffff800883fad4>] bus_for_each_dev+0x5c/0xa8
[    3.142596] [<ffffff8008841858>] driver_attach+0x30/0x40
[    3.147900] [<ffffff8008840090>] driver_attach_async+0x20/0x60
[    3.153725] [<ffffff80080de9a0>] async_run_entry_fn+0x48/0x158
[    3.159549] [<ffffff80080d3c1c>] process_one_work+0x1e4/0x4b0
[    3.165286] [<ffffff80080d3f38>] worker_thread+0x50/0x4c8
[    3.170675] [<ffffff80080dac04>] kthread+0xec/0xf0
[    3.175457] [<ffffff80080838a0>] ret_from_fork+0x10/0x30
[    3.180761] ---[ end trace 1fb7f58bfc2b9e9e ]---
[    3.191080] note: kworker/u12:5[1417] exited with preempt_count 2
[    3.197163] Fixing recursive fault but reboot is needed!

Does below value change when set different max_pixel_rate?

misc tegra_camera_ctrl: tegra_camera_update_isobw:Set iso bw 773202 kbyteps at 24163 KHz
misc tegra_camera_ctrl: tegra_camera_isomgr_request++ bw=773202, lt=4

misc tegra_camera_ctrl: tegra_camera_update_isobw:Set iso bw 773202 kbyteps at 24163 KHz
misc tegra_camera_ctrl: tegra_camera_isomgr_request++ bw=773202, lt=4

are the values that I got with jetpack-4.5.1

with jetpack-4.6, I get

misc tegra_camera_ctrl: tegra_camera_update_isobw:Set iso bw 96650 kbyteps at 3021 KHz
misc tegra_camera_ctrl: tegra_camera_isomgr_request++ bw=96650, lt=4

Those values remain the same without ‘max_pixel_rate’ or with every ‘max_pixel_rate’ value that I have set.

When running the argus-based pipeline for a moment, I see other values :

misc tegra_camera_ctrl: tegra_camera_update_isobw:Set iso bw 96650 kbyteps at 3021 KHz
misc tegra_camera_ctrl: tegra_camera_isomgr_request++ bw=96650, lt=4
misc tegra_camera_ctrl: tegra_camera_update_isobw:Set iso bw 287738 kbyteps at 8992 KHz
misc tegra_camera_ctrl: tegra_camera_isomgr_request++ bw=287738, lt=4
misc tegra_camera_ctrl: tegra_camera_update_isobw:Set iso bw 1109266 kbyteps at 34665 KHz
misc tegra_camera_ctrl: tegra_camera_isomgr_request++ bw=1109266, lt=4
misc tegra_camera_ctrl: tegra_camera_update_isobw:Set iso bw 0 kbyteps at 0 KHz
misc tegra_camera_ctrl: tegra_camera_isomgr_request++ bw=0, lt=4
misc tegra_camera_ctrl: tegra_camera_update_isobw:Set iso bw 0 kbyteps at 0 KHz
misc tegra_camera_ctrl: tegra_camera_isomgr_request++ bw=0, lt=4

and when running the successful ‘v4l2-ctl --stream-mmap’ command I see the same values as for the failing run :

misc tegra_camera_ctrl: tegra_camera_update_isobw:Set iso bw 96650 kbyteps at 3021 KHz
misc tegra_camera_ctrl: tegra_camera_isomgr_request++ bw=96650, lt=4
misc tegra_camera_ctrl: tegra_camera_update_isobw:Set iso bw 0 kbyteps at 0 KHz
misc tegra_camera_ctrl: tegra_camera_isomgr_request++ bw=0, lt=4

Hello @ShaneCCC , do you have another idea about a file I should look at, or are you devising a patch yourself ?

I would suggest to add serdes_pix_clk_hz in device tree to acquire much bandwidth for this.