Configure cameras on the reference image

The reference image is optimized to boot up quickly with four cameras that are connected to a deserializer board using FPD-Link III interfaces (OV10635). If you want to use a different configuration, you must change the camera configuration file (/etc/system/config/camera.conf) and the associated SLM configuration files on the reference image.

The camera configuration defines the cameras that are connected to the system. Normally, depending on the cameras you want to use, you'll have to change the SLM configuration file, the camera configuration file, or both. In the steps below, we have simplified the process for you to change the configuration when you use the reference image. Instead of making multiple changes to SLM and camera configuration files, you can change the configuration by using a simple cp command to copy pre-existing SLM files that are preconfigured to worked with different camera configuration files.
Note: Ensure you run the mount -uw /base on the reference so that you can run the cp command.
To get a better understanding about changes to the camera and SLM configuration files, see Camera configuration file and System Launch and Monitor in the System Services guide.
Note: Any time you want to reset the SLM configuration to boot with four FPD-Link III cameras, copy /etc/slm-config-platform-default.xml to /etc/slm-config-platform.xml.
Here are the type of configurations that require changes to the camera configuration file, SLM configuration file, or both: In addition to changing the type or number of cameras you are using, you may want change the behavior of the system in the following ways:

Configuration for using one camera connected via an FPD-Link III interface

In this configuration, you are connecting one camera to the deserializer board. The deserializer board is connected to the Vision board. If you want to run the Camera MUX 2x2 application, you need to run it with the -n parameter because by default, the application expects four cameras; otherwise, you can run the Camera example. For more information, see Camera MUX 2x2 and Camera example.

To use this configuration, perform these steps:
  1. If you haven't done so, on the Vision Board, ensure that the SW3 DIP switch settings are set to use cameras connected via FPD-Link III interfaces. This DIP switch is located under the deserializer board. For more information, see Configure hardware and boot a reference image.
  2. Connect to the board using a serial connection, terminal via a network connection (telnet/ftp, ssh/scp), or via the QNX Momentics IDE.
  3. Change the SLM configuration to use one camera connected via FPD-Link III . To do this, on your target run copy /etc/slm-config-platform-single-cam.xml to /etc/slm-config-platform.xml using the cp command. These are the differences between the /etc/slm-config-platform-single-cam.xml file and the default SLM configuration file:
    • The configuration was changed to wait for one camera instead of four before starting the application. For more information, see Configuration to change the number of cameras to wait for.
    • The Camera service was changed to start with the /etc/system/config/single_cam.conf instead of the /etc/system/config/camera.conf.
  4. Restart the board (reset the power or run the shutdown command).
  5. Run your application. For example, in the command prompt connected to your target, type camera_mux2x2 -n 1 to run the Camera MUX 2x2 application with one camera.

Configuration for cameras connected via a parallel interface

In this configuration, you have a camera connected to the parallel interface on the Vision Board. If you want to run the Camera MUX 2x2 application, you need to run it with the -n parameter because by default, the application expects four cameras; otherwise, you can run the Camera example. For more information, see Camera MUX 2x2 and Camera example.

To use this configuration, perform these steps:
  1. If you haven't done so, on the Vision Board, ensure that the SW3 DIP switch settings are set to use a camera connected via a parallel interface. For more information about modifying the SW3 DIP switch settings, see Configure hardware and boot a reference image.
  2. Connect to the target board using serial connection, terminal via a network connection (telnet/ftp, ssh/scp), or via the QNX Momentics IDE.
  3. Change the SLM configuration to use one camera connected via a parallel connection. To make this change, on your target, copy /etc/slm-config-platform-parallel-cam.xml to /etc/slm-config-platform.xml using the cp command. These are the differences between the /etc/slm-config-platform-parallel-cam.xml file and the default SLM configuration file:
    • The configuration was changed to wait for one camera instead of four. For more information, see Configuration to change the number of cameras to wait for.
    • The Camera service is started with the /etc/system/config/parallel_cam.conf instead of the /etc/system/config/camera.conf.
  4. Restart the board (reset the power or run the shutdown command).
  5. Run your application. For example, in the command prompt connected to your target, type camera_mux2x2 -n 1 to run the Camera MUX 2x2 application with one camera.

Configuration for using a camera connected via USB

On the Jacinto 6 EVM board, there's a USB 2.0 or USB 3.0 port that you can use to connect a USB camera. If you want to run the Camera MUX 2x2 application, you need to run it with the -n parameter because by default, the application expects four cameras; otherwise, you can run the Camera example. For more information, see Camera MUX 2x2 and Camera example. To use this configuration, perform these steps:
  1. Connect to the target board using a serial connection, terminal via a network connection (telnet/ftp, ssh/scp), or via the QNX Momentics IDE.
  2. Change the SLM configuration to use a USB camera. To make this change, on your target, copy /etc/slm-config-platform-usb-cam.xml to /etc/slm-config-platform.xml. These are the differences between the /etc/slm-config-platform-usb-cam.xml file and the default SLM configuration file:
    • The usb component was moved so that it starts before the camera_service component. The usb component starts the USB drivers while the camera_service component starts the Camera service.
    • In the usb component, the dependency to wait until the camera component comes up was removed.
    • In the camera_service component, a dependency to wait until the usb component comes up was added.
    • The camera_service component was started using the /etc/system/config/usb_cam.conf instead of the /etc/system/config/camera.conf.
  3. Restart the board (reset the power or run the shutdown command).
  4. Run your application. For example, in the command prompt connected to your target, type camera_mux2x2 -n 1 to run the Camera MUX 2x2 application with one camera.

