Contents

GSoC Weekly Update: Community Bonding Period


This post will briefly cover:

  • Some issues I encountered while building the AGL Image
  • Reading docs, understanding concepts, noting required dependencies
  • Minor contributions/fixes to documentation
  • Current tasks in progress??

For the project proposal, visit here.

The Community Bonding Period of GSoC was extremely helpful in setting me up for the next few weeks where I will be working on my project. The AGL Weekly Developer meetings are where we get all the updates regarding issues and development on the various ongoing projects within AGL.

Apart from this, I had and will continue to have weekly calls with my mentor and fellow GSoC developers, and that’s when we give progress updates and discuss our doubts, the ongoing issues and how to resolve them.

Building AGL Image and Issues

This is the AGL Image build, taken from branch marlin. To setup and initialize AGL workspace and to build the image, please refer to the AGL Documentation here.

The tree directory structure is given below.

$AGL_TOP

1
2
3
4
.
├── marlin
├── site.conf
└── sstate-cache

$AGL_TOP/marlin

1
2
3
4
5
6
7
.
├── bsp
├── external
├── meta-agl
├── meta-agl-demo
├── meta-agl-devel
└── qemux86-64

A few errors encountered during build process:

1
2
3
4
5
6
7
8
$ time bitbake agl-demo-platform
# Build process output omited
ERROR: Task (virtual:native:/home/aman/AGL/marlin/external/poky/meta/recipes-support/icu/icu_66.1.bb:do_compile) failed with exit code '1'
# Build process output omitted
Summary: 1 task failed:
  virtual:native:/home/aman/AGL/marlin/external/poky/meta/recipes-support/icu/icu_66.1.bb:do_compile
Summary: There was 1 WARNING message shown.
Summary: There were 6 ERROR messages shown, returning a non-zero exit code.

Post-examination of log file and discussion with my GSoC mentor, the issue seemed to be some sort of host contamination.

The suggestion was to try, after changing the directory to qemux86-64:

1
2
bitbake -c cleanall  icu-native
$ bitbake agl-demo-platform

After trying the above command, the issue persisted. The displayed error:

1
ERROR: Task (virtual:native:/home/aman/AGL/marlin/external/poky/meta/recipes-support/icu/icu_66.1.bb:do_compile) failed with exit code '1'

For this, ran the following:

1
2
3
4
$ cd $AGL_TOP/marlin/external/poky
$ ./scripts/install-buildtools
$ source buildtools/environment-setup-x86_64-pokysdk-linux
cd ../..

Then, continued with AGL setup as per the AGL docs.

After starting the build, the issue still persisted, this time, with a new error.

1
2
3
ERROR: qemu-system-native-4.2.0-r0 do_compile: Execution of '/home/aman/AGL/marlin/qemux86-64/tmp/work/x86_64-linux/qemu-system-native/4.2.0-r0/temp/run.do_compile.1934016' failed with exit code 1 
# Build process output omitted
ERROR: Task (/home/aman/AGL/marlin/external/poky/meta/recipes-devtools/qemu/qemu-system-native_4.2.0.bb:do_compile) failed with exit code '1'

After going through a few links here and there, the issue initially seemed like some dependencies necessary for a successful build were missing. But after discussion and some help from mentor Jan-Simon Möller, the issue was identified as buildhost (a debian machine) being “too new” for the current branch. The machine was downgraded.

After a reboot, the build worked, and we have AGL running. Following the documentation, Inside the build directory, to deploy the image, do

1
2
$ source $AGL_TOP/marlin/qemux86-64/agl-init-build-env
$ runqemu tmp/deploy/images/qemux86-64/agl-demo-platform-qemux86-64.qemuboot.conf kvm serialstdio slirp publicvnc audio

AGL boots up.

With username root the AGL shell is accessible. To exit, do poweroff.

Contributions

Submitted a documentation patch: 27575: Fixed quote errors in echo expressions

Reading

Went through a few resources to understand some of the build issues. The process is time consuming, and even understanding the issues surrounding the Yocto Project takes time. I want to thank my GSoC mentor Jan-Simon Möller for helping out with build issues and suggestions related to the project.

