Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to read from multiple cameras #9

Open
sourishg opened this issue Mar 22, 2022 · 0 comments
Open

Fails to read from multiple cameras #9

sourishg opened this issue Mar 22, 2022 · 0 comments

Comments

@sourishg
Copy link

Hi, I'm running this repo on an Xavier AGX module. It works fine when I read only from the master camera (device-id=0). However, my use case requires me to get the data from multiple LI-IMX264-MIPI-M12 cameras (which are hardware synced). This is the code I'm trying to run:

print('Create cam0')
cam0 = ArgusCamera(
    device_id=0,
    stream_resolution=(2448, 2058),
    video_converter_resolution=(2448, 2058), 
    frame_duration_range=(int(1e9//24), int(1e9//24))
)
print('Create cam2')
cam2 = ArgusCamera(
    device_id=2,
    stream_resolution=(2448, 2058),
    video_converter_resolution=(2448, 2058), 
    frame_duration_range=(int(1e9//24), int(1e9//24))
)
while (True):
    t1 = time.time()
    im0 = cam0.read()
    im2 = cam2.read()
    t2 = time.time()

It results in the following output/error:

Create cam0
Opening in BLOCKING MODE
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module0
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module1
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module2
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module3
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module4
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module5
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
CAM: serial no file already exists, skips storing againLSC: LSC surface is not based on full res!
---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
CAM: serial no file already exists, skips storing againLSC: LSC surface is not based on full res!
---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
CAM: serial no file already exists, skips storing againLSC: LSC surface is not based on full res!
---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
CAM: serial no file already exists, skips storing againLSC: LSC surface is not based on full res!
---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
CAM: serial no file already exists, skips storing againLSC: LSC surface is not based on full res!
---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
CAM: serial no file already exists, skips storing againLSC: LSC surface is not based on full res!
CAM: serial no file already exists, skips storing againLSC: LSC surface is not based on full res!
NvIspAfConfigParamsSanityCheck: Error: positionWorkingHigh is not larger than positionWorkingLow positionWorkingHigh = 0, positionWorkingLow = 0

NvIspAfConfigParamsSanityCheck: Error: positionWorkingHigh is not larger than positionWorkingLow positionWorkingHigh = 0, positionWorkingLow = 0

NvIspAfConfigParamsSanityCheck: Error: positionWorkingHigh is not larger than positionWorkingLow positionWorkingHigh = 0, positionWorkingLow = 0

libv4l2_nvvidconv (0):(802) (INFO) : Allocating (1) OUTPUT PLANE BUFFERS Layout=0
libv4l2_nvvidconv (0):(818) (INFO) : Allocating (1) CAPTURE PLANE BUFFERS Layout=0
Create cam2
(NvCamV4l2) Error IoctlFailed:  (in /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function setControlValMultiple(), line 792)
(NvOdmDevice) Error IoctlFailed:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function setDeviceControls(), line 1901)
updateOutputSettings: Set Control failed. Use cached values
(NvCamV4l2) Error IoctlFailed:  (in /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function setControlValMultiple(), line 792)
(NvOdmDevice) Error IoctlFailed:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function setDeviceControls(), line 1901)
updateOutputSettings: Set Control failed. Use cached values
Opening in BLOCKING MODE
(Argus) Error InvalidState: CaptureProvider destroyed (in src/api/CameraProviderImpl.cpp, function createCaptureSession(), line 213)
(Argus) Error InvalidState: Object was already destroyed (in src/common/ObjectImpl.cpp, function destroyClientReference(), line 47)
PowerServiceCore:handleRequests: timePassed = 621
Traceback (most recent call last):
  File "x6c.py", line 246, in <module>
    run(args.experiment)
  File "x6c.py", line 145, in run
    im2 = cam2.read()
  File "/home/mhi/.local/lib/python3.6/site-packages/argus_camera-0.0-py3.6-linux-aarch64.egg/argus_camera/argus_camera.py", line 29, in read
    self.camera.read(image.ctypes.data)
AttributeError: 'NoneType' object has no attribute 'read'
(Argus) Objects still active during exit: [CameraProvider (0x3740c400): refs: 1, cref: 0]
(NvCameraUtils) Error InvalidState: Mutex not initialized (/dvs/git/dirty/git-master_linux/camera/core_scf/src/services/buffermanager/BufferManager.cpp:179) (in Mutex.cpp, function lock(), line 79)
(NvCameraUtils) Error InvalidState: Mutex not initialized (/dvs/git/dirty/git-master_linux/camera/core_scf/src/services/buffermanager/BufferManager.cpp:158) (in Mutex.cpp, function lock(), line 79)
SCF: Error BadParameter: invalid RequirementsId (in src/services/buffermanager/BufferManager.cpp, function idToPool(), line 168)
(NvCameraUtils) Error InvalidState: Mutex has not been initialized (in Mutex.cpp, function unlock(), line 88)
SCF: Error BadParameter:  (propagating from src/services/buffermanager/BufferManager.cpp, function acquire(), line 180)
(NvCameraUtils) Error InvalidState: Mutex has not been initialized (in Mutex.cpp, function unlock(), line 88)
SCF: Error BadParameter:  (propagating from src/components/stages/TempBufferAcquireStage.cpp, function doExecute(), line 61)
SCF: Error BadParameter: Sending critical error event (in src/api/Session.cpp, function sendErrorEvent(), line 992)
SCF: Error InvalidState: Instance Mutex failed to initialize in c'tor (in src/services/buffermanager/BufferManager.cpp, function getInstance(), line 72)
SCF: Error InvalidState:  (propagating from src/services/buffermanager/BufferManager.cpp, function getInstance(), line 100)
SCF: Error InvalidState:  (propagating from src/components/CaptureContainerImpl.cpp, function returnBuffer(), line 399)
SCF: Error InvalidState:  (propagating from src/components/CaptureContainerImpl.cpp, function returnAllBuffers(), line 530)
SCF: Error InvalidState: Instance Mutex failed to initialize in c'tor (in src/services/buffermanager/BufferManager.cpp, function getInstance(), line 72)
SCF: Error InvalidState:  (propagating from src/services/buffermanager/BufferManager.cpp, function getInstance(), line 100)
SCF: Error InvalidState:  (propagating from src/components/CaptureContainerImpl.cpp, function returnBuffer(), line 399)
SCF: Error InvalidState:  (propagating from src/components/CaptureContainerImpl.cpp, function returnAllBuffers(), line 530)

Can anyone tell me what I'm doing wrong? It seems read works fine for cam0 but for cam2 it throws an error.
Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant