Skip to content

Commit

Permalink
Merge pull request #74 from xmos/xmos_v1.25.0.2
Browse files Browse the repository at this point in the history
Xmos v1.25.0.2
  • Loading branch information
lucianomartin committed Apr 13, 2022
2 parents cd07f5a + b79a4f5 commit 0e82709
Show file tree
Hide file tree
Showing 14 changed files with 818 additions and 103 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@
### Version 1.25.0 - August 23 2021
Feature enhancements, updates, and resolved issues from all releases are available on the [Amazon developer portal](https://developer.amazon.com/docs/alexa/avs-device-sdk/release-notes.html)

**XMOS-only change** - version 0: add support for KWD using GPIO INT_N pin. This will be an alternative to using the Sensory KWD.
**XMOS-only change** - version 0:

* add support for KWD using GPIO INT_N pin. This will be an alternative to using the Sensory KWD.

**XMOS-only change** - version 1:

* update links in README file.

**XMOS-only change** - version 2:

* add support for KWD using HID event. This will be an alternative to using the Sensory KWD with UA device.
* add mechanism to retrieve WW indexes for HID and GPIO KWD's

### Version 1.24.0 - June 1 2021
Feature enhancements, updates, and resolved issues from all releases are available on the [Amazon developer portal](https://developer.amazon.com/docs/alexa/avs-device-sdk/release-notes.html)
Expand Down
3 changes: 3 additions & 0 deletions KWD/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ endif()
if(SENSORY_KEY_WORD_DETECTOR)
add_subdirectory("Sensory")
endif()
if(HID_KEY_WORD_DETECTOR)
add_subdirectory("HID")
endif()
if(GPIO_KEY_WORD_DETECTOR)
add_subdirectory("GPIO")
endif()
Expand Down
21 changes: 12 additions & 9 deletions KWD/GPIO/include/GPIO/GPIOKeywordDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ class GPIOKeywordDetector : public AbstractKeywordDetector {
* @param audioFormat The format of the audio data located within the stream.
* @param keyWordObservers The observers to notify of keyword detections.
* @param keyWordDetectorStateObservers The observers to notify of state changes in the engine.
* @param msToPushPerIteration The amount of data in milliseconds to push to GPIO WW at a time. Smaller sizes will
* lead to less delay but more CPU usage. Additionally, larger amounts of data fed into the engine per iteration
* might lead longer delays before receiving keyword detection events. This has been defaulted to 10 milliseconds
* as it is a good trade off between CPU usage and recognition delay. Additionally, this was the amount used by
* @param msToPushPerIteration The amount of data in milliseconds to push to the cloud at a time. This was the amount used by
* Sensory in example code.
* @return A new @c GPIOKeywordDetector, or @c nullptr if the operation failed.
*/
Expand All @@ -77,10 +74,8 @@ class GPIOKeywordDetector : public AbstractKeywordDetector {
* @param audioFormat The format of the audio data located within the stream.
* @param keyWordObservers The observers to notify of keyword detections.
* @param keyWordDetectorStateObservers The observers to notify of state changes in the engine.
* @param msToPushPerIteration The amount of data in milliseconds to push to GPIO WW at a time. Smaller sizes will
* lead to less delay but more CPU usage. Additionally, larger amounts of data fed into the engine per iteration
* might lead longer delays before receiving keyword detection events. This has been defaulted to 10 milliseconds
* as it is a good trade off between CPU usage and recognition delay.
* @param msToPushPerIteration The amount of data in milliseconds to push to the cloud at a time. This was the amount used by
* Sensory in example code.
*/
GPIOKeywordDetector(
std::shared_ptr<AudioInputStream> stream,
Expand All @@ -99,6 +94,8 @@ class GPIOKeywordDetector : public AbstractKeywordDetector {

/// The main function that reads data and feeds it into the engine.
void detectionLoop();
/// The main function that reads data and feeds it into the engine.
void readAudioLoop();

/// Indicates whether the internal main loop should keep running.
std::atomic<bool> m_isShuttingDown;
Expand All @@ -115,7 +112,13 @@ class GPIOKeywordDetector : public AbstractKeywordDetector {
*/
avsCommon::avs::AudioInputStream::Index m_beginIndexOfStreamReader;

/// Internal thread that monitors GPIO.
/// The file descriptor to access I2C port
int m_fileDescriptor;

/// Internal thread that read audio samples
std::thread m_readAudioThread;

/// Internal thread that monitors GPIO pin.
std::thread m_detectionThread;

/**
Expand Down
Loading

0 comments on commit 0e82709

Please sign in to comment.