Reset queue pointer on SNDRV_PCM_TRIGGER_STOP event to be inline with resetting appl_ptr. Without this we will end up with a queue_ptr out of sync and driver could try to send data that is not ready yet. Fix this by resetting the queue_ptr.
Unified · Split
| @@ -317,6 +317,7 @@ static int q6apm_dai_trigger(struct snd_soc_component *component, · 316 unmodified lines | ||
| 317 | 317 | case SNDRV_PCM_TRIGGER_STOP: |
| 318 | 318 | /* TODO support be handled via SoftPause Module */ |
| 319 | 319 | prtd->state = Q6APM_STREAM_STOPPED; |
| 320 | + prtd->queue_ptr = 0; | |
| 320 | 321 | break; |
| 321 | 322 | case SNDRV_PCM_TRIGGER_SUSPEND: |
| 322 | 323 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
| @@ -215,6 +215,8 @@ int q6apm_map_memory_regions(struct q6apm_graph *graph, unsigned int dir, phys_a · 214 unmodified lines | ||
| 215 | 215 | |
| 216 | 216 | mutex_lock(&graph->lock); |
| 217 | 217 | |
| 218 | + data->dsp_buf = 0; | |
| 219 | + | |
| 218 | 220 | if (data->buf) { |
| 219 | 221 | mutex_unlock(&graph->lock); |
| 220 | 222 | return 0; |