Went through Yocto Project documentation especially Understanding and creating layers and Recipes, etc. all related to the work that has to be done with as the coding period starts. Also went through the Vosk Project to get a list of required dependencies.

Tasks in Progress and Next Steps

As a next step, I have started with the new layer creation process.

A new layer named meta-offline-voice-agent has been created.

The project development directory for the offline-voice-agent project would be meta-agl-devel. To create a new layer, simply do:

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
$ cd $AGL_TOP/marlin/meta-agl-devel/
# It is important sure there is no directory with the same name as the layer we are going to create.
$ bitbake-layers create-layer meta-offline-voice-agent
$ cd ../qemux86-64/conf/
$ vi bblayers.conf
# Here, adding the meta-offline-voice-agent layer in AGL_OTHER_DEPENDENCY_LAYERS
=========================================================================================================================================================
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf                                                                                                                                               
# changes incompatibly                                                                                                
LCONF_VERSION = "7"                      
BBPATH = "${TOPDIR}"
BBFILES ?= ""                           
# Convenience variables usable in various configuration fragments
#---------------------------------- 
BCONFDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)))}" 
METADIR  := "${@os.path.abspath('/home/aman/AGL/marlin/external/poky/../..')}"
# These are the core OE + YP Layers
#----------------------------------                                                   
YOCTO_LAYERS = " \              
  ${METADIR}/external/poky/meta \    
  ${METADIR}/external/poky/meta-poky \    
  "          
#  this is added for the boards where necessary, not globally
#  ${METADIR}/external/poky/meta-yocto-bsp \ 
#

# These are the AGL CORE Layers that make up the basis
# - they create a minimal bootable filesystem
#   with some automotive tools/libraries
#-----------------------------------------------------                                

AGL_CORE_LAYERS = " \              
  ${METADIR}/meta-agl/meta-agl-core \     
  ${METADIR}/meta-agl/meta-agl-core-test \ 
  ${METADIR}/meta-agl/meta-agl-bsp \    
  "                      
# These are the direct dependencies of the AGL CORE Layers                                                                 
#---------------------------------------------------------                                                                  
AGL_CORE_DEPENDENCY_LAYERS = " \ 
  ${METADIR}/external/meta-openembedded/meta-oe \
  "
# Indirection to avoid duplicate inclusions of the same folder into BBLAYERS                                                                                                                                       
# the evaluation is in the bblayers.conf.sample in meta-agl/templates/base
AGL_META_NETWORKING ?= ""           
AGL_META_PYTHON ?= ""
AGL_META_FILESYSTEMS ?= ""  
AGL_META_VIRTUALIZATION ?= ""
AGL_META_CLANG ?= ""                 

AGL_OTHER_DEPENDENCY_LAYERS = " \
    ${AGL_META_NETWORKING} \
    ${AGL_META_PYTHON} \
    ${AGL_META_FILESYSTEMS} \
    ${AGL_META_VIRTUALIZATION} \
    ${AGL_META_CLANG} \
    "

####################
# Combine the layers
BBLAYERS ?= " \
  ${AGL_OTHER_DEPENDENCY_LAYERS} \
  ${AGL_CORE_DEPENDENCY_LAYERS} \
  ${AGL_CORE_LAYERS} \
  ${YOCTO_LAYERS} \
  "

BBLAYERS_NON_REMOVABLE ?= " \
  ${METADIR}/external/poky/meta \
  ${METADIR}/external/poky/meta-poky \
  ${METADIR}/meta-agl/meta-agl-core \
  "

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# fragment { 
# /home/aman/AGL/marlin/meta-agl-demo/templates/feature/agl-demo/50_bblayers.conf.inc
#
# This layer contains the WIP feature/demo code only 
#--------------------------------------------------- 
BBLAYERS =+ " \
   ${METADIR}/meta-agl-demo \
"

