Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions src/audio/dai-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1469,32 +1469,33 @@ int dai_zephyr_multi_endpoint_copy(struct dai_data **dd, struct comp_dev *dev,
static void set_new_local_buffer(struct dai_data *dd, struct comp_dev *dev)
{
struct comp_buffer __sparse_cache *dma_buf = buffer_acquire(dd->dma_buffer);
struct comp_buffer __sparse_cache *local_buf;
struct comp_buffer __sparse_cache *local_buf_c;
struct comp_buffer *local_buf;
uint32_t dma_fmt = audio_stream_get_frm_fmt(&dma_buf->stream);
uint32_t local_fmt;

buffer_release(dma_buf);

if (dev->direction == SOF_IPC_STREAM_PLAYBACK)
dd->local_buffer = list_first_item(&dev->bsource_list,
struct comp_buffer,
sink_list);
local_buf = list_first_item(&dev->bsource_list,
struct comp_buffer,
sink_list);
else
dd->local_buffer = list_first_item(&dev->bsink_list,
struct comp_buffer,
source_list);
local_buf = list_first_item(&dev->bsink_list,
struct comp_buffer,
source_list);

local_buf = buffer_acquire(dd->local_buffer);
local_fmt = audio_stream_get_frm_fmt(&local_buf->stream);
buffer_release(local_buf);
local_buf_c = buffer_acquire(local_buf);
local_fmt = audio_stream_get_frm_fmt(&local_buf_c->stream);
buffer_release(local_buf_c);

dd->process = pcm_get_conversion_function(local_fmt, dma_fmt);

if (!dd->process) {
if (dd->process)
dd->local_buffer = local_buf;
else
comp_err(dev, "converter function NULL: local fmt %d dma fmt %d\n",
local_fmt, dma_fmt);
dd->local_buffer = NULL;
}
}

/* copy and process stream data from source to sink buffers */
Expand Down