Skip to content

Commit

Permalink
Merge branch 'feat/update_afe' into 'master'
Browse files Browse the repository at this point in the history
Feat/update afe

See merge request speech-recognition-framework/esp-skainet!47
  • Loading branch information
sun-xiangyu committed Feb 17, 2025
2 parents a7fdf56 + 2ef6d82 commit da9f47f
Show file tree
Hide file tree
Showing 74 changed files with 1,187 additions and 13,838 deletions.
18 changes: 9 additions & 9 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ variables:
BATCH_BUILD: "1"
V: "0"
IDF_CI_BUILD: "1"
DOCKER_TARGET_TEST_v5_0_ENV_IMAGE: "$CI_DOCKER_REGISTRY/target-test-env-v5.0:3"
DOCKER_TARGET_TEST_v5_3_ENV_IMAGE: "espressif/idf:release-v5.3"

before_script:
# add gitlab ssh key
Expand Down Expand Up @@ -67,7 +67,7 @@ before_script:
- *build_test_script

.test_template: &test_template
image: DOCKER_TARGET_TEST_v5_0_ENV_IMAGE
image: DOCKER_TARGET_TEST_v5_3_ENV_IMAGE
stage: target_test
timeout: 10 hour
variables:
Expand Down Expand Up @@ -114,9 +114,9 @@ build_idf_v5.3:
extends: .build_examples_template
image: espressif/idf:release-v5.3

build_idf_v5.0:
extends: .build_examples_template
image: espressif/idf:release-v5.0
# build_idf_v5.4:
# extends: .build_examples_template
# image: espressif/idf:release-v5.4

# Rules to trigger wakenet test
.rules:test:test_wakenet:
Expand All @@ -129,7 +129,7 @@ build_wakenet_test:
extends:
- .build_test_template
- .rules:test:test_wakenet
image: espressif/idf:release-v5.0
image: espressif/idf:release-v5.3
variables:
EXAMPLES_PATH: "test/wakenet"

Expand All @@ -143,12 +143,12 @@ test_wakenet:
optional: true
tags:
- 'korvo-2'
image: $DOCKER_TARGET_TEST_v5_0_ENV_IMAGE
image: $DOCKER_TARGET_TEST_v5_3_ENV_IMAGE
variables:
TEST_TARGET: 'esp32s3'
TEST_FOLDER: './test/wakenet'
TEST_ENV: 'korvo-2'
IDF_VERSION: "5.0"
IDF_VERSION: "5.3"
parallel:
matrix:
- MODEL: ["hilexin", "hiesp"]
Expand Down Expand Up @@ -211,7 +211,7 @@ build_multinet_test:
optional: true
tags:
- 'korvo-2'
image: $DOCKER_TARGET_TEST_v5_0_ENV_IMAGE
image: $DOCKER_TARGET_TEST_v5_3_ENV_IMAGE
variables:
TEST_TARGET: 'esp32s3'
TEST_ENV: 'korvo-2'
Expand Down
5 changes: 5 additions & 0 deletions components/hardware_driver/boards/esp32-korvo/bsp_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,11 @@ int bsp_get_feed_channel(void)
return ADC_I2S_CHANNEL;
}

char* bsp_get_input_format(void)
{
return "MRNN";
}

esp_err_t bsp_board_init(uint32_t sample_rate, int channel_format, int bits_per_chan)
{
/*!< Initialize I2C bus, used for audio codec*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,11 @@ int bsp_get_feed_channel(void)
return ADC_I2S_CHANNEL;
}

char* bsp_get_input_format(void)
{
return "RMNM";
}

static void bsp_enable_audio_board_power(void)
{
// Turn on the power for audio board, so it can go from "No Power" state to "Shutdown" state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ static esp_err_t bsp_i2s_init(i2s_port_t i2s_num, uint32_t sample_rate, int chan
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
i2s_slot_mode_t channel_fmt = I2S_SLOT_MODE_STEREO;
if (channel_format != 2) {
ESP_LOGE(TAG, "Unable to configure channel_format %d", channel_format);
ESP_LOGW(TAG, "Unable to configure channel_format %d, reset to 2", channel_format);
channel_format = 2;
channel_fmt = I2S_SLOT_MODE_STEREO;
}

if (bits_per_chan != 16) {
ESP_LOGE(TAG, "Unable to configure bits_per_chan %d", bits_per_chan);
ESP_LOGW(TAG, "Unable to configure bits_per_chan %d, reset to 16 ", bits_per_chan);
bits_per_chan = 16;
}

Expand Down Expand Up @@ -271,6 +271,11 @@ int bsp_get_feed_channel(void)
return ADC_I2S_CHANNEL;
}

char* bsp_get_input_format(void)
{
return "MR";
}

static void bsp_enable_audio_board_power(void)
{
// Turn on the power for audio board, so it can go from "No Power" state to "Shutdown" state
Expand Down
5 changes: 5 additions & 0 deletions components/hardware_driver/boards/esp32s3-box-3/bsp_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@ int bsp_get_feed_channel(void)
return ADC_I2S_CHANNEL;
}

char* bsp_get_input_format(void)
{
return "RMNM";
}

esp_err_t bsp_board_init(uint32_t sample_rate, int channel_format, int bits_per_chan)
{
/*!< Initialize I2C bus, used for audio codec*/
Expand Down
5 changes: 5 additions & 0 deletions components/hardware_driver/boards/esp32s3-box/bsp_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@ int bsp_get_feed_channel(void)
return ADC_I2S_CHANNEL;
}

