Failed to run nvmimg_cap sample

When I ran nvmimg_cap sample on Drive PX2 AutoChauffeur, I got the following error.
The AR0231 RCCB camera is plugged in A0 camera connector, and I ran the sample on Tegra A.
The error wasn’t fixed even I rebooted the Drive PX2.

By the way, the nvmipp_raw sample worked correctly, no errors as nvmimg_cap with similar parameters.

ubuntu@tegra-ubuntu://root/vibrante-t186ref-linux/samples/nvmedia/img_cap$ ./nvmimg_cap -cf ./e2379a_c01.conf -c dvp-ar0231-rccb-raw12-1920x1208-ab --aggregate 1 -d 2
***** aurix state *****
CAM_PWR_ON: 0x0
TEGRA_GMSL: TEGRA B
TEGRA_FPDL: TEGRA B
TEGRA_A_HDMI: MXM
TEGRA_B_HDMI: MXM
TEGRA_PCI: TEGRA B
FAN_STATE: UNKNOWN


***** aurix state *****
CAM_PWR_ON: 0x1
TEGRA_GMSL: UNKNOWN
TEGRA_FPDL: UNKNOWN
TEGRA_A_HDMI: UNKNOWN
TEGRA_B_HDMI: UNKNOWN
TEGRA_PCI: UNKNOWN
FAN_STATE: UNKNOWN


Used display - Display Info - Enabled:1 displayId:2 type:B306 size:1280x720 refresh:60.019024 type:HDMI
NvMediaIDPCreate: FlipQ create failed (display: 2 window: 0)
nvmedia: ERROR: DisplayInit: Failed to create NvMedia display
nvmedia: ERROR: DisplayInit: Failed to initialize Display
nvmedia: ERROR: main: Failed to Initialize Display
***** aurix state *****
CAM_PWR_ON: 0x0
TEGRA_GMSL: UNKNOWN
TEGRA_FPDL: UNKNOWN
TEGRA_A_HDMI: UNKNOWN
TEGRA_B_HDMI: UNKNOWN
TEGRA_PCI: UNKNOWN
FAN_STATE: UNKNOWN


Hello qkmiao,

Could you please re-try the app with below command? Thanks.
ubuntu@tegra-ubuntu://root/vibrante-t186ref-linux/samples/nvmedia/img_cap$ ./nvmimg_cap -cf e2379a_c01.conf -c dvp-ar0231-raw12-1920x1208-ab -d 0 -w 1

Thanks Steve. Your command works. How can I identify the values for -d and -w options in the command line?

Hello qkmiao,

Please see NVIDIA_Vibrante_4.1_for_Linux_DPX_References/nvvib_docs/NVIDIA%20Vibrante%20Linux%20DPX%20Development%20Guide/nvmedia_nvmimg_cap.htmlExternal Media

I am implementing to run multiple applications which display camera images from each camera group.
Each application(based on nvmedia sample app"img_cap") is following.

  • (a) application-1 that displays camera images from camera group A.
  • (b) application-2 that displays camera images from camera group B.
  • (c) application-3 that displays camera images from camera group C.

I get the error when using the combination of the same display id and window id at NvMediaIDPCreate API
The error is the same as described in the following document(SDK Development Guide)

==============================
Issue 9: FlipQ Create Failed
The error message is as follows:
NvMediaIDPCreate: FlipQ create failed (display: 0 window: 0)
nvmedia: ERROR: ImageDisplayCreate: Failed to create NvMedia display
nvmedia: ERROR: ImageDisplayCreate: Failed to create ImageDisplay
nvmedia: ERROR: NvMTestDisplayCreate: No image display created
nvmedia: ERROR: NvMTestDisplayCreate: Failed to create NvMTestDisplay
nvmedia: ERROR: Capture_Init: Failed to create test display
nvmedia: ERROR: Capture_Init: Failed to initialize ImgCapture
nvmedia: ERROR: main: Failed to Initialize ImgCapture

