Optimize SLM Configuration Files

The SLM configuration files are used to specify the order of starting your services, applications, and their dependencies through the SLM service.

See the System Launch and Monitor (SLM) section in the System Services Reference for more details on what SLM is, and how to use it.



Figure 1. Optimize the SLM configuration files

Starting services, applications, and their dependencies in a certain order can impact your bootup time. To optimize the time to have your camera application ready on your QNX Platform for ADAS system, you can consider starting these components from your SLM configuration files in the following relative order:

1. camera_service
This component starts camera, the camera service. See the Camera section in the System Services Reference. After satisfying all system requirements and dependencies of your QNX Platform for ADAS system, you should configure camera_service to start as early as possible in your SLM configuration files. The exact order of where camera_service can start may vary from system to system.
2. camera_application

This component starts your camera application. It relies on the camera service. Generally, start your camera application soon after you start the camera service.

However, your camera application doesn't necessarily need to wait until the camera service receives the first frame from all configured camera units; it can start setup and processing while the camera service is readying the camera unit or units. For example, if your camera application triggers Screen to load drivers, you can actually start your camera application before the camera service. This way, the loading and starting of the graphics drivers can be done while the camera service comes up.

If you start your camera application before the camera service, your application must verify that the camera service is ready, before trying to access the camera unit or units. For more information, see the Optimize your Camera Application chapter.

3. camera

This component defines a dependency for other components that aren't required by the camera service or the camera application. For example, components that aren't required by the camera or camera application should include the following dependency:

<SLM:depend>camera</SLM:depend>
              

By using this dependency, you can delay the booting of these other components until after the camera units are ready. The delayed booting of other components can result in a faster bootup time for the camera service because of CPU availability.

The camera component waits on the creation of the file, /dev/shmem/cameracamera_unit-start.run (e.g., /dev/shmem/camera4-start.run), where camera_unit is a camera that your camera application connects to. You must also have this camera unit configured in your camera configuration file (See the Camera configuration file section in the System Services Reference). The camera service creates the /dev/shmem/cameracamera_unit-start.run file when it receives the first frame from that camera unit. For example, if you have four cameras configured, then by waiting for the /dev/shmem/camera4-start.run, you're assured that the camera service is ready and has received a frame from camera unit 4.

Configure processes that depend on the camera service to start only after it's ready. This practice helps ensure that those who are relying on the camera service can start their processing immediately, rather than starting, and then having to wait for the camera service to be ready.

If your system requirements allow for the image buffer (video stream) to be delayed a few seconds, you can start your camera application and its dependencies using the SLM. However, if your system requires that the image buffers be shown on the display as soon as the system boots, consider putting the camera application in the IFS. For more information, see Configure a Primary and Secondary IFS on the System.

Other SLM configuration considerations

Configure multiple SLM components to use as dependencies

If you have applications or processes that rely on different camera units, it's not necessary to wait for all configured cameras to be ready. For example, you can create an SLM component that waits for /dev/shmem/camera2-start.run. Any applications that rely only on camera unit 2 can use this component as a dependency. You can then create another SLM component that waits for /dev/shmem/camera4-start.run. Other applications that rely on all 4 camera units can use this second SLM component as their dependency. Creating different SLM components allows for different applications to start at different times without having to wait for camera units they may not need.

For example, you can create the following two SLM components:

...
<SLM:component name="camera2">
   <SLM:command launch="builtin">no_op</SLM:command>
   <SLM:waitfor wait="pathname">/dev/shmem/camera2-start.run</SLM:waitfor>
</SLM:component>

<SLM:component name="camera4">
   <SLM:command launch="builtin">no_op</SLM:command>
   <SLM:waitfor wait="pathname">/dev/shmem/camera4-start.run</SLM:waitfor>
</SLM:component>
...
              

You can use these components as dependencies for other components if they depend on different camera units.

Optimize your camera configuration file
The camera service creates one /dev/shmem/cameracamera_unit-start.run file for each camera that your camera application connects to. You must also have this camera unit configured in your camera configuration file (See the Camera configuration file section in the System Services Reference). Include in the camera configuration file only the cameras that your QNX Platform for ADAS system uses. By optimizing the number of camera units configured, the camera service won't consume time to initialize cameras that are not of interest.