char* bsp_get_input_format(void)
{
return "RMNM";
}

esp_err_t bsp_board_init(uint32_t sample_rate, int channel_format, int bits_per_chan)
{
/*!< Initialize I2C bus, used for audio codec*/
Expand Down
6 changes: 6 additions & 0 deletions components/hardware_driver/boards/esp32s3-eye/bsp_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ int bsp_get_feed_channel(void)
return ADC_I2S_CHANNEL;
}

char* bsp_get_input_format(void)
{
return "NM";
}


esp_err_t bsp_board_init(uint32_t sample_rate, int channel_format, int bits_per_chan)
{
bsp_i2s_init(I2S_NUM_1, 16000, 2, 32);
Expand Down
5 changes: 5 additions & 0 deletions components/hardware_driver/boards/esp32s3-korvo-1/bsp_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,11 @@ int bsp_get_feed_channel(void)
return ADC_I2S_CHANNEL;
}

char* bsp_get_input_format(void)
{
return "RMNM";
}

esp_err_t bsp_board_init(uint32_t sample_rate, int channel_format, int bits_per_chan)
{
/*!< Initialize I2C bus, used for audio codec*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ esp_err_t bsp_audio_play(const int16_t* data, int length, TickType_t ticks_to_wa
if (data_out != NULL) {
tmp_data = data_out;
} else {
tmp_data = data;
tmp_data = (int *)data;
}

for (int i = 0; i < out_length / (audio_time * sizeof(int)); i++) {
Expand Down Expand Up @@ -442,6 +442,11 @@ int bsp_get_feed_channel(void)
return ADC_I2S_CHANNEL;
}

char* bsp_get_input_format(void)
{
return "RMNM";
}

esp_err_t bsp_board_init(uint32_t sample_rate, int channel_format, int bits_per_chan)
{
/*!< Initialize I2C bus, used for audio codec*/
Expand Down
12 changes: 12 additions & 0 deletions components/hardware_driver/boards/include/bsp_board.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,20 @@ esp_err_t bsp_audio_play(const int16_t* data, int length, TickType_t ticks_to_wa
*/
esp_err_t bsp_get_feed_data(bool is_get_raw_channel, int16_t *buffer, int buffer_len);

/**
* @brief Get the record channel number.
*
* @return The record channel number.
*/
int bsp_get_feed_channel(void);

/**
* @brief Get the input format of the board.
*
* @return The input format of the board, like "MMR"
*/
char* bsp_get_input_format(void);

/**
* @brief Set play volume
*
Expand Down
5 changes: 5 additions & 0 deletions components/hardware_driver/esp_board_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ int esp_get_feed_channel(void)
return bsp_get_feed_channel();
}

char* esp_get_input_format(void)
{
return bsp_get_input_format();
}

esp_err_t esp_audio_play(const int16_t* data, int length, TickType_t ticks_to_wait)
{
return bsp_audio_play(data, length, ticks_to_wait);
Expand Down
2 changes: 2 additions & 0 deletions components/hardware_driver/include/esp_board_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ esp_err_t esp_get_feed_data(bool is_get_raw_channel, int16_t *buffer, int buffer

int esp_get_feed_channel(void);

char* esp_get_input_format(void);

/**
* @brief Set play volume
*
Expand Down
1 change: 1 addition & 0 deletions components/perf_tester/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set(requires
hardware_driver
player
console
esp-sr
)

idf_component_register(
Expand Down
10 changes: 5 additions & 5 deletions components/perf_tester/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## IDF Component Manager Manifest File
dependencies:
esp-sr:
version: ">=1.1.0,<2.0.0"
public: true
# ## IDF Component Manager Manifest File
# dependencies:
# esp-sr:
# version: ">=1.1.0,<2.0.0"
# public: true
Loading

0 comments on commit da9f47f

Please sign in to comment.