Each display ID and window ID combination yields a unique NvMedia output surface.
This error occurs if this combination is being used by any other application.
Verify the target to check if any other application is using the current output surface combination.

I think that the error solve by using differ window-id in each application.
So, I checked SDK development Guide about how to create windows, but I could not find it…
Could you please provide me the information about window-id.

Thank you in advance.

Dear atsutaka,
Can you please share the command parameters that you have used.
The X11 already uses window 0 so you can’t run nvmimg_cap with -d 0 -w 0. My suggestion is to connect another display(FTDI or GMSL : Autonomous Vehicle Development Platforms | NVIDIA Docs) and check.

Dear SivaRamaKrishna,
Thanks for the prompt response.

The command I used is below.
・./nvmimg_cap -cf drive-px2-a.conf -c dvp-ar0231-raw12-1920x1208-ab -d 0 -w 1 --aggregate 1

I want to implement by using one display if it is feasible.
Any information would be greatly appreciated.

atsutaka,

Please try to disable X11 first to see if 2 plane is working.

sudo service lightdm stop
./nvmimg_cap -cf drive-px2-a.conf -c <config  for cam1> -d 0 -w 0 --aggregate 1
./nvmimg_cap -cf drive-px2-a.conf -c <config for cam2> -d 0 -w 1 --aggregate 1

atsutaka,

Any update? Please try with 2 planes first and we can start to use 3 planes by some configuration.

Dear WayneWWW,

In case two cameras (connected to each camera group), it works fine!
Could you please provide me the information about using three cameras.

Please try below command for display configuration:

sudo -s
//disable X11 first
service lightdm stop

//disable all three heads and you will see the monitor is gone
echo 4 > /sys/class/graphics/fb0/blank
echo 4 > /sys/class/graphics/fb1/blank
echo 4 > /sys/class/graphics/fb2/blank

//clear the assignment of window in other display head
echo 0x00 > /sys/class/graphics/fb2/device/win_mask
echo 0x00 > /sys/class/graphics/fb1/device/win_mask

//assign all 6 windows to head 0
echo 0x3f > /sys/class/graphics/fb0/device/win_mask

#if you hit some error in this step, please try other value e.g. 0x7, which at least assign 3 window to your monitor.

//re-enable all three heads
echo 0 > /sys/class/graphics/fb0/blank
echo 0 > /sys/class/graphics/fb1/blank
echo 0 > /sys/class/graphics/fb2/blank

Now you should be able to run 3 preview on one display. (Still need to disable X11 under such case)

Dear WayneWWW,

