How to replace cinematicexperience demo application with a custom application

How to run our own qt application instead of the demo application(CinematicExperience) in tdx-reference-multimedia-image.Do I need to create another meta layer for this or can I use the qt5 layer itself. Please explain in step by step.

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hand-shake,

To run your own Qt application instead of the default CinematicExperience demo application in the tdx-reference-multimedia-image, you can follow these steps. It’s not strictly necessary to create a new meta layer for your application, but organizing your application and its dependencies in a custom layer is considered a best practice for maintainability and clarity. However, you can also modify an existing layer if it suits your project’s structure better. Here’s a step-by-step guide:

  1. Create or Choose a Layer:

    • If you decide to create a new layer for your application, use the bitbake-layers create-layer command to generate it. For example, bitbake-layers create-layer meta-custom-app.
    • If you prefer to use an existing layer, ensure it’s appropriate for your application and its dependencies.
  2. Add Your Application Recipe:

    • Create a BitBake recipe for your Qt application within your chosen layer. This recipe should handle fetching your application’s source code, configuring, compiling, and installing it into the image.
    • Place your recipe in the appropriate recipes directory, for example, meta-custom-app/recipes-apps/myqtapp/myqtapp.bb.
  3. Modify the Image Recipe:

    • To replace the CinematicExperience demo with your application, you’ll need to modify the tdx-reference-multimedia-image recipe or create a custom image recipe that includes your application instead.
    • In your custom or modified image recipe, remove the line that adds the CinematicExperience demo and add a line to include your application. For example, add IMAGE_INSTALL_append = " myqtapp" to include your application in the image.
  4. Disable the Autorun of CinematicExperience:

    • As mentioned in the context, to stop and disable the CinematicExperience demo, use:
      # systemctl stop wayland-app-launch
      # systemctl disable wayland-app-launch
      
    • To autorun your application, you can modify the wayland-app-launch service or create a new systemd service file for your application. Ensure it’s enabled to start on boot.
  5. Build Your Image:

    • With your application and modifications in place, you can build the image using BitBake. Run bitbake tdx-reference-multimedia-image (or your custom image name if you created a new image recipe).
  6. Deploy and Test:

    • After

Please, also check if these links can help you solve your problem:

How to Autorun Application at the Start up in Linux | Toradex Developer Center.

Hi @SruthiSathyan,

Additional to what Toradex AI suggested you may want to check below recipe for your reference and adapt same in your custom meta layer

https://git.toradex.com/cgit/meta-toradex-demos.git/tree/recipes-graphics/wayland-app-launch?h=kirkstone-6.x.y

Best regards
Ritesh Kumar

I have created a new layer called meta-qtapplication.My layer contains
meta-qtapplication$ tree -L 3


|-- COPYING.MIT
|-- README
|-- conf
| -- layer.conf – recipes-example
|-- example
| -- example_0.1.bb – myqtapp
|-- AutomotiveCluster
|-- AutomotiveCluster.tar.gz
`-- myapp.bb


Content of myapp.bb is
cat recipes-example/myqtapp/myapp.bb


DESCRIPTION = “My Qt Application”
LICENSE = “MIT”
LIC_FILES_CHKSUM = “file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302”

SRC_URI = “file://AutomotiveCluster.tar.gz”

S = “${WORKDIR}/AutomotiveCluster”

inherit qmake5

do_install() {
install -d ${D}${bindir}
install -m 0755 ${S}/AutomotiveCluster ${D}${bindir}/AutomotiveCluster
}

RDEPENDS_${PN} = “qt5”


.Here the automotive cluster contains qt app build on qt6.Is this the correct step to start with.

Hi @SruthiSathyan ,
I have some side questions to this topic:

  • What are your boot time requirements?
  • Have you considered using containers for your application? I do not know your level of Yocto experience and familiarity but we did put together Torizon OS because of the ease of use of containers.
  • I believe you had reached out about potentially using remote updates. Have you already a solution to perform these updates? I see ‘automotivecluster’ if that is your industry you may be interested to know that our Torizon Cloud update service follows the Uptane framework: https://uptane.org/.
    Best regards,

I am new to yocto. I need to run my application instead of cinematicexperience. What are the steps that I should follow. I have already created a layer called meta-qtapplication. I also put the source code inside the layer and written the .bb file for it. What step should I take next.
meta-qtapplication$ tree -L 3


|-- COPYING.MIT
|-- README
|-- conf
| -- layer.conf – recipes-example
|-- example
| -- example_0.1.bb – myqtapp
|-- AutomotiveCluster
|-- AutomotiveCluster.tar.gz
`-- myapp.bb

Hi @SruthiSathyan,

We do not have exact steps for your query. This is more generic question related how to use Yocto.

That said to help you we have similar article on How to add custom layer which I believe you are already following

Additionally we already shared wayland app recipe which starts cinematic demo.
Kindly adapt same as per you application and let us know if you face any error.
Try to compile your recipe myapp using bitbake and see if you get any error.

Further if you are on tight timeline we also have professional service available let us know if you are in need of same.

Best regards
Ritesh Kumar