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 | case SNDRV_PCM_TRIGGER_STOP: | 317 | case SNDRV_PCM_TRIGGER_STOP: |
| 318 | /* TODO support be handled via SoftPause Module */ | 318 | /* TODO support be handled via SoftPause Module */ |
| 319 | prtd->state = Q6APM_STREAM_STOPPED; | 319 | prtd->state = Q6APM_STREAM_STOPPED; |
| 320 | prtd->queue_ptr = 0; | ||
| 320 | break; | 321 | break; |
| 321 | case SNDRV_PCM_TRIGGER_SUSPEND: | 322 | case SNDRV_PCM_TRIGGER_SUSPEND: |
| 322 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 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 | mutex_lock(&graph->lock); | 216 | mutex_lock(&graph->lock); |
| 217 | 217 | ||
| 218 | data->dsp_buf = 0; | ||
| 219 | |||
| 218 | if (data->buf) { | 220 | if (data->buf) { |
| 219 | mutex_unlock(&graph->lock); | 221 | mutex_unlock(&graph->lock); |
| 220 | return 0; | 222 | return 0; |