Configuration for using file cameras

You can connect one or more file cameras. File cameras aren't real cameras, but virtual cameras that can play a video file to simulate a video stream, usually for testing purposes. By default, the video file must be an H.264-encoded file with an MP4 file extension. You can connect and transfer videos to the reference image, or you can use the videos included with the reference image. For example, there's a video located at /var/accounts/1000/shared/videos/infoadas-demo-pd.mp4 on the reference image.

You can record MP4 files using the Camera example and then use those files as input for the file camera.

To use this configuration, perform these steps:

  1. Connect to the target using a serial connection, terminal via a network connection (telnet/ftp, ssh/scp), or via the QNX Momentics IDE.
  2. Change the SLM configuration to use a file camera. To make this change, on your target, copy /etc/slm-config-platform-file-camera.xml to /etc/slm-config-platform.xml using the cp command. These are the differences between the /etc/slm-config-platform-file-camera.xml file and the default SLM configuration file:
    • The syslink_daemon component was moved so that it starts before the camera_service component. The syslink_daemon component is used for video encoding and decoding while the camera_service component starts the camera service. Decoding must be available before the camera service runs.
    • In the syslink_daemon component, the dependency to wait until the camera component comes up was removed.
    • In the camera_service component, a dependency was added to wait until the syslink_daemon component comes up.
    • The Camera service as changed to use start using the /etc/system/config/file_cam.conf file. The file camera plays the /accounts/1000/shared/videos/infoadas-demo-pd.mp4 file located on the target.
  3. Restart the board (reset the power or run the shutdown command).
  4. Run your application. For example, in the command prompt connected to your target, type camera_example to run the Camera example application.

Configuration to start encoding/decoding immediately

The reference image is configured to provide encoding/decoding video at a later time. If you require that encoding is available as soon as possible when the board reboots, perform the following steps:

  1. Connect to the target using a serial connection, terminal via a network connection (telnet/ftp, ssh/scp), or via the QNX Momentics IDE.
  2. Change the SLM configuration to the configuration to encode/decode immediately. To make this change, copy /etc/slm-config-platform-encode-decode.xml to /etc/slm-config-platform.xml using the cp command. These are the differences between the /etc/slm-config-platform-encode-decode.xml file and the default SLM configuration file:
    • The syslink_daemon component was moved so that it starts before the camera_service component. The syslink_daemon component is used for video encoding and decoding while the camera_service component starts the camera service.
    • In the syslink_daemon component, the dependency was removed to wait until the camera component comes up.
    • In camera_service component, a dependency was added to wait until the syslink_daemon component comes up.
  3. Restart the board (reset the power or run the shutdown command) and then run your application. For example, in the command prompt connected to your target, type camera_example to run the Camera example application with four cameras and to record your session.

Configuration to change how many cameras to wait for

The reference image is configured to wait until the Camera MUX 2x2 application starts CAMERA_UNIT_4 before running other non-camera components listed in the SLM, such as networking. It starts the cameras sequentially from CAMERA_UNIT_1, CAMERA_UNIT_2, CAMERA_UNIT_3, and then CAMERA_UNIT_4 — four cameras in all. If CAMERA_UNIT_4 doesn't start, then there's a small time-out period before the boot process completes. You can change the configuration to wait for a different camera to start before the camera service starts, but it's important to note that the Camera MUX 2x2 is hard-coded to function with four cameras. If four cameras aren't detected, the application exits.

  1. Connect to the target using a serial connection (debug port), terminal via a network connection (telnet/ftp, ssh/scp), or the QNX Momentics IDE and backup the SLM configuration file for the platform (e.g., cp /etc/slm-config-platform.xml /etc/slm-config-platform.xml.bkup).
  2. Open the /etc/slm-config-platform.xml file in an editor, locate the camera component, change the string camera4-start.run to indicate the camera to wait for to start, such as CAMERA_UNIT_2, and then save your changes. For example, if you have want the system to wait for two cameras connected to your system and the last one is configured as CAMERA_UNIT_2, then change the string to camera2-start.run as shown here:
    <!-- VARIANT SPECIFIC ENTRIES -->
    
    <SLM:component name="symlink_wifi">
        <SLM:command launch="builtin">pathmgr_symlink</SLM:command>
        <SLM:args>/var/etc/ap_pps_mhs.conf /base/etc/ap_pps_mhs.conf;
                        /var/etc/wpa_pps.conf /base/etc/wpa_pps.conf;
                        /var/etc/wpa_supplicant.conf /base/etc/wpa_supplicant.conf</SLM:args>
    </SLM:component>
    
    ...
    ...
    ...
    
    <SLM:component name="camera">
        <SLM:command launch="builtin">no_op</SLM:command>
        <SLM:waitfor wait="pathname">/dev/shmem/camera2-start.run</SLM:waitfor>
    </SLM:component>
    ...
    ...
    ..
    
  3. Restart the board (reset the power or run the shutdown command) and then run your custom application that expects two cameras to be available. For more information about creating a custom application, see Modify the system to run a custom application.