Skip to content

Commit

Permalink
copier: adjust valid format based on sample type
Browse files Browse the repository at this point in the history
Adjust valid format in copier for some types of dai gateway which
need to use MSB type.

Currently sample type only affect the copier module so we don't do
it in audio_stream_fmt_conversion.

Signed-off-by: Rander Wang <[email protected]>
(cherry picked from commit 65b2e0b)
  • Loading branch information
RanderWang authored and kv2019i committed Sep 7, 2023
1 parent 2935d98 commit 2d834e9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/audio/copier/copier_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ pcm_converter_func get_converter_func(const struct ipc4_audio_format *in_fmt,
audio_stream_fmt_conversion(out_fmt->depth, out_fmt->valid_bit_depth, &out, &out_valid,
out_fmt->s_type);

if (in_fmt->s_type == IPC4_TYPE_MSB_INTEGER && in_valid == SOF_IPC_FRAME_S24_4LE)
in_valid = SOF_IPC_FRAME_S24_4LE_MSB;
if (out_fmt->s_type == IPC4_TYPE_MSB_INTEGER && out_valid == SOF_IPC_FRAME_S24_4LE)
out_valid = SOF_IPC_FRAME_S24_4LE_MSB;

/* check container & sample size */
if (use_no_container_convert_function(in, in_valid, out, out_valid))
return pcm_get_conversion_function(in, out);
Expand Down

0 comments on commit 2d834e9

Please sign in to comment.