summaryrefslogtreecommitdiffstats
path: root/meta-offline-voice-agent/recipes-vosk/vosk-openfst
diff options
context:
space:
mode:
authoramanarora_09 <aman.arora9848@gmail.com>2022-07-22 15:58:23 +0200
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2022-07-28 13:58:18 +0000
commiteda84d25d819824d641cf89af1e4d61a5e946744 (patch)
tree38f4b7c34a5b91257518bcbcdc6b96d24f0641b2 /meta-offline-voice-agent/recipes-vosk/vosk-openfst
parentf206eab5753bd9ee2d5b1126c6ec5a18e75cac89 (diff)
meta-offline-voice-agent: Enable layer for offline voice recognition
- This enables offline voice recognition in AGL - Can successfully run vosk API and vosk websocket server Changes: - Create a new layer: meta-offline-voice-recognition - Create recipes for the the Vosk library, API, websocket server and model - Create feature template for the layer (agl-offline-voice-agent) - Add all required packages to IMAGE_INSTALL - ptest enable recipe python3-vosk-api - Few fixes Bug-AGL: SPEC-4497 Change-Id: Icb290ceee22e2c3a51cbd67f7431701795f1201b Signed-off-by: amanarora_09 <aman.arora9848@gmail.com>
Diffstat (limited to 'meta-offline-voice-agent/recipes-vosk/vosk-openfst')
-rw-r--r--meta-offline-voice-agent/recipes-vosk/vosk-openfst/files/0001-build-fixes-for-bitbake.patch64
-rw-r--r--meta-offline-voice-agent/recipes-vosk/vosk-openfst/vosk-openfst_1.8.0.bb23
2 files changed, 87 insertions, 0 deletions
diff --git a/meta-offline-voice-agent/recipes-vosk/vosk-openfst/files/0001-build-fixes-for-bitbake.patch b/meta-offline-voice-agent/recipes-vosk/vosk-openfst/files/0001-build-fixes-for-bitbake.patch
new file mode 100644
index 00000000..fd3234c8
--- /dev/null
+++ b/meta-offline-voice-agent/recipes-vosk/vosk-openfst/files/0001-build-fixes-for-bitbake.patch
@@ -0,0 +1,64 @@
+From 8f5bc403c58af348d9671ca390c34cabde89a529 Mon Sep 17 00:00:00 2001
+From: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+Date: Sat, 9 Jul 2022 16:49:10 +0200
+Subject: [PATCH] build fixes for bitbake
+
+Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+---
+ configure.ac | 36 +-----------------------------------
+ 1 file changed, 1 insertion(+), 35 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9ab8824..316f719 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -5,7 +5,7 @@ AM_PROG_AR
+ AC_PROG_CXX
+ # This library does not throw exceptions, so we do not generate exception
+ # handling code. However, users are free to re-enable exception handling.
+-CXX="$CXX -std=c++17 -fno-exceptions -Wno-deprecated-declarations"
++#CXX="$CXX -std=c++17 -fno-exceptions -Wno-deprecated-declarations"
+
+ AC_DISABLE_STATIC
+ AC_PROG_LIBTOOL
+@@ -149,40 +149,6 @@ AC_ARG_WITH([libfstdir],
+
+ AC_SUBST([libfstdir], $with_libfstdir)
+
+-# Flags may be changed after configuring, so this is checked again by
+-# weight_test.cc. The check here is to save time in the common case,
+-# or when someone does not run `make check`.
+-AC_RUN_IFELSE([AC_LANG_PROGRAM([
+- #include <cstdio>
+-
+- template <typename T>
+- bool FloatEqIsReflexive(T m) {
+- volatile T x = 1.111;
+- x *= m;
+-
+- T y = 1.111;
+- y *= m;
+-
+- return x == y;
+- }
+- ], [
+- volatile double test_value = 1.1;
+- if (!FloatEqIsReflexive(static_cast<float>(test_value))) {
+- printf("float FAIL\n");
+- return 1;
+- }
+- if (!FloatEqIsReflexive(test_value)) {
+- printf("double FAIL\n");
+- return 1;
+- }
+- ])],
+- [echo "Float equality is good"],
+- [AC_MSG_FAILURE(m4_normalize([
+- Test float equality failed!
+- Compile with -msse -mfpmath=sse if using g++.
+- ]))],
+- [echo "Ignoring test for cross-compilation"])
+-
+ AC_CHECK_LIB([dl], dlopen, [DL_LIBS=-ldl])
+ AC_SUBST([DL_LIBS])
+
diff --git a/meta-offline-voice-agent/recipes-vosk/vosk-openfst/vosk-openfst_1.8.0.bb b/meta-offline-voice-agent/recipes-vosk/vosk-openfst/vosk-openfst_1.8.0.bb
new file mode 100644
index 00000000..c7e07bfe
--- /dev/null
+++ b/meta-offline-voice-agent/recipes-vosk/vosk-openfst/vosk-openfst_1.8.0.bb
@@ -0,0 +1,23 @@
+DESCRIPTION = "OpenFst is a library for constructing, combining, optimizing, and searching weighted finite-state transducers (FSTs)."
+SUMMARY = "Openfst mirror with some fixes"
+HOMEPAGE = "https://github.com/alphacep/openfst"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=973381090441f4eb420224655e05e064"
+
+SRC_URI = "git://github.com/alphacep/openfst.git;protocol=https;branch=master \
+ file://0001-build-fixes-for-bitbake.patch \
+ "
+
+SRCREV = "7dfd808194105162f20084bb4d8e4ee4b65266d5"
+S = "${WORKDIR}/git"
+
+inherit autotools python3native
+
+# Specify any options you want to pass to the configure script using EXTRA_OECONF:
+EXTRA_OECONF = "--enable-static --enable-shared --enable-far --enable-ngram-fsts --enable-lookahead-fsts --with-pic --disable-bin"
+
+FILES:${PN} += " /usr/lib/fst /usr/lib/fst/arc_lookahead-fst.so \
+ /usr/lib/fst/ilabel_lookahead-fst.so \
+ /usr/lib/fst/ngram-fst.so \
+ /usr/lib/fst/olabel_lookahead-fst.so \
+"