I have confirmed that three preview can run on one display in above way(#11).

I am grateful for your support!

Glad to hear that.

Dear WayneWWW,

I have an additional question.

Now we are testing GMSL camera module we designed.
It works well with one camera by using code based nvmimg_cap.
In two cameras connected to same camera group, after it works well for around 10 seconds, the following error is displayed and it stops…

=============================================================

nvmedia: _CaptureThreadFunc: VC:0 FPS=12 delta=3066609
nvmedia: _CaptureThreadFunc: VC:0 FPS=12 delta=3066605
nvmedia: _CaptureThreadFunc: VC:0 FPS=12 delta=3066604
nvmedia: ERROR: ExecuteNextCommand: Failed to read commnad
-nvmedia: ERROR: _GetError_max9286:No Link error detected
nvmedia: WARNING: _CaptureThreadFunc: NvMediaICPGetFrameEx timed out
nvmedia: WARNING: _CaptureThreadFunc: NvMediaICPGetFrameEx timed out
nvmedia: _SaveThreadFunc: saveThread input queue 0 is empty
nvmedia: _CompositeThreadFunc: Waiting for input image from queue 0
nvmedia: _DisplayThreadFunc: Display input queue empty
nvmedia: WARNING: _CaptureThreadFunc: NvMediaICPGetFrameEx timed out
nvmedia: WARNING: _CaptureThreadFunc: NvMediaICPGetFrameEx timed out
nvmedia: _DisplayThreadFunc: Display input queue empty
nvmedia: _CompositeThreadFunc: Waiting for input image from queue 0
nvmedia: _SaveThreadFunc: saveThread input queue 0 is empty
nvmedia: WARNING: _CaptureThreadFunc: NvMediaICPGetFrameEx timed out
nvmedia: WARNING: _CaptureThreadFunc: NvMediaICPGetFrameEx timed out
nvmedia: _SaveThreadFunc: saveThread input queue 0 is empty
nvmedia: _CompositeThreadFunc: Waiting for input image from queue 0
nvmedia: _DisplayThreadFunc: Display input queue empty
nvmedia: WARNING: _CaptureThreadFunc: NvMediaICPGetFrameEx timed out
nvmedia: WARNING: _CaptureThreadFunc: NvMediaICPGetFrameEx timed out
nvmedia: _DisplayThreadFunc: Display input queue empty
nvmedia: _CompositeThreadFunc: Waiting for input image from queue 0
nvmedia: _SaveThreadFunc: saveThread input queue 0 is empty
nvmedia: WARNING: _CaptureThreadFunc: NvMediaICPGetFrameEx timed out
nvmedia: WARNING: _CaptureThreadFunc: NvMediaICPGetFrameEx timed out
nvmedia: _DisplayThreadFunc: Display input queue empty
nvmedia: _CompositeThreadFunc: Waiting for input image from queue 0
nvmedia: _SaveThreadFunc: saveThread input queue 0 is empty
nvmedia: WARNING: _CaptureThreadFunc: NvMediaICPGetFrameEx timed out
nvmedia: ERROR: _CaptureThreadFunc: keep failing at NvMediaICPGetFrameEx for 11 times
nvmedia: _CaptureThreadFunc: Capture thread exited
nvmedia: _ErrHandlerThreadFunc: Error Handler thread exited

Error message is “_GetError_max9286: No Link error detected” and “NvMedia ICPGetFrameEx timed out” only,
We checked ICP error status by “NvMediaICPGetErrorInfo” API too, but it was no error(NvMediaICPErrorStatus is 0x0).

Frame capturing in ICP fails after “_GetError_max9286: No Link error detected” is displayed,
I guess there is the cause of this error in ISC.
but, the error information to be displayed is few, and I cannot narrow down the cause of the error anymore.

I am going to check max9286 registers not checked by _GetError_max9286 API,
and I heve no idea to identify the cause of the error other than this.

Could you provide me If you have the way to display detailed error information.

atsutaka,
What configuration file are you using?
Could you paste the result of dmesg after camera capture failure?

hello atsutaka,

may I know what’s failure message from the kernel side,
could you also share your sensor capability, resolution and fps.
thanks

Dear WayneWWW,

I uses the following customized drive-px2-a.conf.

[capture-params-set 1]
capture-name  = "cxd"
capture-description   = "cxd5700 at csi-ab"
board          = "E2379-c00"
input_device   = "ref_max9286_9271_cxd5700"
input_format   = "raw12"
surface_format = "raw12"
resolution     = "1920x1081"
csi_lanes      = 4
interface      = "csi-ab"
embedded_lines_top = 0
embedded_lines_bottom = 0
i2c_device     = 7
max9271_address = 0x40
max9286_address = 0x48
sensor_address  = 0x1A

About the output result of Dmesg, there is no new message output before and after application execution.

Dear JerryChang,

Sensor information is below.

  • Sensor: imx 290
  • Resolution: 1920 × 1081
  • Fps: 30

Let me know if we can give you any other information.
Any information would greatly help.

Looks like it is a new topic.

Could you please file a new thread and share all your change to the sample?

Dear WayneWWW,

I have created a new topic.
https://devtalk.nvidia.com/default/topic/1032624/drive-linux/fails-to-run-gmsl-cameras-we-designed/