RDK Resources
[*RDK Preferred*]
Code Management Facility
RDK Forums
[RDK Conferences]
RDK Support
Archives
Papers & Presentations Archive
This page explains how you as AppDeveloper can create, compile your native (c/c++) application using DAC SDK and how to publish it to RDK-M staging DAC-Appstore in the cloud.
When your application meets the DAC App contract for binary compatibility it will allow you as AppDeveloper
Here is overview of DAC solution and following video made by ConsultRed at TechSummit2024 nicely explains that bigger picture dac_overview_rdk_tech_summit_2024.mp4
Above credentials are one time request per App developer entity. Once you have above credentials, you can reuse them for publishing other apps under your entity. At this moment requesting these credentials is still manual process, a point to improve in future
As an Appdeveloper you want to test and run your DAC Application on a set of real hardware reference devices. RDK-M created the Video Accelerators for that.
If your app code complies with DAC app contract for binary compatibility it should be able to run on the various RDK Video Accelerator Devices provided these run firmware images (=monolitic software image) that also live up to that DAC contract for binary compatibility. The RDK6.1 monolithic software release live up to that contract (as of RDK6.1_RC2 Feb 2024), contains UI to browse and install DAC apps from RDK-M DAC cloud/staging store. The RPI4 is the open source community Video Accelerator that RDK-M supports. RDK-M made available a pre-build of such rdk6.1 lib32-rdk-generic-mediaclient-wpe-image software image for rpi so that you can just load this image on your rpi4 device and can start testing. (without having to spend any time on building such image from scratch) This prebuilt is available in via this link https://wiki.rdkcentral.com/download/attachments/80261869/rdk-generic-mediaclient-wpe-tdk-image-raspberrypi4-64-rdk-android-mc-6.1.0.wic.bz2 See RDK6.1 rpi4 release notes wiki Raspberry Pi 4 RDK6.1 Release Notes#Downloadapre-builtimage In next section we explain how you can flash that image on rpi4.
To get your hands on other Video Accelerator HWs and their RDK6.1 SW images, we refer you to RDK-M
Download and install https://www.balena.io/etcher/ tool
As part of the DAC project, an SDK has been created to make it easier to develop and build oci and DAC compliant containerized applications. The SDK is public, fully open source and uses standard Yocto 3.1 Dunfel Poky environment.
It is available on https://github.com/rdkcentral/meta-dac-sdk
The DAC SDK consists of
build instructions as per https://github.com/rdkcentral/meta-dac-sdk/blob/master/README.md They are copies here but it is best to read the instructions there to be sure they are up to date.
This is the one time "setup" part of the SDK.
# make sure that your Linux host has required packages needed for Yocto. # These are defined in https://docs.yoctoproject.org/3.1.33/ref-manual/ref-system-requirements.html#required-packages-for-the-build-host # Create build directory mkdir build; cd build # Install 'repo' tool from: https://android.googlesource.com/tools/repo # following repo commands will download Yocto poky environment and other required meta-layers see manifest of https://github.com/rdkcentral/meta-dac-sdk/blob/master/manifests/dac-dunfell-manifest.xml repo init -u https://github.com/rdkcentral/meta-dac-sdk/ -m manifests/dac-dunfell-manifest.xml repo sync --no-clone-bundle -v -j$(getconf _NPROCESSORS_ONLN) . ./oe-init-build-env cp ../.repo/manifests/manifests/bblayers.conf conf/ # to build for ARM 32bit echo 'MACHINE = "raspberrypi4"' >> conf/local.conf
If everything worked, the SDK is now set up and ready for use. You only need to run above steps the first time you set up the SDK. For subsequent uses, you only need to run the following command to configure the build environment:
cd build . ./oe-init-build-env
Now you can proceed with building your AppContainer image
You ask Yocto to build specific DAC AppContainer image by invoking "bitbake <Recipename_AppContainer> "
Before making your own AppContainer image, you can try out the SDK by building one of existing example AppContainer images coming with the SDK and usually already available on RDK-M DAC cloud
# Now you can build the "DAC AppContainer image" of your choice. # Note that you need to have associated yocto image recipe defined in meta-layer and use that as <your yocto image target> # as per example image recipes in https://github.com/rdkcentral/meta-dac-sdk/tree/master/recipes-example/images # use bitbake <your yocto image target> to build the associated dac AppContainer. # below commands build dac AppContainer examples coming with SDK bitbake dac-image-wayland-egl-test bitbake dac-image-wayland-egl-test-input bitbake dac-image-essos-sample bitbake dac-image-essos-egl bitbake dac-image-qt-test bitbake dac-image-shell bitbake dac-image-flutter-slide-puzzle bitbake dac-image-chocolate-doom bitbake dac-image-cobalt bitbake dac-image-glmark2 # Or build them all at once bitbake dac-image-wayland-egl-test dac-image-wayland-egl-test-input dac-image-essos-sample dac-image-essos-egl dac-image-qt-test dac-image-shell dac-image-flutter-slide-puzzle dac-image-glmark2
Once the build has succeed you can find your AppContainer image in yocto deploy directory. You will find several files there. The files with symbolic links to files with "oci-image.tar" suffix in the name are the real oci, dobby, dac compliant AppContainer images. Those are the ones you will then need to use in next step (upload to Container registry in cloud)
# AppContainer image is located in deploy dir within yocto build dir (as any other yocto target images) $cd build/tmp/deploy/images/raspberrypi4/ $ls -lsa | grep oci 35612 -rw-rw-r-- 2 sverkoyen sverkoyen 36464640 Apr 10 11:14 dac-image-cobalt-raspberrypi4-20240410084211.rootfs-oci-latest-arm-linux.oci-image.tar 4 lrwxrwxrwx 2 sverkoyen sverkoyen 86 Apr 10 11:14 dac-image-cobalt.tar -> dac-image-cobalt-raspberrypi4-20240410084211.rootfs-oci-latest-arm-linux.oci-image.tar 9352 -rw-rw-r-- 2 sverkoyen sverkoyen 9574400 Apr 17 15:42 dac-image-glmark2-raspberrypi4-20240417134132.rootfs-oci-latest-arm-linux.oci-image.tar 4 lrwxrwxrwx 2 sverkoyen sverkoyen 87 Apr 17 15:42 dac-image-glmark2.tar -> dac-image-glmark2-raspberrypi4-20240417134132.rootfs-oci-latest-arm-linux.oci-image.tar # so in this example "dac-image-cobalt.tar" and "dac-image-glmark2.tar" are the oci, dobby, dac compliant AppContainer images
Below video is a demonstration on how you use the SDK to build Youtube-cobalt as DAC application
same video is also available on Youtube 'https://www.youtube.com/watch?v=Ie7fQy5HTlc
Next section explains how you can create your own AppContainer image
To create and build your own oci, dobby, dac complaint AppContainer image as Appdeveloper, you need to create the following necessary yocto recipes and files :
This is visualized in the diagram below
To ease integration and life of Appdeveloper meta-dac-sdk layer defined several types of dac-image bbclasses
These bbclasses automatically arrange that the necessary dependent libraries are installed in the AppContainer image and that AppContainer image is formatted according to Open Container OCI Image Format Specification.
As App developer you must inherit the appropriate dac-image bbclass in its own AppContainer image recipe.
Following dac-image bbclasses types are defined, choose the one appropriate for your use case:
dac-image-essos - for DAC application that are using OpenGLES2 as Graphics rendering API and Firebolt ® Essos to setup EGL graphics surface and for key-input
The classes themselves have certain hierarchy. Diagram below visualizes that and has links to their source code.
Once you have built your oci, dobby, dac compliant AppContainer image with DAC SDK, you can publish it to RDK-M DAC cloud.
There are 2 separate publish steps to take for 1 application :
In next sections we provide detailed howto for each step.
With step2 you will make your DAC native applciation discoverable to Video Accelerators with RDK-M RDK6.1 image but just to be clear and avoid misunderstandings, this will NOT distribute, deploy or make your app available to Appstore of the various RDK operators (Liberty Global, Comcast, Sky). For that you would need to start a discussion with each operator. But this DAC architecture gives you the big benefit that you can now share your Application binary as AppContainer in step1 and when it meets the DAC App contract for binary compatibility it will be binary compatible and technically much easier/quick for the operator to run and test your app on their boxes for first time, get familiar with it. No significant technical integration work should be needed just to get the app running on the operator box. With the DAC cloud for the RDK-M Video Accelerator you as App developer get staging platform where you and others from RDK community can run, test your same application binary across the various supported RDK SoC reference devices (the VA's) and share it with RDK community.
You can either publish your oci container image to
Depending on the oci registry product, there are various login/access credential procedures.
We provide the instructions for Amazon Elastic Container Registry. The private container registry setup RDK-M DAC team is also such type.
You need to have the following util programs installed: aws cli tools and skopeo.
Assuming your host is linux, configure your aws profile ~/.aws/credentials file as per below
//Obviously you need to fill in your credentials below iso xxxxx and yyyyy. If you want to use the private OCI container registry from RDK-M, request piotr.serafin@consult.red for credentials [s3dacrdk] aws_access_key_id = xxxxx aws_secret_access_key = yyyyyy
Login, create new container repository and publish the OCI image in there:
# login into private RDK-M OCI container registry aws --profile s3dacrdk ecr-public get-login-password --region us-east-1 | skopeo login --username AWS --password-stdin public.ecr.aws/a0v6o9z7 # create repo for your application, in which you can publish different versions, example below creates "cobalt" one for Youtube/cobalt application aws --profile s3dacrdk --region us-east-1 ecr-public create-repository --repository-name cobalt # list repos aws --profile s3dacrdk --region us-east-1 ecr-public describe-repositories # The actual command that uploads/publishes your local version of a oci image associated with your application to the RDK-M oci-registry # within repo named "cobalt" with the version tag "latest" standing for latest version skopeo copy oci-archive:dac-image-cobalt.tar docker://public.ecr.aws/a0v6o9z7/cobalt:latest # with following command you can download your oci image from RDK-M registry to your local host skopeo copy docker://public.ecr.aws/a0v6o9z7/cobalt:latest oci:cobalttest # command to double check if uploaded container is oci image type skopeo inspect --raw docker://public.ecr.aws/a0v6o9z7/cobalt:latest { "schemaVersion": 2, "config": { "mediaType": "application/vnd.oci.image.config.v1+json", "size": 548, "digest": "sha256:0bc2f756fc781b015769230b207c6b227b788023a5c3d599504407cc1619110e" }, [...] }
You have to remember the OCI image URL of your application, which in this example is docker://public.ecr.aws/a0v6o9z7/cobalt:latest. Because you will have to specify it when publishing the DAC app to the ASMS (AppStore Metdata service).
ASMS (AppStore Metadata Service) offers API that allows Application Maintainers to register their app with appropriate metadata. There are various ways to publish a new application to ASMS in DAC Cloud:
You can access the swagger UI with the API documentation here:
see screenshot
As you can see in screenshot the ASMS API is divided in "STB" en "Maintainer" part.
The "Maintainer" part is there for creating, getting, deleting apps belonging to specific App Developer entity/company, hereafter called maintainer, as well as for creating/listing Maintainers.
At this moment we don't have many different App Developer entities using this yet since and most apps created so far as registered under the Maintainer with "rdk" as maintainerCode (also dactest.py uses that)
as per API, to see the apps created by "rdk" maintainer GET /maintainers/rdk/apps which is http://rdkm-asms-external-1156877020.eu-central-1.elb.amazonaws.com:8080/maintainers/rdk/apps
To insert/create new DAC application into ASMS, you need to use POST /maintainers/{maintainerCode}/apps call with specific body
You can use swagger UI with example body for doing this, see http://rdkm-asms-external-1156877020.eu-central-1.elb.amazonaws.com:8080/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config#/Maintainer/createMaintainerApplication
and screenshot below
example POST body with only the minimum required parameters
As ociImageUrl, use full path to container registry with "docker://" transport and ending with version tag, as in example screenshot below
{ "header": { "icon": "https://posterserver.com/s/apps/com.company.app.awesome/1.2.3/image/1920x1080/icon.png", "name": "Awesome Application", "description": "This is Awesome App", "type": "application/dac.native", "category": "application", "id": "com.company.app.awesome", "version": "1.2.3", "visible": true, "ociImageUrl": "docker://public.ecr.aws/a0v6o9z7/company/awesome:latest" }, "requirements": { "platform": { "architecture": "arm", "os": "linux" }, }
another example POST body that includes optional metadata parameters, Additionally you can check how dactest.py is doing it.
Among other things, dactest.py can be used list ASMS apps, add entries and remove entries.
To add an entry to ASMS, i.e. to publish a DAC app you can follow these steps:
We explain here 2 ways to download your DAC application from Staging RDK-M DAC Appstore and install it on the video Accelerator :
In the resident UI go to the icon with the 9 small squares (left bottom) to navigate to the DAC menu. There you will see three submenu items:
dactest.py can be used list, install, uninstall, start and stop DAC apps. It also connects to RDK ASMS to list available DAC apps in the cloud. The DAC apps downloaded from the cloud are generated to bundles inside that cloud and cached there. Sometimes the download can take a while if the bundle still needs to be generated for a specific platform and/or version.
So how to use dactest.py to install an app from ASMS:
If you're interested to see what HTTP commands are sent to ASMS and what websocket commands are sent to LISA and RDKShell to support this demo then check the contents of dactest.py.