i2s_test: fix unsupported sample rate on h2

This commit is contained in:
laokaiyao 2023-02-22 19:44:15 +08:00
parent 53658e56d6
commit 71905d9cbf
7 changed files with 14 additions and 16 deletions

View File

@ -19,10 +19,7 @@ components/driver/test_apps/i2s_test_apps:
components/driver/test_apps/i2s_test_apps/i2s: components/driver/test_apps/i2s_test_apps/i2s:
disable: disable:
- if: SOC_I2S_SUPPORTED != 1 - if: SOC_I2S_SUPPORTED != 1
disable_test:
- if: IDF_TARGET in ["esp32h2"]
temporary: true
reason: Cannot pass test, see IDF-6811
components/driver/test_apps/i2s_test_apps/i2s_tdm: components/driver/test_apps/i2s_test_apps/i2s_tdm:
disable: disable:
- if: SOC_I2S_SUPPORTS_TDM != 1 - if: SOC_I2S_SUPPORTS_TDM != 1
@ -34,10 +31,6 @@ components/driver/test_apps/i2s_test_apps/legacy_i2s_adc_dac:
components/driver/test_apps/i2s_test_apps/legacy_i2s_driver: components/driver/test_apps/i2s_test_apps/legacy_i2s_driver:
disable: disable:
- if: SOC_I2S_SUPPORTED != 1 - if: SOC_I2S_SUPPORTED != 1
disable_test:
- if: IDF_TARGET in ["esp32h2"]
temporary: true
reason: cannot pass test IDF-6811
components/driver/test_apps/ledc: components/driver/test_apps/ledc:
disable: disable:

View File

@ -749,11 +749,15 @@ static void i2s_test_common_sample_rate(i2s_chan_handle_t rx_chan, i2s_std_clk_c
/* Test common sample rate /* Test common sample rate
* Workaround: set 12000 as 12001 to bypass the unknown failure, TODO: IDF-6705 */ * Workaround: set 12000 as 12001 to bypass the unknown failure, TODO: IDF-6705 */
const uint32_t test_freq[] = { const uint32_t test_freq[] = {
8000, 10000, 11025, 12001, 16000, 22050, 8000, 10001, 11025, 12001, 16000, 22050,
24000, 32000, 44100, 48000, 64000, 88200, 24000, 32000, 44100, 48000, 64000, 88200,
96000, 128000,144000,196000}; 96000, 128000,144000,196000};
int real_pulse = 0; int real_pulse = 0;
int case_cnt = sizeof(test_freq) / sizeof(uint32_t); int case_cnt = sizeof(test_freq) / sizeof(uint32_t);
#if SOC_I2S_SUPPORTS_PLL_F96M
// 196000 Hz sample rate doesn't support on PLL_96M target
case_cnt = 15;
#endif
#if SOC_I2S_SUPPORTS_XTAL #if SOC_I2S_SUPPORTS_XTAL
// Can't support a very high sample rate while using XTAL as clock source // Can't support a very high sample rate while using XTAL as clock source
if (clk_cfg->clk_src == I2S_CLK_SRC_XTAL) { if (clk_cfg->clk_src == I2S_CLK_SRC_XTAL) {

View File

@ -10,7 +10,7 @@ from pytest_embedded import Dut
@pytest.mark.esp32c3 @pytest.mark.esp32c3
@pytest.mark.esp32c6 @pytest.mark.esp32c6
@pytest.mark.esp32s3 @pytest.mark.esp32s3
# @pytest.mark.esp32h2 IDF-6811 @pytest.mark.esp32h2
@pytest.mark.generic @pytest.mark.generic
@pytest.mark.parametrize( @pytest.mark.parametrize(
'config', 'config',

View File

@ -888,6 +888,11 @@ static void i2s_test_common_sample_rate(i2s_port_t id)
int case_cnt = sizeof(test_freq) / sizeof(uint32_t); int case_cnt = sizeof(test_freq) / sizeof(uint32_t);
#endif #endif
#if SOC_I2S_SUPPORTS_PLL_F96M
// 196000 Hz sample rate doesn't support on PLL_96M target
case_cnt = 15;
#endif
// Acquire the PM lock incase Dynamic Frequency Scaling(DFS) lower the frequency // Acquire the PM lock incase Dynamic Frequency Scaling(DFS) lower the frequency
#ifdef CONFIG_PM_ENABLE #ifdef CONFIG_PM_ENABLE
esp_pm_lock_handle_t pm_lock; esp_pm_lock_handle_t pm_lock;

View File

@ -10,7 +10,7 @@ from pytest_embedded import Dut
@pytest.mark.esp32c3 @pytest.mark.esp32c3
@pytest.mark.esp32s3 @pytest.mark.esp32s3
@pytest.mark.esp32c6 @pytest.mark.esp32c6
# @pytest.mark.esp32h2 IDF-6811 @pytest.mark.esp32h2
@pytest.mark.generic @pytest.mark.generic
@pytest.mark.parametrize( @pytest.mark.parametrize(
'config', 'config',

View File

@ -57,10 +57,6 @@ examples/peripherals/i2s/i2s_codec/i2s_es7210_tdm:
disable: disable:
- if: SOC_I2S_SUPPORTS_TDM != 1 or (SOC_I2C_SUPPORTED != 1 or SOC_GPSPI_SUPPORTED != 1) - if: SOC_I2S_SUPPORTS_TDM != 1 or (SOC_I2C_SUPPORTED != 1 or SOC_GPSPI_SUPPORTED != 1)
reason: rely on I2S TDM mode to receive audio, I2C to config es7210 and SPI to save audio to SD card reason: rely on I2S TDM mode to receive audio, I2C to config es7210 and SPI to save audio to SD card
disable_test:
- if: IDF_TARGET in ["esp32h2"]
temporary: true
reason: cannot pass target test IDF-6811
examples/peripherals/i2s/i2s_codec/i2s_es8311: examples/peripherals/i2s/i2s_codec/i2s_es8311:
disable: disable:

View File

@ -7,7 +7,7 @@ from pytest_embedded import Dut
@pytest.mark.esp32s3 @pytest.mark.esp32s3
@pytest.mark.esp32c3 @pytest.mark.esp32c3
@pytest.mark.esp32c6 @pytest.mark.esp32c6
# @pytest.mark.esp32h2 IDF-6264 @pytest.mark.esp32h2
@pytest.mark.generic @pytest.mark.generic
def test_i2s_es7210_tdm_example(dut: Dut) -> None: def test_i2s_es7210_tdm_example(dut: Dut) -> None:
dut.expect_exact('example: Create I2S receive channel') dut.expect_exact('example: Create I2S receive channel')