* [PATCH 2/2] ASoC: amd: closing specific instance.
@ 2020-06-18 7:26 Ravulapati Vishnu vardhan rao
2020-06-18 11:31 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Ravulapati Vishnu vardhan rao @ 2020-06-18 7:26 UTC (permalink / raw)
Cc: Alexander.Deucher, Ravulapati Vishnu vardhan rao, Liam Girdwood,
Mark Brown, Jaroslav Kysela, Takashi Iwai, Akshu Agrawal,
Vijendar Mukunda, Colin Ian King, Kuninori Morimoto,
moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
open list
The steps to reproduce:
Record from the internal mic :
(arecord -D hw:1,2 -f dat /dev/null -V stereos)
Record from the headphone mic:
(arecord -D hw:1,0 -f dat /dev/null -V stereos)
Kill the recording from internal mic.
We can see the recording from the headphone mic is broken.
This patch rectifies the issue reported.
Signed-off-by: Ravulapati Vishnu vardhan rao <Vishnuvardhanrao.Ravulapati@amd.com>
---
sound/soc/amd/raven/acp3x-pcm-dma.c | 30 ++++++++++++++++++++++-------
1 file changed, 23 insertions(+), 7 deletions(-)
diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c
index d8f554f369a8..e6386de20ac7 100644
--- a/sound/soc/amd/raven/acp3x-pcm-dma.c
+++ b/sound/soc/amd/raven/acp3x-pcm-dma.c
@@ -342,11 +342,34 @@ static int acp3x_dma_close(struct snd_soc_component *component,
{
struct snd_soc_pcm_runtime *prtd;
struct i2s_dev_data *adata;
+ struct i2s_stream_instance *ins;
prtd = substream->private_data;
component = snd_soc_rtdcom_lookup(prtd, DRV_NAME);
adata = dev_get_drvdata(component->dev);
+ ins = substream->runtime->private_data;
+ if (!ins)
+ return -EINVAL;
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ switch (ins->i2s_instance) {
+ case I2S_BT_INSTANCE:
+ adata->play_stream = NULL;
+ break;
+ case I2S_SP_INSTANCE:
+ default:
+ adata->i2ssp_play_stream = NULL;
+ }
+ } else {
+ switch (ins->i2s_instance) {
+ case I2S_BT_INSTANCE:
+ adata->capture_stream = NULL;
+ break;
+ case I2S_SP_INSTANCE:
+ default:
+ adata->i2ssp_capture_stream = NULL;
+ }
+ }
/* Disable ACP irq, when the current stream is being closed and
* another stream is also not active.
@@ -354,13 +377,6 @@ static int acp3x_dma_close(struct snd_soc_component *component,
if (!adata->play_stream && !adata->capture_stream &&
!adata->i2ssp_play_stream && !adata->i2ssp_capture_stream)
rv_writel(0, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB);
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- adata->play_stream = NULL;
- adata->i2ssp_play_stream = NULL;
- } else {
- adata->capture_stream = NULL;
- adata->i2ssp_capture_stream = NULL;
- }
return 0;
}
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 2/2] ASoC: amd: closing specific instance.
2020-06-18 7:26 [PATCH 2/2] ASoC: amd: closing specific instance Ravulapati Vishnu vardhan rao
@ 2020-06-18 11:31 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2020-06-18 11:31 UTC (permalink / raw)
To: Ravulapati Vishnu vardhan rao
Cc: Alexander.Deucher, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
Akshu Agrawal, Vijendar Mukunda, Colin Ian King,
Kuninori Morimoto,
moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
open list
[-- Attachment #1: Type: text/plain, Size: 618 bytes --]
On Thu, Jun 18, 2020 at 12:56:52PM +0530, Ravulapati Vishnu vardhan rao wrote:
> The steps to reproduce:
>
> Record from the internal mic :
> (arecord -D hw:1,2 -f dat /dev/null -V stereos)
>
> Record from the headphone mic:
> (arecord -D hw:1,0 -f dat /dev/null -V stereos)
>
> Kill the recording from internal mic.
> We can see the recording from the headphone mic is broken.
>
> This patch rectifies the issue reported.
The changelog should really also describe what the underlying problem
and/or fix are - this description is only at user level, it's missing a
bit for describing the change.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-18 11:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-18 7:26 [PATCH 2/2] ASoC: amd: closing specific instance Ravulapati Vishnu vardhan rao
2020-06-18 11:31 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®