-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some improvement to adc_continuous and i2s_common (IDFGH-11855) #12944
base: master
Are you sure you want to change the base?
Conversation
👋 Hello mcapdeville, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
b020b93
to
6704419
Compare
components/hal/adc_hal.c
Outdated
@@ -10,6 +10,7 @@ | |||
#include "hal/assert.h" | |||
#include "soc/lldesc.h" | |||
#include "soc/soc_caps.h" | |||
#include "esp_log.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't allow to use "esp_log.h" in the hal component, instead, we suggest using "hal/log.h" in the hal.
6704419
to
5e6a1e5
Compare
Hi @mcapdeville , thanks for your contribution! I have one question, why we should clear the i2s tx buffer before callback? Some use cases would like to read back these sent data to check the data latency, clearing before callback will break these cases. Another concern is that the pointer change of |
Hi,
In my application, I directly fill dma buffers in the callback function. I 'm trying to avoid unnecessary recopy of data by passing the buffer's pointer to the encoding function. If ther is no data to be sent, the output datas are allready zeroed.
I think, it is more practical the the event struct contain the pointer to the dma buffer and size of the buffer instead of a pointer on the pointer to the dma buffer. Regards. Marc |
sha=5e6a1e5aee8a446670f291d048ae24abf491f456 |
Hi @mcapdeville, the sequence of buffer clear and callback may need more discussion. If you want to copy data into the TX DMA buffer directly in the callback, you can just disable the And if the As for the DMA buffer, indeed the first level pointer would be more practical, this should be worth a breaking change |
Just a user story: In my implementation I have an additional function that's avoid copying and the Original is unpatches... This could be a way around possible breaking changes, find problems, learn more user stories and avoid that users needs to implement it again and again... |
722c306
to
3dc4aad
Compare
Whithout this patch, compilling for ESP32s3 with power management enabled lead to a 'dangerous relocation error' in sleep_modes.c at esp_wake_stub_entry function. Normally, literals variable are embeded just before the entry point of the function, but esp_wake_stub_entry is at start of rtc_ram. So add a jump over at the start of the function, and place the literals before code.
It seams that hal_utils_calc_clk_div_frac_accurate() do not get as accurate sampling frequency as the hal_utils_calc_clk_div_frac_fast(). This is needed if you want accurate non standard sampling frequencies (ex : 52800Hz)
This configuration option is added to desactivate work around for PDM TX clock on V2 HW. If you needed accurate sampling frequencies, say no.
Add I2S_CLK_SRC_PLL_D2 = SOC_MOD_CLK_PLL_D2 clock source to i2s driver.
Whith this, you could specify a zero size ringbuffer in adc_continuous_handle_cfg_t.max_store_buffer_size. This is useful for direct dma buffer access to avoid useless recopy of data.
This is to achieve good rounded clock value.
Add a configuration option to set the number of DMA buffers used by adc_continuous driver
3dc4aad
to
c0c6921
Compare
Hi,
This is somme proposed little improvement to adc and i2s driver.
In adc continuous driver, it(s not always a good idea to use ringbuffer. to avoid unnecessary copying of data. The first patch allow disabling ringbuff by setting max_store_buf_sieze member of adc_continuous_handle_cfg_t structure to 0.
The second patch resolve some rounding problem in adc_hal_digi_sample_freq_config
The third patch is for
Marc