Skip to content

Commit

Permalink
copier: add support for windows driver
Browse files Browse the repository at this point in the history
Windows driver always set sample type of MSB for 24/32 format but SOF FW
supports 24/32 LSB type for non-copier modules. So FW will convert the
input MSB 24/32 to LSB 24/32 and process it and convert it back to MSB
24/32 when exiting gtw.

Signed-off-by: Rander Wang <[email protected]>
  • Loading branch information
RanderWang committed Nov 8, 2023
1 parent 49377e8 commit f8e8c78
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/audio/copier/copier_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,25 @@ pcm_converter_func get_converter_func(const struct ipc4_audio_format *in_fmt,
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;
if (type == ipc4_gtw_host)
in_valid = SOF_IPC_FRAME_S24_4LE_MSB;

if (out_fmt->s_type == IPC4_TYPE_MSB_INTEGER && out_valid == SOF_IPC_FRAME_S24_4LE) {
switch (type) {
case ipc4_gtw_host:
if (dir == ipc4_capture)
out_valid = SOF_IPC_FRAME_S24_4LE_MSB;
break;
case ipc4_gtw_alh:
case ipc4_gtw_link:
case ipc4_gtw_ssp:
if (dir == ipc4_playback)
out_valid = SOF_IPC_FRAME_S24_4LE_MSB;
break;
default:
break;
}
}

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

0 comments on commit f8e8c78

Please sign in to comment.