AGL_META_FILESYSTEMS = "${METADIR}/external/meta-openembedded/meta-filesystems"
AGL_META_NETWORKING = "${METADIR}/external/meta-openembedded/meta-networking"
AGL_META_PYTHON = "${METADIR}/external/meta-openembedded/meta-python"

# OpenEmbedded layer to add support for multiple cloud service provider solutions
#--------------------------------------------------- 
BBLAYERS =+ " \
   ${METADIR}/external/meta-qt5 \
"

# Chromium recipes do still require python2
BBLAYERS =+ " \
   ${METADIR}/external/meta-python2 \
"
#
# }
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# fragment { 
# /home/aman/AGL/marlin/meta-agl/templates/feature/agl-app-framework/50_bblayers.conf.inc
#

BBLAYERS =+ " \
        ${METADIR}/meta-agl/meta-app-framework \
        "

#
# }
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# fragment { 
# /home/aman/AGL/marlin/meta-agl/templates/feature/agl-pipewire/50_bblayers.conf.inc
#

BBLAYERS =+ " \
        ${METADIR}/meta-agl/meta-pipewire \
        "

# This is the layer that we created.
BBLAYERS =+ " \
       /home/aman/AGL/marlin/meta-agl-devel/meta-offline-voice-agent \
       "

# we ship our own pipewire
BBMASK += "meta-openembedded/meta-oe/recipes-multimedia/pipewire/"

#
# }
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
=========================================================================================================================================================

# Then we set the layer priority for our layer. The parameter to be adjusted exists in the layer, in conf/layer.conf file.

$ cd $AGL_TOP/marlin/meta-agl-devel/meta-offline-voice-agent/conf
$ vi layer.conf
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"

# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
            ${LAYERDIR}/recipes-*/*/*.bbappend"

BBFILE_COLLECTIONS += "meta-offline-voice-agent"
BBFILE_PATTERN_meta-offline-voice-agent = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-offline-voice-agent = "65" # The layer priority.

LAYERDEPENDS_meta-offline-voice-agent = "core"
LAYERSERIES_COMPAT_meta-offline-voice-agent = "dunfell"


$ cd ../../../qemux86-64/
$ source agl-init-build-env

# Running this command shows the created layer.
$ bitbake-layers show-layers

NOTE: Starting bitbake server...
layer                 path                                      priority
==========================================================================
meta-offline-voice-agent  /home/aman/AGL/marlin/meta-agl-devel/meta-offline-voice-agent  65
meta-pipewire         /home/aman/AGL/marlin/meta-agl/meta-pipewire  71
meta-app-framework    /home/aman/AGL/marlin/meta-agl/meta-app-framework  60
meta-python2          /home/aman/AGL/marlin/external/meta-python2  7
meta-qt5              /home/aman/AGL/marlin/external/meta-qt5   7
meta-agl-demo         /home/aman/AGL/marlin/meta-agl-demo       70
meta-networking       /home/aman/AGL/marlin/external/meta-openembedded/meta-networking  5
meta-python           /home/aman/AGL/marlin/external/meta-openembedded/meta-python  7
meta-filesystems      /home/aman/AGL/marlin/external/meta-openembedded/meta-filesystems  6
meta-oe               /home/aman/AGL/marlin/external/meta-openembedded/meta-oe  6
meta-agl-core         /home/aman/AGL/marlin/meta-agl/meta-agl-core  60
meta-agl-core-test    /home/aman/AGL/marlin/meta-agl/meta-agl-core-test  60
meta-agl-bsp          /home/aman/AGL/marlin/meta-agl/meta-agl-bsp  60
meta                  /home/aman/AGL/marlin/external/poky/meta  5
meta-poky             /home/aman/AGL/marlin/external/poky/meta-poky  5 

The next steps, which are already in motion, are creating (initially example-) recipes and testing corresponding builds.

Vosk API

We will be using Python-version of Vosk for our purposes. The dependencies, apart from python3-pyaudio and potentially sounddevice can be found from in setup.py in this GitHub Repo.

The plan is to create custom recipes to install these dependencies so that Vosk works, in the coming weeks.

Resources I found helpful:

Build Errors

Recipes and Layers

PipeWire Resources