|
10 | 10 | #include "sof-audio.h" |
11 | 11 | #include "sof-priv.h" |
12 | 12 | #include "sof-utils.h" |
| 13 | +#include "ops.h" |
13 | 14 |
|
14 | 15 | static void sof_set_transferred_bytes(struct sof_compr_stream *sstream, |
15 | 16 | u64 host_pos, u64 buffer_size) |
@@ -164,6 +165,7 @@ static int sof_compr_set_params(struct snd_soc_component *component, |
164 | 165 | struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component); |
165 | 166 | struct snd_soc_pcm_runtime *rtd = cstream->private_data; |
166 | 167 | struct snd_compr_runtime *crtd = cstream->runtime; |
| 168 | + struct sof_ipc_pcm_params_reply ipc_params_reply; |
167 | 169 | struct sof_ipc_fw_ready *ready = &sdev->fw_ready; |
168 | 170 | struct sof_ipc_fw_version *v = &ready->version; |
169 | 171 | struct sof_compr_stream *sstream; |
@@ -227,12 +229,21 @@ static int sof_compr_set_params(struct snd_soc_component *component, |
227 | 229 |
|
228 | 230 | memcpy((u8 *)pcm->params.ext_data, ¶ms->codec, ext_data_size); |
229 | 231 |
|
230 | | - ret = sof_ipc_tx_message_no_reply(sdev->ipc, pcm, sizeof(*pcm) + ext_data_size); |
| 232 | + ret = sof_ipc_tx_message(sdev->ipc, pcm, sizeof(*pcm) + ext_data_size, |
| 233 | + &ipc_params_reply, sizeof(ipc_params_reply)); |
231 | 234 | if (ret < 0) { |
232 | 235 | dev_err(component->dev, "error ipc failed\n"); |
233 | 236 | goto out; |
234 | 237 | } |
235 | 238 |
|
| 239 | + ret = snd_sof_set_stream_data_offset(sdev, &spcm->stream[cstream->direction], |
| 240 | + ipc_params_reply.posn_offset); |
| 241 | + if (ret < 0) { |
| 242 | + dev_err(component->dev, "Invalid stream data offset for Compr %d\n", |
| 243 | + spcm->pcm.pcm_id); |
| 244 | + goto out; |
| 245 | + } |
| 246 | + |
236 | 247 | sstream->sampling_rate = params->codec.sample_rate; |
237 | 248 | sstream->channels = params->codec.ch_out; |
238 | 249 | sstream->sample_container_bytes = pcm->params.sample_container_bytes; |
|
0 commit comments