espressif / esp-adf

Espressif Audio Development Framework
Other
1.49k stars 667 forks source link

i2s_stream: do not unconditionally install I2S driver (AUD-5119) #1130

Open stintel opened 6 months ago

stintel commented 6 months ago

Initializing an I2S stream currently unconditionally installs the I2S driver. When two I2S streams are needed, one for input and one for output, the following error occurs during initialization of the second stream:

E (21:53:24.782) i2s(legacy): i2s_check_cfg_validity(926): this i2s port is in use E (21:53:24.791) i2s(legacy): i2s_driver_install(1582): I2S configuration is invalid

While these error messages are completely harmless, we keep getting downstream reports from people who think this is a problem. We have considered disabling logging for the legacy I2S driver, but that could lead to valid errors being suppressed.

Instead, add a new member to the i2s_stream_cfg_t struct that makes it possible to skip installing the I2S driver. It is added as true to all the macros, to not impact existing code.

jason-mao commented 5 months ago

@stintel I2S stream supports the new I2S driver on a32e66e4d7d6ead511c9be7e8adfd69bc56ab3c7, I think it can fix your issue, please test.