From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Vinod Koul <vkoul@kernel.org>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Sanyog Kale <sanyog.r.kale@intel.com>,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Banajit Goswami <bgoswami@quicinc.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] ASoC: codecs: wsa884x: check if set_stream is called for proper bus
Date: Fri, 3 Nov 2023 10:39:42 -0500 [thread overview]
Message-ID: <30f0f5ef-a148-444f-924f-594f4cbd48a4@linux.intel.com> (raw)
In-Reply-To: <160752cb-7772-4b1d-9096-8be25e76213c@linaro.org>
> We have two Soundwire controllers swr0 and swr3, each with two WSA884x
> speakers (codecs):
>
> -------------
> &swr0 {
> status = "okay";
>
> left_woofer: speaker@0,0 {
> compatible = "sdw20217020400";
> reg = <0 0>;
> // ...
> };
>
> /* WSA8845, Left Tweeter */
> left_tweeter: speaker@0,1 {
> compatible = "sdw20217020400";
> reg = <0 1>;
> // ...
> };
> };
>
> &swr3 {
> status = "okay";
>
> /* WSA8845, Right Woofer */
> right_woofer: speaker@0,0 {
> compatible = "sdw20217020400";
> reg = <0 0>;
> // ...
> };
>
> /* WSA8845, Right Tweeter */
> right_tweeter: speaker@0,1 {
> compatible = "sdw20217020400";
> reg = <0 1>;
> // ...
> };
> };
> -------------
>
> Now, for four-speaker playback, we have sound card with links like:
>
> -------------
> wsa-dai-link {
> link-name = "WSA Playback";
>
> cpu {
> sound-dai = <&q6apmbedai WSA_CODEC_DMA_RX_0>;
> };
>
> codec {
> sound-dai = <&left_woofer>, <&left_tweeter>,
> <&swr0 0>, <&lpass_wsamacro 0>,
> <&right_woofer>, <&right_tweeter>,
> <&swr3 0>, <&lpass_wsa2macro 0>;
> };
>
> platform {
> sound-dai = <&q6apm>;
> };
> };
> -------------
>
> We need to prepare the stream for all four speakers and two soundwire
> controllers (so two different soundwire buses), however without the
> patches here, the stream (sdw_stream_runtime *sruntime) right
> woofer/twitter is set to swr0 (the other bus!). But it should stay as
> swr3 (their bus).
>
> Does it help a bit? I hope I am able to properly explain it.
The configuration seems fine, but the problem is the
"sdw_stream_runtime" definition.
You need *ONE* sdw_stream_runtime, and multiple m_rt contexts added in
the linked lists of this sdw_stream_runtime. In other words, you need to
call sdw_stream_add_master() twice, for swr0 and swr3 respectively.
Put differently, a sdw_stream_runtime does not point to a specific bus,
it provides a top-level structure which can use multiple buses.
The best way to allocate the sdw_stream_runtime is to rely on the
dailink .startup callback. From the description above that's where you
have all the needed information, and then each DAI .startup (or
hw_params) can call sdw_stream_add_master() to update the linked lists.
next prev parent reply other threads:[~2023-11-06 14:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-25 14:45 [PATCH 1/3] soundwire: qcom: drop unneeded DAI .set_stream callback Krzysztof Kozlowski
2023-10-25 14:46 ` [PATCH 2/3] soundwire: qcom: set owner device of runtime stream Krzysztof Kozlowski
2023-10-25 15:08 ` Pierre-Louis Bossart
2023-10-25 14:46 ` [PATCH 3/3] ASoC: codecs: wsa884x: check if set_stream is called for proper bus Krzysztof Kozlowski
2023-10-25 14:53 ` Krzysztof Kozlowski
2023-10-25 15:03 ` Pierre-Louis Bossart
2023-11-03 14:16 ` Krzysztof Kozlowski
2023-11-03 15:39 ` Pierre-Louis Bossart [this message]
2023-10-25 15:12 ` [PATCH 1/3] soundwire: qcom: drop unneeded DAI .set_stream callback Pierre-Louis Bossart
2023-11-03 13:43 ` Krzysztof Kozlowski
2023-11-03 15:29 ` Pierre-Louis Bossart
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=30f0f5ef-a148-444f-924f-594f4cbd48a4@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=agross@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=andersson@kernel.org \
--cc=bgoswami@quicinc.com \
--cc=broonie@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=sanyog.r.kale@intel.com \
--cc=srinivas.kandagatla@linaro.org \
--cc=tiwai@suse.com \
--cc=vkoul@kernel.org \
--cc=yung-chuan.liao@linux.intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).