A problem with allied vision

I have connected an Allied Vision camera to a Jetson TX2. To reduce power consumption during the process, I need to turn off the camera, which I do by setting the value of a GPIO pin to 0. However, when I set the value back to 1, the camera is no longer recognized unless I restart the entire Jetson to which the camera is connected. Do you know of a way to make the camera recognizable without having to restart the Jetson?

Hello user159348

Are you setting the GPIO manually?

You can use the camera sensor operators power_on and power_off to control the camera power.

static struct camera_common_sensor_ops imx219_common_ops = {
. . .
	.power_on = imx219_power_on,
	.power_off = imx219_power_off,
. . .

These functions are called when is required to turn on/off the camera, for example when the driver needs to read or write a control, when the driver starts the stream.

About this: “The camera is no longer recognized unless I restart the entire Jetson to which the camera is connected.

Most of the time the camera has a initial configuration that is applied only one time, therefore this configuration is applied only when the driver is loaded. (when Jetson is restarted) and when you start the stream the driver only applies the configuration required to set the resolution selected and start the video stream.

If you add support in the driver to manage the camera power, you should apply a complete camera configuration (initialization, set resotution and start stream) every time that you start the stream.

See imx219_set_mode and imx219_start_streaming functions as a reference.

static struct camera_common_sensor_ops imx219_common_ops = {
...
	.set_mode = imx219_set_mode,
	.start_streaming = imx219_start_streaming,
	.stop_streaming = imx219_stop_streaming,
};

Manuel Leiva
Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com
Website: www.ridgerun.com

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