-
Notifications
You must be signed in to change notification settings - Fork 0
PR: Feature/23 task far field voice hal #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 9 commits
9c1a31c
dc376b1
b592963
1c22e49
e5aedb3
0ce1880
7ee2e59
c28c015
8d71bb4
e02c52b
1f52290
1a368b7
ceb66d6
91c479c
9c8fa82
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,3 +28,8 @@ Makefile | |
|
|
||
| # Compiled aidl output per module | ||
| */gen/ | ||
|
|
||
| .autotools | ||
| .cproject | ||
| .project | ||
| .settings/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| cmake_minimum_required(VERSION 3.8) | ||
|
|
||
| project(FarFieldVoice | ||
| LANGUAGES NONE | ||
| VERSION 1.0) | ||
|
|
||
| if (NOT DEFINED AIDL_BIN) | ||
| message(FATAL_ERROR "Do not invoke module level CMake directly!\nInvoke CMake at root level instead!") | ||
| endif() | ||
|
|
||
| # version of other modules that `farfieldvoice` depends on | ||
| set(COMMON_VERSION "current") | ||
|
|
||
| set(SRC_DIR com/rdk/hal/farfieldvoice) | ||
|
|
||
| set(SRC | ||
| ${SRC_DIR}/Capabilities.aidl | ||
| ${SRC_DIR}/PowerMode.aidl | ||
| ${SRC_DIR}/KeywordDetectInfo.aidl | ||
| ${SRC_DIR}/Status.aidl | ||
| ${SRC_DIR}/FailureCode.aidl | ||
| ${SRC_DIR}/IFarFieldVoice.aidl | ||
| ${SRC_DIR}/IFarFieldVoiceController.aidl | ||
| ${SRC_DIR}/IFarFieldVoiceEventListener.aidl | ||
| ${SRC_DIR}/IFarFieldVoiceControllerListener.aidl | ||
| ../../common/${COMMON_VERSION}/com/rdk/hal/State.aidl | ||
| ) | ||
|
|
||
| set(INCLUDE_FLAGS | ||
| -I. | ||
| -I../../common/${COMMON_VERSION} | ||
| ) | ||
|
|
||
| foreach(SRC_FILE IN ITEMS ${SRC}) | ||
| message(STATUS "== ${SRC_FILE} ==") | ||
| execute_process( | ||
| COMMAND ${AIDL_BIN} ${AIDL_FLAGS} ${INCLUDE_FLAGS} ${SRC_FILE} | ||
| WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
| OUTPUT_VARIABLE OUTPUT | ||
| ERROR_VARIABLE ERROR | ||
| RESULT_VARIABLE RESULT | ||
| ) | ||
|
|
||
| if(RESULT EQUAL 0) | ||
| message(STATUS "Command succeeded with output:\n${OUTPUT}") | ||
| else() | ||
| message(WARNING "Command failed with error:\n${ERROR}") | ||
| endif() | ||
| endforeach() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /* | ||
| * If not stated otherwise in this file or this component's LICENSE file the | ||
| * following copyright and licenses apply: | ||
| * | ||
| * Copyright 2025 RDK Management | ||
| * | ||
| * 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. | ||
| */ | ||
| package com.rdk.hal.farfieldvoice; | ||
|
|
||
| /** | ||
| * @brief Far Field Voice service capabilities. | ||
| * @author Philip Stick | ||
| * @author Gary Skrabutenas | ||
| */ | ||
|
|
||
| @VintfStability | ||
| parcelable Capabilities | ||
| { | ||
| /** | ||
| * Number of microphone inputs. | ||
| */ | ||
| int microphoneChannelCount; | ||
|
|
||
| /** | ||
| * Indicates if the Continual channel is supported. | ||
| */ | ||
| bool continualChannelSupported; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /* | ||
| * If not stated otherwise in this file or this component's LICENSE file the | ||
| * following copyright and licenses apply: | ||
| * | ||
| * Copyright 2025 RDK Management | ||
| * | ||
| * 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. | ||
| */ | ||
| package com.rdk.hal.farfieldvoice; | ||
|
|
||
| /** | ||
| * @brief Far Field Voice channel type definitions. | ||
| * @author Philip Stick | ||
| */ | ||
|
|
||
| @VintfStability | ||
| @Backing(type="int") | ||
|
|
||
| enum ChannelType | ||
| { | ||
| /** | ||
| * Keyword. | ||
| */ | ||
| KEYWORD = 0, | ||
|
|
||
| /** | ||
| * Continual. | ||
| */ | ||
| CONTINUAL = 1, | ||
|
|
||
| /** | ||
| * Microphones. | ||
| */ | ||
| MICROPHONES = 2, | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /* | ||
| * If not stated otherwise in this file or this component's LICENSE file the | ||
| * following copyright and licenses apply: | ||
| * | ||
| * Copyright 2025 RDK Management | ||
| * | ||
| * 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. | ||
| */ | ||
| package com.rdk.hal.farfieldvoice; | ||
|
|
||
| /** | ||
| * @brief Far Field Voice failure code definitions. | ||
| * @author Philip Stick | ||
| * @author Gary Skrabutenas | ||
| */ | ||
|
|
||
| @VintfStability | ||
| @Backing(type="int") | ||
|
|
||
| enum FailureCode | ||
| { | ||
| /** | ||
| * Failure to instantiate or communicate with a sub component. | ||
| */ | ||
| SUB_COMPONENT_FAILURE = 0, | ||
|
|
||
| /** | ||
| * Failure to perform I/O. | ||
| */ | ||
| IO_FAILURE = 1 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| /* | ||
| * If not stated otherwise in this file or this component's LICENSE file the | ||
| * following copyright and licenses apply: | ||
| * | ||
| * Copyright 2025 RDK Management | ||
| * | ||
| * 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. | ||
| */ | ||
| package com.rdk.hal.farfieldvoice; | ||
| import com.rdk.hal.State; | ||
|
||
| import com.rdk.hal.farfieldvoice.Capabilities; | ||
| import com.rdk.hal.farfieldvoice.Status; | ||
| import com.rdk.hal.farfieldvoice.IFarFieldVoiceEventListener; | ||
| import com.rdk.hal.farfieldvoice.IFarFieldVoiceController; | ||
| import com.rdk.hal.farfieldvoice.IFarFieldVoiceControllerListener; | ||
|
|
||
| /** | ||
| * @brief Far Field Voice HAL interface. | ||
| * @author Philip Stick | ||
| * @author Gary Skrabutenas | ||
| */ | ||
|
|
||
| /** | ||
| * The Far Field Voice HAL provides a stream of far field audio input to the client | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need to create the overview doc and this needs to be also included there. There's a template for that -> https://rdkcentral.github.io/rdk-halif-aidl/0.10.0/standards/interface_template/ |
||
| * upon detection of a keyword in the audio stream. Following detection of the keyword, | ||
| * the HAL detects a voice command in the stream and reports it's occurrence to the client. | ||
| * This stream is referred to as the Keyword channel. | ||
| * | ||
| * The Far Field Voice HAL may optionally provide a second stream of audio to the client | ||
| * that is continual in nature. There is no keyword or voice command detection. A typical | ||
| * use is for a VOIP application. This stream is referred to as the Continual channel. | ||
| * | ||
| * Multiple clients may obtain information from the service but only one client at a time | ||
| * may control the service. | ||
| */ | ||
|
|
||
| @VintfStability | ||
| interface IFarFieldVoice | ||
| { | ||
| /** | ||
| * Get the capabilities of the Far Field Voice service. | ||
| * | ||
| * @returns Capabilities parcelable. | ||
| */ | ||
| Capabilities getCapabilities(); | ||
|
|
||
| /** | ||
| * Gets the current state of the Far Field Voice service. | ||
| * | ||
| * @returns State enum value. | ||
| * | ||
| * @see IFarFieldVoiceEventListener.onStateChanged(). | ||
| */ | ||
| State getState(); | ||
|
|
||
| /** | ||
| * Get the current status of the Far Field Voice service. | ||
| * | ||
| * @returns Status parcelable. | ||
| */ | ||
| Status getStatus(); | ||
|
|
||
| /** | ||
| * Register a Far Field Voice event listener. | ||
| * | ||
| * An `IFarFieldVoiceEventListener` can only be registered once and will fail on subsequent | ||
| * registration attempts. | ||
| * | ||
| * The listener is notified when a Far Field Voice event occurs. | ||
| * | ||
| * @param[in] listener Listener object for callbacks. | ||
| * | ||
| * @return boolean | ||
| * @retval true The event listener was registered. | ||
| * @retval false The event listener is already registered. | ||
| * | ||
| * @see unregisterEventListener() | ||
| */ | ||
| boolean registerEventListener(in IFarFieldVoiceEventListener listener); | ||
|
|
||
| /** | ||
| * Unregister a Far Field Voice event listener. | ||
| * | ||
| * @param[in] listener Listener object for callbacks. | ||
| * | ||
| * @return boolean | ||
| * @retval true The event listener was unregistered. | ||
| * @retval false The event listener was not found registered. | ||
| * | ||
| * @see registerEventListener() | ||
| */ | ||
| boolean unregisterEventListener(in IFarFieldVoiceEventListener listener); | ||
|
|
||
| /** | ||
| * Open the Far Field Voice service. | ||
| * | ||
| * If successful, the Far Field Voice service transitions to an `OPENING` | ||
| * state and then a `READY` state which is notified to any registered | ||
| * `IFarFieldVoiceEventListener` interface. | ||
| * | ||
| * Controller related callbacks are made through the `IFarFieldVoiceControllerListener` | ||
| * passed into the call. | ||
| * | ||
| * The returned `IFarFieldVoiceController` interface is used by the client | ||
| * to configure and control voice processing. There can only be one client | ||
| * in control of voice processing. | ||
| * | ||
| * If the client that opened the `IFarFieldVoiceController` crashes, | ||
| * then `close()` is implicitly called to perform clean up. | ||
| * | ||
| * @pre Resource is in State::CLOSED state. | ||
| * | ||
| * @param[in] controllerListener Listener object for controller callbacks. | ||
| * | ||
| * @exception binder::Status EX_ILLEGAL_STATE | ||
| * | ||
| * @returns IFarFieldVoiceController or null if not in the CLOSED state. | ||
| * | ||
| * @see IFarFieldVoiceController, close(), registerEventListener() | ||
| */ | ||
| @nullable IFarFieldVoiceController open(in IFarFieldVoiceControllerListener controllerListener); | ||
|
|
||
| /** | ||
| * Close the Far Field Voice service. | ||
| * | ||
| * The Far Field Voice service must be in a `READY` state before it can be | ||
| * closed. If successful the Far Field Voice service transitions to a | ||
| * `CLOSING` state and then a `CLOSED` state. | ||
| * `onStateChanged(CLOSING, CLOSED)` will be notified on any registered | ||
| * listener interface. | ||
| * | ||
| * @pre Resource is in State::READY state. | ||
| * | ||
| * @param[in] controller Instance of IFarFieldVoiceController returned by open(). | ||
| * | ||
| * @return boolean | ||
| * @retval true Successfully closed. | ||
| * @retval false Invalid state or unrecognised parameter. | ||
| * | ||
| * @see open() | ||
| */ | ||
| boolean close(in IFarFieldVoiceController controller); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there caps missing? You've got more in your hfp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will investigate. Noise reduction settings should not be visible to the middleware.