summaryrefslogtreecommitdiffstats
path: root/meta-offline-voice-agent/recipes-vosk
AgeCommit message (Collapse)AuthorFilesLines
2024-02-16meta-offline-voice-agent: remove 'virtual/' RPROVIDESScott Murray9-12/+12
Replace 'virtual/vosk-model' RPROVIDES use with just 'vosk-model' to future-proof for Yocto Project 5.0 / Scarthgap, where it triggers a warning. Also update checksums in a couple of the model recipes to fix errors seen during test builds. Bug-AGL: SPEC-5067 Change-Id: I6d39342059c93d7bef77e9b65ff11a9b2aee51aa Signed-off-by: Scott Murray <scott.murray@konsulko.com>
2023-11-03Update voice agent related recipesMalik Talha1-0/+22
Change the SRCURI to use gerrit repos. Update agl-service-voicegent recipe to correctly package all the required content. Add recipe for another en-us vosk model. Add service files for RASA and Voice Agent server. Bug-AGL: SPEC-4906 Change-Id: Ic9f77386ff5c545c2a80433dd538c94bd8763e9e Signed-off-by: Malik Talha <talhamalik727x@gmail.com>
2023-10-05Add dependencies for intent engine snipsMalik Talha2-5/+2
This adds the libraries for the snips intent engine. Bug-AGL: SPEC-4856 Change-Id: I0acec6fdd1d0809ee2a0a52ee2c95cd86671d760 Signed-off-by: Malik Talha <talhamalik727x@gmail.com>
2023-08-08Rework and update offline voice agentamanarora_0910-22/+147
This brings the voice agent to the state shown at AMM and EW. Change-Id: I31ac4adc874a206e6e598ba116523ecc7eb99fc9 Signed-off-by: amanarora_09 <aman.arora9848@gmail.com> Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
2022-11-10Allow building vosk-kaldi on arm32 and aarch64Jan-Simon Moeller1-0/+14
Remove -msse and -msse2 as they are x86 only flags. Bug-AGL: SPEC-4600 Change-Id: I48f52c1c8be7ccfa2db9d70f09d81ad52006a891 Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
2022-07-28meta-offline-voice-agent: Enable layer for offline voice recognitionamanarora_0912-0/+519
- 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>
color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * Copyright (C) 2016 "IoT.bzh"
 * Author Fulup Ar Foll <fulup@iot.bzh>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * 
 * To find out which control your sound card uses
 *  aplay -l  # Check sndcard name name in between []
 *  amixer -D hw:xx controls # get supported controls
 *  amixer -D "hw:4" cget numid=xx  # get control settings
 * 
 */
#define _GNU_SOURCE 
#include "hal-interface.h"
#include "audio-interface.h" 

STATIC struct json_object* MasterOnOff (alsaHalCtlMapT *control, void* handle) {
    static int powerStatus=0;
    
    if (! powerStatus) {
        powerStatus = 1;
        AFB_DEBUG ("Power Set to On");
    } else {
        powerStatus  = 0;
        AFB_DEBUG ("Power Set to Off");        
    }
    
    return NULL;
}

// Map HAL hight sndctl with Alsa numid and optionally with a custom callback for non Alsa supported functionalities. 
STATIC alsaHalMapT  alsaHalMap[]= { 
  { .alsa={.control=Master_Playback_Volume,.numid=04, .name="Matrix 03 Mix A Playback Volume"   , .values=1,.minval=0,.maxval= 87 ,.step=0}, .info= "Master Playback Volume" },
  { .alsa={.control=PCM_Playback_Volume   ,.numid=06, .name="play-vol"     , .values=2,.minval=0,.maxval= 255,.step=0}, .info= "PCM Playback Volume" },
  { .alsa={.control=PCM_Playback_Switch   ,.numid=05, .name="play-switch"  , .values=1,.minval=0,.maxval= 1  ,.step=0}, .info= "Master Playback Switch" },
  { .alsa={.control=Capture_Volume        ,.numid=12, .name="capt-vol"     , .values=2,.minval=0,.maxval= 31 ,.step=0}, .info= "Capture Volume" },
  { .alsa={.control=Master_OnOff_Switch, .name="Power-Switch"}, .cb={.callback=MasterOnOff, .handle=NULL}, .info= "OnOff Global Switch"},
  { .alsa={.numid=0}, .cb={.callback=NULL, .handle=NULL}} /* marker for end of the array */
} ;

// HAL sound card mapping info
STATIC alsaHalSndCardT alsaHalSndCard  = {
    .name  = "Scarlett 18i8 USB", //  WARNING: name MUST match with 'aplay -l'
    .info  = "Hardware Abstraction Layer for Scarlett Focusrite USB professional music sound card",
    .ctls  = alsaHalMap,
};


STATIC int sndServiceInit () {
    int err;
    AFB_DEBUG ("IntelHalBinding Init");

    err = halServiceInit (afbBindingV2.api, &alsaHalSndCard);
    return err;
}

// API prefix should be unique for each snd card
PUBLIC const struct afb_binding_v2 afbBindingV2 = {
    .api     = "scarlett-usb",
    .init    = sndServiceInit,
    .verbs   = halServiceApi,
    .onevent = halServiceEvent,
};