audio_pipeline_get_event_iface() is missing implementation

felixcollins
Posts: 125
Joined: Fri May 24, 2019 2:02 am

audio_pipeline_get_event_iface() is missing implementation

Postby felixcollins » Mon Aug 29, 2022 2:42 am

Hi All,
I'm trying to understand how to insert my own events into the audio event interface system of the ADF. As far as I can tell I need to call audio_event_iface_sendout() passing in the msg to send and the event interface to send it to. I think I need to send it to the event interface of the audio pipeline. I should be able to get this by calling audio_pipeline_get_event_iface(). However, audio_pipeline_get_event_iface does not seem to be implemented. It is declared in the header but no implementation is found at link time.

Linker reports "undefined reference to `audio_pipeline_get_event_iface'"

Some code fragments that show roughly what I'm doing.

Code: Select all

	ESP_ERROR_CHECK(audio_pipeline_set_listener(my_pipeline_handle, my_audio_event_interface_handle));
	my_pipeline_event_interface_handle = audio_pipeline_get_event_iface(my_pipeline_handle); // Where is this???
	
	audio_event_iface_msg_t msg =
			{
					.source_type = MY_CUSTOM_SOURCE,
					.cmd = MY_CUSTOM_COMMAND,
					.data = (void *)some_data};

	ESP_ERROR_CHECK(audio_event_iface_sendout(my_pipeline_event_interface_handle, &msg));
	
	audio_event_iface_msg_t msg;
	if (ESP_OK != audio_event_iface_listen(audio_event_interface_handle, &msg, portMAX_DELAY))
	{
		ESP_LOGE(TAG, "Failed getting message from music queue");
	}

	ESP_LOGI(TAG, "Got message: %s, In state: %s", message_name(msg.cmd), state_name(music_state));

Is this a bug? How should I work around this?

felixcollins
Posts: 125
Joined: Fri May 24, 2019 2:02 am

Re: audio_pipeline_get_event_iface() is missing implementation

Postby felixcollins » Mon Aug 29, 2022 4:46 am

Is this what the implementation would be?

Code: Select all

audio_event_iface_handle_t audio_pipeline_get_event_iface(audio_pipeline_handle_t pipeline_handle)
{
	return (pipeline_handle->listener);
}

Who is online

Users browsing this forum: No registered users and 53 guests