how can I transfer audio data from ISR to a task using queues on my STM32F401 with FreeRTOS?

So guys please how can I efficiently transfer 433-byte audio data from an ISR to a task using queues on my STM32F401 with FreeRTOS? Because the ISR frequency is causing data loss, resulting in noisy audio recordings. Any alternatives to ensure a smooth data transfer? @Middleware & OS @MCU, MPU & Firmware
attachment 0
Solution:
Do you have compression techniques in place to try to reduce the size of data to be transferred? Also Check Queue Fullness Before ISR Data Transfer. That's within your ISR, before adding data to the queue, check for available space using xQueueCanSendFromISR(yourQueueHandle). If the queue is full, handle overflow: Drop Data (least desirable): Discard the current data packet (not ideal for audio quality). Signal Task: Set a flag or send a notification to the task indicating dropped data so it can potentially handle the issue ...
Jump to solution
5 Replies
Joseph Ogbonna
Joseph Ogbonna7mo ago
To efficiently transfer 433-byte audio data from an ISR to a task using queues on your STM32F401 with FreeRTOS: Optimize ISR frequency Increase queue size Use a circular buffer DMA transfer Task prioritization ISR-to-task notification These are steps you can take
Solution
Priyanka Singh
Priyanka Singh7mo ago
Do you have compression techniques in place to try to reduce the size of data to be transferred? Also Check Queue Fullness Before ISR Data Transfer. That's within your ISR, before adding data to the queue, check for available space using xQueueCanSendFromISR(yourQueueHandle). If the queue is full, handle overflow: Drop Data (least desirable): Discard the current data packet (not ideal for audio quality). Signal Task: Set a flag or send a notification to the task indicating dropped data so it can potentially handle the issue You can also use xQueueSendFromISR Safely: Employ xQueueSendFromISR within the ISR to enqueue data. This function disables interrupts temporarily for safe queue access. Hope this helps. Please share more details about your existing implementation in case you need more help
Marvee Amasi
Marvee Amasi7mo ago
@Priyanka Singh I couldn't reduce the size of data , because I ready don't know compression techniques to use
abhishek awasthi
so one can use pcma, pcmu or opus if there is no compression at all .. if you are already getting these streams .. then one can think to implement aac ...
Marvee Amasi
Marvee Amasi7mo ago
Advanced Audio Coding? Yh I should use these , thanks
Want results from more Discord servers?
Add your server