Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/audio/copier/copier_dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ __cold int copier_dai_create(struct comp_dev *dev, struct copier_data *cd,
dai.is_config_blob = true;
dai.sampling_frequency = copier->out_fmt.sampling_frequency;
dai.feature_mask = copier->copier_feature_mask;
dai.gtw_fmt = (dai.direction == SOF_IPC_STREAM_PLAYBACK) ?
&cd->config.out_fmt : &cd->config.base.audio_fmt;

switch (node_id.f.dma_type) {
case ipc4_hda_link_output_class:
Expand All @@ -303,7 +305,6 @@ __cold int copier_dai_create(struct comp_dev *dev, struct copier_data *cd,
comp_err(dev, "No ssp dma_config found in blob!");
return -EINVAL;
}
dai.out_fmt = &copier->out_fmt;
break;
case ipc4_alh_link_output_class:
case ipc4_alh_link_input_class:
Expand All @@ -330,7 +331,6 @@ __cold int copier_dai_create(struct comp_dev *dev, struct copier_data *cd,
comp_err(dev, "No dmic dma_config found in blob!");
return -EINVAL;
}
dai.out_fmt = &copier->out_fmt;
#if CONFIG_COPIER_GAIN
dai.apply_gain = true;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/audio/dai-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ __cold int dai_set_config(struct dai *dai, struct ipc_config_dai *common_config,
{
const struct device *dev = dai->dev;
const struct sof_ipc_dai_config *sof_cfg = spec_config;
struct dai_config cfg;
struct dai_config cfg = {0};
const void *cfg_params;
bool is_blob;

Expand Down
2 changes: 1 addition & 1 deletion src/include/sof/audio/ipc-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct ipc_config_dai {
*/
/**< DMA configs - required for ACE 2.0 and newer */
struct ipc_dma_config *host_dma_config[GTW_DMA_DEVICE_MAX_COUNT];
const struct ipc4_audio_format *out_fmt;/**< audio format for output pin 0 - required
const struct ipc4_audio_format *gtw_fmt;/**< audio format for gateway DMA data - required
* for ACE 2.0 and newer
*/
/* Gain feature flag */
Expand Down
8 changes: 4 additions & 4 deletions src/ipc/ipc4/dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void dai_set_link_hda_config(uint16_t *link_config,
const void *spec_config)
{
#if ACE_VERSION > ACE_VERSION_1_5
const struct ipc4_audio_format *out_fmt = common_config->out_fmt;
const struct ipc4_audio_format *gtw_fmt = common_config->gtw_fmt;
union hdalink_cfg link_cfg;

switch (common_config->type) {
Expand All @@ -49,14 +49,14 @@ void dai_set_link_hda_config(uint16_t *link_config,
break;
case SOF_DAI_INTEL_DMIC:
link_cfg.full = 0;
if (out_fmt->depth == IPC4_DEPTH_16BIT) {
if (gtw_fmt->depth == IPC4_DEPTH_16BIT) {
/* 16bit dmic packs two 16bit samples into single 32bit word
* fw needs to adjust channel count to match final sample
* group size
*/
link_cfg.part.hchan = (out_fmt->channels_count - 1) / 2;
link_cfg.part.hchan = (gtw_fmt->channels_count - 1) / 2;
} else {
link_cfg.part.hchan = out_fmt->channels_count - 1;
link_cfg.part.hchan = gtw_fmt->channels_count - 1;
}
link_cfg.part.stream = common_config->host_dma_config[0]->stream_id;
break;
Expand Down