Feeding mic data: tud_audio_tx_done_post_load_cb better than _pre_ ? #2094
Replies: 5 comments
-
Had a better look at the audio_4_channel_mic example. Here the data are prepared in the post_load callback, then written in pre_load. Again, beware of the UAC headset example when MCU is not very fast. https://github.com/alberto-grl/TinyUSB_UAC_CDC_411 Alberto |
Beta Was this translation helpful? Give feedback.
-
No, it's just an example of available callbacks.
In fact I always get better results putting |
Beta Was this translation helpful? Give feedback.
-
Thanks, it is clear now. I'm testing with a delay as a quick way to guess how big is the CPU load. Regards |
Beta Was this translation helpful? Give feedback.
-
@alberto-grl it's welcomed if you willing to contribute. We are a group of hobbyists who spend spared time on it while we don't have much. The project is evolving and every user's skill level is different, it's hard to come out an overkill solution. |
Beta Was this translation helpful? Give feedback.
-
Unfortunately my understanding of TinyUSB is basic at best, I'm just trying to mix and match information scattered all around. Regards Alberto |
Beta Was this translation helpful? Give feedback.
-
I'm trying to develop a working composite audio + CDC. On a STM32H723 it seemed I had good results.
Then I did the same on an F411, 98 MHz. It barely works and only when compiled with maximum optimization, -O3, and then a delay of 100 us in the main loop is enough to crash audio.
Then I disabled the loopback copy of speaker to mic of the example and fed data to
tud_audio_tx_done_pre_cb
, as suggested in the code comments. Even this needs a fast main loop. I'm calculating my data inside the pre_load_cb, it should be better to pass a pointer to a precalculated buffer I guess.Anyway if I fill mic_buf in
tud_audio_tx_done_post_cb
instead of pre then it can bear a reasonable delay in the main loop, like 500 us.The CDC part shouldn't be relevant. I tested without the cdc_task.
Unfortunately there is no example of something like a .wav player on mic.
Regards
Alberto
Beta Was this translation helpful? Give feedback.
All reactions