in Function esp_periph_send_event, audio_event_iface_msg_t msg is created on the stack, and then call XQueueSend to send the message.
My understanding is XQueueSend in freertos will not copy the item to queue, because item is only void * and no size is given.
So after esp_periph_send_event is called, the local variable msg will be destroyed.
I am trying to use the audio event and figured out, that there could be some memory issues in
esp_peripherals.c
:https://github.com/espressif/esp-adf/blob/49f80aafefc31642ea98db78bf024e18688b8de9/components/esp_peripherals/esp_peripherals.c#L383-L394
in Function
esp_periph_send_event
,audio_event_iface_msg_t msg
is created on the stack, and then callXQueueSend
to send the message. My understanding isXQueueSend
in freertos will not copy the item to queue, because item is onlyvoid *
and no size is given. So afteresp_periph_send_event
is called, the local variablemsg
will be destroyed.Therefore I can not understand, how I can get an valid event using
audio_event_iface_listen
in main loop, which is shown in some examples like https://github.com/espressif/esp-adf/blob/49f80aafefc31642ea98db78bf024e18688b8de9/examples/advanced_examples/flexible_pipeline/main/flexible_example_main.c#L149