Skip to content

Commit 6e32be7

Browse files
committed
Merge branch 'feature/wwe_add_p4_func_ev_support' into 'main'
feat(esp_ai_audio): Add esp32p4 function ev board support to example `wwe` See merge request adf/multimedia/esp-gmf!215
2 parents a552dae + a4a5cff commit 6e32be7

File tree

5 files changed

+80
-4
lines changed

5 files changed

+80
-4
lines changed

elements/gmf_ai_audio/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## v0.7.3
4+
5+
### Features
6+
7+
- Added default sdkconfig for esp32p4 in wwe example
8+
9+
### Bug Fixes
10+
11+
- Fixed build error for esp32p4
12+
313
## v0.7.2
414

515
### Features

elements/gmf_ai_audio/examples/wwe/main/main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#define BOARD_KORVO_2 (1)
4343
#define BOARD_XD_AIOT_C3 (2)
4444
#define BOARD_ESP_SPOT (3)
45+
#define BOARD_P4_FUN_EV (4)
4546

4647
#if defined CONFIG_IDF_TARGET_ESP32S3
4748
#define WITH_AFE (true)
@@ -55,6 +56,9 @@
5556
#elif defined CONFIG_IDF_TARGET_ESP32C5
5657
#define WITH_AFE (false)
5758
#define AUDIO_BOARD (BOARD_ESP_SPOT)
59+
#elif defined CONFIG_IDF_TARGET_ESP32P4
60+
#define WITH_AFE (true)
61+
#define AUDIO_BOARD (BOARD_P4_FUN_EV)
5862
#endif /* defined CONFIG_IDF_TARGET_ESP32S3 */
5963

6064
#if AUDIO_BOARD == BOARD_KORVO_2
@@ -78,6 +82,11 @@
7882
#define ADC_I2S_BITS (16)
7983
#define INPUT_CH_NUM (ADC_I2S_CH)
8084
#define INPUT_CH_BITS (ADC_I2S_BITS)
85+
#elif AUDIO_BOARD == BOARD_P4_FUN_EV
86+
#define ADC_I2S_CH (2)
87+
#define ADC_I2S_BITS (16)
88+
#define INPUT_CH_NUM (ADC_I2S_CH)
89+
#define INPUT_CH_BITS (ADC_I2S_BITS)
8190
#endif /* AUDIO_BOARD == BOARD_KORVO_2 */
8291

8392
#if WITH_AFE == true
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
2+
CONFIG_IDF_TARGET="esp32p4"
3+
CONFIG_IDF_TARGET_ESP32P4=y
4+
5+
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
6+
7+
#
8+
# Partition Table
9+
#
10+
CONFIG_PARTITION_TABLE_CUSTOM=y
11+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
12+
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
13+
# end of Partition Table
14+
15+
#
16+
# ESP Speech Recognition
17+
#
18+
CONFIG_MODEL_IN_FLASH=y
19+
CONFIG_AFE_INTERFACE_V1=y
20+
CONFIG_SR_NSN_WEBRTC=y
21+
CONFIG_SR_VADN_WEBRTC=y
22+
CONFIG_SR_WN_WN9S_HILEXIN=y
23+
CONFIG_SR_MN_CN_MULTINET7_QUANT=y
24+
CONFIG_SR_MN_EN_NONE=y
25+
# end of ESP Speech Recognition
26+
27+
#
28+
# ESP PSRAM
29+
#
30+
CONFIG_SPIRAM=y
31+
32+
#
33+
# PSRAM config
34+
#
35+
CONFIG_SPIRAM_MODE_HEX=y
36+
CONFIG_SPIRAM_SPEED_200M=y
37+
CONFIG_SPIRAM_SPEED=200
38+
CONFIG_SPIRAM_BOOT_INIT=y
39+
CONFIG_SPIRAM_USE_MALLOC=y
40+
CONFIG_SPIRAM_MEMTEST=y
41+
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384
42+
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768
43+
44+
#
45+
# GMF AI Audio
46+
#
47+
CONFIG_GMF_AI_AUDIO_INIT_AEC=y
48+
CONFIG_GMF_AI_AUDIO_INIT_AFE=y
49+
50+
CONFIG_GMF_AI_AUDIO_AFE_VAD_ENABLE=y
51+
CONFIG_GMF_AI_AUDIO_AFE_AEC_ENABLE=y
52+
CONFIG_GMF_AI_AUDIO_AEC_CH_ALLOCATION="MR"
53+
CONFIG_GMF_AI_AUDIO_AFE_CH_ALLOCATION="MR"
54+
55+
CONFIG_GMF_AI_AUDIO_WAKEUP_ENABLE=y
56+
CONFIG_GMF_AI_AUDIO_VOICE_COMMAND_ENABLE=y
57+
# end of GMF AI Audio
58+
59+
CONFIG_AUDIO_BOARD="ESP32_P4_DEV_V14"

elements/gmf_ai_audio/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "0.7.2"
1+
version: "0.7.3"
22
description: Espressif GMF AI Audio Elements Module
33
url: https://github.com/espressif/esp-gmf/tree/main/elements/gmf_ai_audio
44
documentation: "https://github.com/espressif/esp-gmf/blob/main/elements/gmf_ai_audio/README.md"

elements/gmf_ai_audio/src/esp_gmf_afe.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,7 @@ static void mn_afe_monitor(afe_fetch_result_t *result, void *user_ctx)
361361
esp_gmf_afe_vcmd_info_t vcmd_info = {
362362
.phrase_id = mn_result->phrase_id[0],
363363
.prob = mn_result->prob[0]};
364-
size_t max_copy = ESP_GMF_AFE_VCMD_MAX_LEN - 1;
365-
strncpy(vcmd_info.str, mn_result->string, max_copy);
366-
vcmd_info.str[max_copy] = '\0';
364+
strlcpy(vcmd_info.str, mn_result->string, sizeof(vcmd_info.str));
367365
event_2_user(gmf_afe, vcmd_info.phrase_id, &vcmd_info, sizeof(esp_gmf_afe_vcmd_info_t));
368366

369367
break;

0 commit comments

Comments
 (0)