From: "Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>
To: Sameer Pujar <spujar@nvidia.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
broonie@kernel.org, lgirdwood@gmail.com, robh+dt@kernel.org,
thierry.reding@gmail.com, jonathanh@nvidia.com,
catalin.marinas@arm.com, will@kernel.org, perex@perex.cz,
tiwai@suse.com, kuninori.morimoto.gx@renesas.com
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,
sharadg@nvidia.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 01/13] ASoC: soc-pcm: Don't reconnect an already active BE
Date: Wed, 29 Sep 2021 14:56:46 +0300 [thread overview]
Message-ID: <2f96f1aa-74f2-8ea8-3f43-e4da97400fde@linux.intel.com> (raw)
In-Reply-To: <70422e52-89d2-d926-b3f9-be59780d464e@nvidia.com>
On 29/09/2021 10:43, Sameer Pujar wrote:
>
>
> On 9/29/2021 2:55 AM, Pierre-Louis Bossart wrote:
>> On 8/27/21 4:33 AM, Sameer Pujar wrote:
>
> [...]
>
>> But in addition we'd need to agree on what an 'active BE' is. Why can't
>> we connect a second stream while the first one is already in HW_PARAMS
>> or PAUSED or STOP? It's perfectly legal in ALSA/ASoC to have multiple
>> HW_PARAMS calls, and when we reach STOP we have to do a prepare again.
>>
>> And more fundamentally, the ability to add a second FE on a 'active' BE
>> in START state is a basic requirement for a mixer, e.g. to play a
>> notification on one FE while listening to music on another. What needs
>> to happen is only to make sure that the FE and BE are compatible in
>> terms of HW_PARAMS and not sending a second TRIGGER_STOP, only checking
>> the BE NEW or CLOSE state is way too restrictive.
>
> Sorry for the trouble to your system.
>
> Idea was to avoid reconfiguration of the same BE DAI again, but not to
> stop the provision to add a subsequent FE. In fact I had tested mixing
> of streams coming from 10 different FEs.
>
> In your case, because of this patch, looks like the subsequent FE is not
> finding a BE DAI since it is already active due to a prior FE. The
> reason it works at my end is because the mixer input and output DAIs are
> separated. Any new FE would just configure the mixer input DAI to which
> it is attached and skip already running/configured output DAI.
The problem as I see is that with this patch one can not connect a new
FE to a BE which is _not_ in NEW or CLOSE state.
The FE and BE needs to be connected to have DPCM working and this patch
makes the code to skip the dpcm_be_connect().
Consider this simple setup:
FE1 -->|
| --> BE -->
FE2- ->|
First we start FE1, dpcm_be_connect(FE1, BE, stream) is made.
Later FE2 is started but dpcm_be_connect(FE2, BE, stream) would be not
made because BE is no longer in NEW/CLOSE state.
> I am just
> curious to know, if originally you were reconfiguring the BE DAI again
> with same parameters (for a second FE) or some additional configuration
> is done?
>
>
>> I can send a revert with the explanations in the commit message if there
>> is a consensus that this patch needs to be revisited.
>
> May be this can be revisited since it appears to be a critical problem
> for your system. But I hope this discussion can be alive on following
> points for a better fix.
>
> 1. The original issue at my end was not just a configuration redundancy.
> I realize now that with more stream addition following error print is seen.
> "ASoC: too many users playback at open 4"
>
> This is because the max DPCM users is capped at 8. Increasing this
> may help (need to see what number is better), but does not address the
> redundancy problem.
>
> 2. If reconfiguration of the same BE is not necessary for a subsequent
> FE run, shouldn't we avoid the reconfig itself and somehow avoid FE
> failure?
I'm not sure, but it might be possible to just skip the
dpcm_set_be_update_state(be, stream, SND_SOC_DPCM_UPDATE_BE);
call at the end of the loop, but the question is under which condition?
Can a BE asked to be reconfigured when STOP/OPEN/HW_PARAMS?
Skipping the connect does not sound right for a new FE-BE connection.
--
Péter
WARNING: multiple messages have this Message-ID (diff)
From: "Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>
To: Sameer Pujar <spujar@nvidia.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
broonie@kernel.org, lgirdwood@gmail.com, robh+dt@kernel.org,
thierry.reding@gmail.com, jonathanh@nvidia.com,
catalin.marinas@arm.com, will@kernel.org, perex@perex.cz,
tiwai@suse.com, kuninori.morimoto.gx@renesas.com
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
linux-kernel@vger.kernel.org, sharadg@nvidia.com,
linux-tegra@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 01/13] ASoC: soc-pcm: Don't reconnect an already active BE
Date: Wed, 29 Sep 2021 14:56:46 +0300 [thread overview]
Message-ID: <2f96f1aa-74f2-8ea8-3f43-e4da97400fde@linux.intel.com> (raw)
In-Reply-To: <70422e52-89d2-d926-b3f9-be59780d464e@nvidia.com>
On 29/09/2021 10:43, Sameer Pujar wrote:
>
>
> On 9/29/2021 2:55 AM, Pierre-Louis Bossart wrote:
>> On 8/27/21 4:33 AM, Sameer Pujar wrote:
>
> [...]
>
>> But in addition we'd need to agree on what an 'active BE' is. Why can't
>> we connect a second stream while the first one is already in HW_PARAMS
>> or PAUSED or STOP? It's perfectly legal in ALSA/ASoC to have multiple
>> HW_PARAMS calls, and when we reach STOP we have to do a prepare again.
>>
>> And more fundamentally, the ability to add a second FE on a 'active' BE
>> in START state is a basic requirement for a mixer, e.g. to play a
>> notification on one FE while listening to music on another. What needs
>> to happen is only to make sure that the FE and BE are compatible in
>> terms of HW_PARAMS and not sending a second TRIGGER_STOP, only checking
>> the BE NEW or CLOSE state is way too restrictive.
>
> Sorry for the trouble to your system.
>
> Idea was to avoid reconfiguration of the same BE DAI again, but not to
> stop the provision to add a subsequent FE. In fact I had tested mixing
> of streams coming from 10 different FEs.
>
> In your case, because of this patch, looks like the subsequent FE is not
> finding a BE DAI since it is already active due to a prior FE. The
> reason it works at my end is because the mixer input and output DAIs are
> separated. Any new FE would just configure the mixer input DAI to which
> it is attached and skip already running/configured output DAI.
The problem as I see is that with this patch one can not connect a new
FE to a BE which is _not_ in NEW or CLOSE state.
The FE and BE needs to be connected to have DPCM working and this patch
makes the code to skip the dpcm_be_connect().
Consider this simple setup:
FE1 -->|
| --> BE -->
FE2- ->|
First we start FE1, dpcm_be_connect(FE1, BE, stream) is made.
Later FE2 is started but dpcm_be_connect(FE2, BE, stream) would be not
made because BE is no longer in NEW/CLOSE state.
> I am just
> curious to know, if originally you were reconfiguring the BE DAI again
> with same parameters (for a second FE) or some additional configuration
> is done?
>
>
>> I can send a revert with the explanations in the commit message if there
>> is a consensus that this patch needs to be revisited.
>
> May be this can be revisited since it appears to be a critical problem
> for your system. But I hope this discussion can be alive on following
> points for a better fix.
>
> 1. The original issue at my end was not just a configuration redundancy.
> I realize now that with more stream addition following error print is seen.
> "ASoC: too many users playback at open 4"
>
> This is because the max DPCM users is capped at 8. Increasing this
> may help (need to see what number is better), but does not address the
> redundancy problem.
>
> 2. If reconfiguration of the same BE is not necessary for a subsequent
> FE run, shouldn't we avoid the reconfig itself and somehow avoid FE
> failure?
I'm not sure, but it might be possible to just skip the
dpcm_set_be_update_state(be, stream, SND_SOC_DPCM_UPDATE_BE);
call at the end of the loop, but the question is under which condition?
Can a BE asked to be reconfigured when STOP/OPEN/HW_PARAMS?
Skipping the connect does not sound right for a new FE-BE connection.
--
Péter
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-09-29 11:57 UTC|newest]
Thread overview: 92+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-27 9:33 [PATCH 00/13] Extend AHUB audio support for Tegra210 and later Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` [PATCH 01/13] ASoC: soc-pcm: Don't reconnect an already active BE Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-09-28 21:25 ` Pierre-Louis Bossart
2021-09-28 21:25 ` Pierre-Louis Bossart
2021-09-28 21:25 ` Pierre-Louis Bossart
2021-09-29 7:43 ` Sameer Pujar
2021-09-29 7:43 ` Sameer Pujar
2021-09-29 7:43 ` Sameer Pujar
2021-09-29 11:56 ` Péter Ujfalusi [this message]
2021-09-29 11:56 ` Péter Ujfalusi
2021-09-29 14:52 ` Pierre-Louis Bossart
2021-09-29 14:52 ` Pierre-Louis Bossart
2021-09-29 14:52 ` Pierre-Louis Bossart
2021-09-30 7:57 ` Sameer Pujar
2021-09-30 7:57 ` Sameer Pujar
2021-09-30 7:57 ` Sameer Pujar
2021-09-30 14:34 ` Pierre-Louis Bossart
2021-09-30 14:34 ` Pierre-Louis Bossart
2021-09-30 14:34 ` Pierre-Louis Bossart
2021-09-30 15:35 ` Sameer Pujar
2021-09-30 15:35 ` Sameer Pujar
2021-09-30 15:35 ` Sameer Pujar
2021-09-30 16:13 ` Pierre-Louis Bossart
2021-09-30 16:13 ` Pierre-Louis Bossart
2021-09-30 16:13 ` Pierre-Louis Bossart
2021-09-30 19:00 ` Pierre-Louis Bossart
2021-09-30 19:00 ` Pierre-Louis Bossart
2021-09-30 19:00 ` Pierre-Louis Bossart
2021-10-04 4:38 ` Sameer Pujar
2021-10-04 4:38 ` Sameer Pujar
2021-10-04 4:38 ` Sameer Pujar
2021-08-27 9:33 ` [PATCH 02/13] ASoC: simple-card-utils: Increase maximum DAI links limit to 512 Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` [PATCH 03/13] ASoC: audio-graph: Fixup CPU endpoint hw_params in a BE<->BE link Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` [PATCH 04/13] ASoC: dt-bindings: tegra: Few more Tegra210 AHUB modules Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-31 20:21 ` Rob Herring
2021-08-31 20:21 ` Rob Herring
2021-08-31 20:21 ` Rob Herring
2021-09-01 7:09 ` Sameer Pujar
2021-09-01 7:09 ` Sameer Pujar
2021-09-01 7:09 ` Sameer Pujar
2021-08-27 9:33 ` [PATCH 05/13] ASoC: tegra: Add routes for few " Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` [PATCH 06/13] ASoC: tegra: Add Tegra210 based MVC driver Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-09-03 18:13 ` Mark Brown
2021-09-03 18:13 ` Mark Brown
2021-09-03 18:13 ` Mark Brown
2021-09-07 8:05 ` Sameer Pujar
2021-09-09 13:03 ` Sameer Pujar
2021-09-09 14:20 ` Mark Brown
2021-09-09 14:20 ` Mark Brown
2021-09-09 14:20 ` Mark Brown
2021-09-13 4:54 ` Sameer Pujar
2021-09-13 5:02 ` Sameer Pujar
2021-09-13 14:23 ` Mark Brown
2021-09-13 14:23 ` Mark Brown
2021-09-13 14:23 ` Mark Brown
2021-08-27 9:33 ` [PATCH 07/13] ASoC: tegra: Add Tegra210 based SFC driver Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` [PATCH 08/13] ASoC: tegra: Add Tegra210 based AMX driver Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` [PATCH 09/13] ASoC: tegra: Add Tegra210 based ADX driver Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` [PATCH 10/13] ASoC: tegra: Add Tegra210 based Mixer driver Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` [PATCH 11/13] arm64: defconfig: Enable few Tegra210 based AHUB drivers Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` [PATCH 12/13] arm64: tegra: Add few AHUB devices for Tegra210 and later Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-08-27 9:33 ` [PATCH 13/13] arm64: tegra: Extend APE audio support on Jetson platforms Sameer Pujar
2021-08-27 9:33 ` Sameer Pujar
2021-09-08 4:56 ` [PATCH 00/13] Extend AHUB audio support for Tegra210 and later Sameer Pujar
2021-09-08 4:56 ` Sameer Pujar
2021-09-08 4:56 ` Sameer Pujar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2f96f1aa-74f2-8ea8-3f43-e4da97400fde@linux.intel.com \
--to=peter.ujfalusi@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=jonathanh@nvidia.com \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=robh+dt@kernel.org \
--cc=sharadg@nvidia.com \
--cc=spujar@nvidia.com \
--cc=thierry.reding@gmail.com \
--cc=tiwai@suse.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.