# Invalid Camera device

**URL:** <https://forums.developer.nvidia.com/t/invalid-camera-device/156631>\
**Category:** Jetson Xavier NX\
**Tags:** camera\
**Created:** [October 8, 2020, 7:31pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631 "2020-10-08T19:31:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![guido54321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@guido54321](https://forums.developer.nvidia.com/u/guido54321)\
**Post date:** [October 8, 2020, 7:31pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/1 "2020-10-08T19:31:25Z")

</div>

I have two Raspberry Pi Cameras hooked to a Jetson Xavier board. The ribbons used to connect to the Xavier of both cameras are on the cameras and in the camera slots of the Xavier in exactly the same way.

When I include the following  
camSet='nvarguscamerasrc sensor-id=0…  
my program shows the image that connected to the default 0 sensor on the Xavier.  
When I change sensor-id to 1  
I get the following error  
“invalid Camera divide 1 specified, 0 max index…”.  
Does anyone know why the max index is 0 or how both cameras could yield an image?

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [October 8, 2020, 7:38pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/2 "2020-10-08T19:38:03Z")

</div>

Are both cameras correctly probed at boot ?

```auto
dmesg | grep imx219
ls -l /dev/video*

```

---

<div class="post-metadata">

**Author:** ![guido54321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@guido54321](https://forums.developer.nvidia.com/u/guido54321)\
**Post date:** [October 8, 2020, 8:00pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/3 "2020-10-08T20:00:04Z")

</div>

What do you mean? When I install the cameras I have to reboot ?

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [October 8, 2020, 8:01pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/4 "2020-10-08T20:01:13Z")

</div>

I don’t think that CSI cameras support hot-plug. Although it may work in some cases.

---

<div class="post-metadata">

**Author:** ![guido54321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@guido54321](https://forums.developer.nvidia.com/u/guido54321)\
**Post date:** [October 8, 2020, 8:01pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/5 "2020-10-08T20:01:36Z")

</div>

By the way…after I installed the first camera in the default 0 slot, I did not reboot and the camera worked.

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [October 8, 2020, 8:29pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/6 "2020-10-08T20:29:12Z")

</div>

Give reboot a try and compare. I cannot advise much more for now.

---

<div class="post-metadata">

**Author:** ![guido54321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@guido54321](https://forums.developer.nvidia.com/u/guido54321)\
**Post date:** [October 9, 2020, 3:32am UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/7 "2020-10-09T03:32:10Z")

</div>

Rebooting did not solve the problem.

---

<div class="post-metadata">

**Author:** ![guido54321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@guido54321](https://forums.developer.nvidia.com/u/guido54321)\
**Post date:** [October 9, 2020, 3:07pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/8 "2020-10-09T15:07:07Z")

</div>

Yes I put in ls -l /dev/video\* and it returned two videos. What else should I do to get the second camera recognized by my program?

---

<div class="post-metadata">

**Author:** ![guido54321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@guido54321](https://forums.developer.nvidia.com/u/guido54321)\
**Post date:** [October 9, 2020, 3:25pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/9 "2020-10-09T15:25:01Z")

</div>

The specific error I get is  
execute:561 Invalid camera device specified 1 specified, 0 max index…  
Cannot query video position: status 0, value-1. duration=-1  
followed by Traceback

when I entered ls -l /dev/video\* it returned two videos: 0 and 1.

Looking forward to your suggestions.

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [October 9, 2020, 4:45pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/10 "2020-10-09T16:45:14Z")

</div>

So after a fresh boot with both cameras connected and not later removed, check the output of:

```auto
dmesg | grep imx219

```

and check for any error message. If there are, post these.

If not, have v4l-utils installed in case it is not:

```auto
sudo apt install v4l-utils

```

Then use v4l2-ctl to query driver about available modes for each camera:

```auto
v4l2-ctl -d /dev/video0 --list-formats-ext
v4l2-ctl -d /dev/video1 --list-formats-ext

```

If ok, try to get your cameras streaming to V4L using one of the listed modes:

```auto
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1280,height=720,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap
v4l2-ctl -d /dev/video1 --set-fmt-video=width=1280,height=720,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap

```

If both work, you should be able to capture in bayer format RG10.

You may also check :

```auto
media-ctl -p

```

If all is ok so fine, try (assuming you have a GUI running, otherwise replace xvimagesink with fakesink):

```auto
gst-launch-1.0 -v nvarguscamerasrc sensor=0 ! nvvidconv ! xvimagesink
gst-launch-1.0 -v nvarguscamerasrc sensor=1 ! nvvidconv ! xvimagesink

```

---

<div class="post-metadata">

**Author:** ![guido54321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@guido54321](https://forums.developer.nvidia.com/u/guido54321)\
**Post date:** [October 9, 2020, 6:15pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/11 "2020-10-09T18:15:38Z")

</div>

I got no error messages on  
dmesg | grep imx219  
On  
sudo apt install v4l-utils  
I got v4l-utils is already newest version (1,14,2-1)  
On entering  
v4l2-ctl -d /dev/video1 --list-formats-ext  
got a long list of intervals for different sizes for both video 0 and video 1  
On entering  
v4l2-ctl -d /dev/video1 --set-fmt-video=width=1280,height=720,pixelformat=RG10 --set-ctrl bypass\_mode=0 --stream-mmap  
I get unrecognized option ‘–stream-nmap’  
followed by a long list of common options

---

<div class="post-metadata">

**Author:** ![guido54321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@guido54321](https://forums.developer.nvidia.com/u/guido54321)\
**Post date:** [October 9, 2020, 6:17pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/12 "2020-10-09T18:17:44Z")

</div>

Question: how to I record a terminal session?

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [October 9, 2020, 6:19pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/13 "2020-10-09T18:19:34Z")

</div>

> [@guido54321](#):
>
> I get unrecognized option ‘–stream-nmap’

Seems there’s a typo here. Use --stream-mmap.

Do you see different modes for video1 as compared to video0 ?  
Are both cameras the same model ?  
Are you using a customized device tree ? Another carrier board than standard devkit ?

---

<div class="post-metadata">

**Author:** ![guido54321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@guido54321](https://forums.developer.nvidia.com/u/guido54321)\
**Post date:** [October 9, 2020, 6:30pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/14 "2020-10-09T18:30:15Z")

</div>

correct the typo…got unknown standard ‘et-fmt-video=1280…’

both cameras are exactly the same Raspberry Pi version 2

I don’t understand what you mean by customized device tree…another carrier board than standard devkit

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [October 9, 2020, 6:41pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/15 "2020-10-09T18:41:42Z")

</div>

> [@guido54321](#):
>
> got unknown standard ‘et-fmt-video=1280…’

Seems there are still some wrong characters in your command.  
Should be:

```auto
--set-fmt-video=

```

Are you using a serial console or ssh ? There might be some errors or wrong encoding.

---

<div class="post-metadata">

**Author:** ![guido54321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@guido54321](https://forums.developer.nvidia.com/u/guido54321)\
**Post date:** [October 9, 2020, 7:00pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/16 "2020-10-09T19:00:37Z")

</div>

(Attachment terminal session 20201009 14:50.pdf is missing)

---

<div class="post-metadata">

**Author:** ![guido54321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@guido54321](https://forums.developer.nvidia.com/u/guido54321)\
**Post date:** [October 9, 2020, 7:07pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/17 "2020-10-09T19:07:51Z")

</div>

[terminal session 20201009 14-50.rtf](https://forums.developer.nvidia.com/uploads/short-url/pviccw35P7Y6ttlUdDH05P4QpMx.rtf) (4.61 KB)

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [October 9, 2020, 7:11pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/18 "2020-10-09T19:11:51Z")

</div>

Again, use: ‘–set-fmt-video’ (with 2 ‘-’ **–** )  
Be aware that a computer is very psychorigid and may not support approximative commands for now.

---

<div class="post-metadata">

**Author:** ![guido54321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@guido54321](https://forums.developer.nvidia.com/u/guido54321)\
**Post date:** [October 9, 2020, 7:20pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/19 "2020-10-09T19:20:04Z")

</div>

These are the lines in my program that do work for camera 0; when I switch the sensor-if to 1 then I get the Invalid Camera device specified 1 with 0 mac index.

camSet = ‘nvarguscamerasrc sensor-id=0 tnr-mode=2 tnr-strength=1 ee-mode=2 ee-strength=0 wbmode=2 ! video/x-raw(memory:NVMM), width=3264, height=2464, framerate=21/1,format=NV12 ! nvvidconv flip-method=’+str(  
flip)+’ ! video/x-raw, width=‘+str(width)+’, height=‘+str(height)+’, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! videobalance contrast=1.5 brightness=-.2 saturation=1.2 ! appsink drop=TRUE’  
cam = cv2.VideoCapture(camSet)

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [October 9, 2020, 7:47pm UTC](https://forums.developer.nvidia.com/t/invalid-camera-device/156631/20 "2020-10-09T19:47:06Z")

</div>

Please go step by step, taking care to each command.  
Can you run V4L API capture with /dev/video1 ?  
No chance to use nvarguscamerasrc gstreamer plugin nor opencv before that.

[Next page](https://forums.developer.nvidia.com/t/invalid-camera-device/156631.md?page=2)
