mbox series

[v3,0/4] ASoC: qcom: display port changes

Message ID 20240606104922.114229-1-srinivas.kandagatla@linaro.org
Headers show
Series ASoC: qcom: display port changes | expand

Message

Srinivas Kandagatla June 6, 2024, 10:49 a.m. UTC
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

This patchset adds support for.
	1. parse Display Port module tokens from ASoC topology
	2. add support to DP/HDMI Jack events.
	3. fixes a typo in function name in sm8250

Verified these patches on X13s along with changes to tplg in 
https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/tree/topic/x13s-dp?ref_type=heads
and ucm changes from https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp

x1e80100 is verified by Krzysztof with his changes in tplg 

https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/merge_requests/7/commits

Thanks,
Srini

Changes since v2:
 - remove hdmi references.
 - added more DP jacks
 - added some comments in code
 - added x1e80100 patch to this series

Krzysztof Kozlowski (1):
  ASoC: qcom: x1e80100: Add USB DisplayPort plug support

Srinivas Kandagatla (3):
  ASoC: qcom: q6dsp: parse Display port tokens
  ASoC: qcom: common: add Display port Jack function
  ASoC: qcom: sc8280xp: add Display port Jack

 sound/soc/qcom/common.c         | 35 +++++++++++++++++++++++++++++++++
 sound/soc/qcom/common.h         |  3 +++
 sound/soc/qcom/qdsp6/topology.c | 26 ++++++++++++++++++++++++
 sound/soc/qcom/sc8280xp.c       | 15 ++++++++++++++
 sound/soc/qcom/x1e80100.c       | 20 +++++++++++++++++++
 5 files changed, 99 insertions(+)

Comments

Dmitry Baryshkov June 8, 2024, 2:23 a.m. UTC | #1
On Thu, Jun 06, 2024 at 11:49:18AM +0100, srinivas.kandagatla@linaro.org wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> 
> This patchset adds support for.
> 	1. parse Display Port module tokens from ASoC topology
> 	2. add support to DP/HDMI Jack events.
> 	3. fixes a typo in function name in sm8250
> 
> Verified these patches on X13s along with changes to tplg in 
> https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/tree/topic/x13s-dp?ref_type=heads
> and ucm changes from https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp
> 
> x1e80100 is verified by Krzysztof with his changes in tplg 
> 
> https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/merge_requests/7/commits
> 
> Thanks,
> Srini
> 

I have been testing this patchset on X13s, switching between speakers,
connected and disconnected DP output.

- Once the DSP got into the state, where I could not further get it to
  work until the reboot:

rohan pipewire[1749]: spa.alsa: set_hw_params: Invalid argument
rohan pipewire[1749]: pw.node: (alsa_output.platform-sound.HiFi__hw_SC8280XPLENOVOX_1__sink-48) suspended -> error (Start error: Invalid argument)
rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001001 cmd
rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001001] 1
rohan kernel: q6apm-lpass-dais 3000000.remoteproc:glink-edge:gpr:service@1:bedais: Failed to prepare Graph -22
rohan kernel: q6apm-lpass-dais 3000000.remoteproc:glink-edge:gpr:service@1:bedais: ASoC: error at snd_soc_pcm_dai_prepare on WSA_CODEC_DMA_RX_0: -22
rohan pipewire[1749]: spa.alsa: set_hw_params: Invalid argument
rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001001 cmd
rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001001] 1
rohan kernel: q6apm-lpass-dais 3000000.remoteproc:glink-edge:gpr:service@1:bedais: Failed to prepare Graph -22
rohan kernel: q6apm-lpass-dais 3000000.remoteproc:glink-edge:gpr:service@1:bedais: ASoC: error at snd_soc_pcm_dai_prepare on WSA_CODEC_DMA_RX_0: -22
rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001001 cmd
rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001001] 1


- Once in a while during startup PipeWire will try opening the
  incorrect DAI and then fail with:

rohan kernel: hdmi-audio-codec hdmi-audio-codec.8.auto: ASoC: error at snd_soc_dai_hw_params on i2s-hifi: -22
rohan kernel: hdmi-audio-codec hdmi-audio-codec.8.auto: ASoC: error at snd_soc_dai_hw_params on i2s-hifi: -22

  I think this happens if previously I have selected DP as an output,
  then closed gnome session, unplugged the cable and tried logging in
  again.

Generally, it looks like even though the Jack is reporting
'unplugged', sound daemon still can switch to to the disabled output
(or the audio card can be left in the stale state).  In case of DP
this frequently results in audio daemon or DSP failures.

So, the DP implementation needs to be made more robust, so that if
DP output gets selected when the cable is unplugged, the driver will not
attempt to configure the DSP.
Srinivas Kandagatla June 8, 2024, 9:12 a.m. UTC | #2
Thanks Dmitry for testing this out.

On 08/06/2024 03:23, Dmitry Baryshkov wrote:
> On Thu, Jun 06, 2024 at 11:49:18AM +0100, srinivas.kandagatla@linaro.org wrote:
>> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>>
>> This patchset adds support for.
>> 	1. parse Display Port module tokens from ASoC topology
>> 	2. add support to DP/HDMI Jack events.
>> 	3. fixes a typo in function name in sm8250
>>
>> Verified these patches on X13s along with changes to tplg in
>> https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/tree/topic/x13s-dp?ref_type=heads
>> and ucm changes from https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp
>>
>> x1e80100 is verified by Krzysztof with his changes in tplg
>>
>> https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/merge_requests/7/commits
>>
>> Thanks,
>> Srini
>>
> 
> I have been testing this patchset on X13s, switching between speakers,
> connected and disconnected DP output.
> 

This series changed the Jack event names by removing HDMI string from it 
as suggested, did you update the UCM to reflect this?
I have pushed changes required to 
https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp


Can you also try to  clean the asound.state restart the pipewire.

> - Once the DSP got into the state, where I could not further get it to
>    work until the reboot:
> 
> rohan pipewire[1749]: spa.alsa: set_hw_params: Invalid argument
> rohan pipewire[1749]: pw.node: (alsa_output.platform-sound.HiFi__hw_SC8280XPLENOVOX_1__sink-48) suspended -> error (Start error: Invalid argument)
> rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
> rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
> rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
> rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
> rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001001 cmd
> rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001001] 1
> rohan kernel: q6apm-lpass-dais 3000000.remoteproc:glink-edge:gpr:service@1:bedais: Failed to prepare Graph -22
> rohan kernel: q6apm-lpass-dais 3000000.remoteproc:glink-edge:gpr:service@1:bedais: ASoC: error at snd_soc_pcm_dai_prepare on WSA_CODEC_DMA_RX_0: -22
> rohan pipewire[1749]: spa.alsa: set_hw_params: Invalid argument
> rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
> rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
> rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
> rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
> rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001001 cmd
> rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001001] 1
> rohan kernel: q6apm-lpass-dais 3000000.remoteproc:glink-edge:gpr:service@1:bedais: Failed to prepare Graph -22
> rohan kernel: q6apm-lpass-dais 3000000.remoteproc:glink-edge:gpr:service@1:bedais: ASoC: error at snd_soc_pcm_dai_prepare on WSA_CODEC_DMA_RX_0: -22
> rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
> rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
> rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
> rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
> rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001001 cmd
> rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001001] 1
> 
> 
> - Once in a while during startup PipeWire will try opening the
>    incorrect DAI and then fail with:
> 
> rohan kernel: hdmi-audio-codec hdmi-audio-codec.8.auto: ASoC: error at snd_soc_dai_hw_params on i2s-hifi: -22
> rohan kernel: hdmi-audio-codec hdmi-audio-codec.8.auto: ASoC: error at snd_soc_dai_hw_params on i2s-hifi: -22
> 
>    I think this happens if previously I have selected DP as an output,
>    then closed gnome session, unplugged the cable and tried logging in
>    again.
> 
> Generally, it looks like even though the Jack is reporting
> 'unplugged', sound daemon still can switch to to the disabled output
I think this is to do with ucm changes requried for new jack name.

> (or the audio card can be left in the stale state).  In case of DP
> this frequently results in audio daemon or DSP failures.
> 
> So, the DP implementation needs to be made more robust, so that if
> DP output gets selected when the cable is unplugged, the driver will not
> attempt to configure the DSP.

I have tested this with

kernel: 
https://git.codelinaro.org/srinivas.kandagatla/linux/-/tree/dp/sc8280xp-6.10-rc1?ref_type=heads
ucm: https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp
tplg: 
https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/tree/topic/x13s-dp?ref_type=heads


with the above on my x13s, I can properly do switching between dp0,dp1 
and speakers with no issues.

Can you try them?

thanks,
Srini

>
Dmitry Baryshkov June 8, 2024, 2:56 p.m. UTC | #3
On Sat, 8 Jun 2024 at 12:12, Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> wrote:
>
> Thanks Dmitry for testing this out.
>
> On 08/06/2024 03:23, Dmitry Baryshkov wrote:
> > On Thu, Jun 06, 2024 at 11:49:18AM +0100, srinivas.kandagatla@linaro.org wrote:
> >> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> >>
> >> This patchset adds support for.
> >>      1. parse Display Port module tokens from ASoC topology
> >>      2. add support to DP/HDMI Jack events.
> >>      3. fixes a typo in function name in sm8250
> >>
> >> Verified these patches on X13s along with changes to tplg in
> >> https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/tree/topic/x13s-dp?ref_type=heads
> >> and ucm changes from https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp
> >>
> >> x1e80100 is verified by Krzysztof with his changes in tplg
> >>
> >> https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/merge_requests/7/commits
> >>
> >> Thanks,
> >> Srini
> >>
> >
> > I have been testing this patchset on X13s, switching between speakers,
> > connected and disconnected DP output.
> >
>
> This series changed the Jack event names by removing HDMI string from it
> as suggested, did you update the UCM to reflect this?

Yes, I did. The pipewire properly reports 'unconnected' state, but
nothing stops user from selecting the unconnected device / verb.

> I have pushed changes required to
> https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp
>
>
> Can you also try to  clean the asound.state restart the pipewire.
>
> > - Once the DSP got into the state, where I could not further get it to
> >    work until the reboot:
> >
> > rohan pipewire[1749]: spa.alsa: set_hw_params: Invalid argument
> > rohan pipewire[1749]: pw.node: (alsa_output.platform-sound.HiFi__hw_SC8280XPLENOVOX_1__sink-48) suspended -> error (Start error: Invalid argument)
> > rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
> > rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
> > rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
> > rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
> > rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001001 cmd
> > rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001001] 1
> > rohan kernel: q6apm-lpass-dais 3000000.remoteproc:glink-edge:gpr:service@1:bedais: Failed to prepare Graph -22
> > rohan kernel: q6apm-lpass-dais 3000000.remoteproc:glink-edge:gpr:service@1:bedais: ASoC: error at snd_soc_pcm_dai_prepare on WSA_CODEC_DMA_RX_0: -22
> > rohan pipewire[1749]: spa.alsa: set_hw_params: Invalid argument
> > rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
> > rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
> > rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
> > rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
> > rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001001 cmd
> > rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001001] 1
> > rohan kernel: q6apm-lpass-dais 3000000.remoteproc:glink-edge:gpr:service@1:bedais: Failed to prepare Graph -22
> > rohan kernel: q6apm-lpass-dais 3000000.remoteproc:glink-edge:gpr:service@1:bedais: ASoC: error at snd_soc_pcm_dai_prepare on WSA_CODEC_DMA_RX_0: -22
> > rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
> > rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
> > rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001006 cmd
> > rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001006] 1
> > rohan kernel: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001001 cmd
> > rohan kernel: qcom-apm gprsvc:service:2:1: DSP returned error[1001001] 1
> >
> >
> > - Once in a while during startup PipeWire will try opening the
> >    incorrect DAI and then fail with:
> >
> > rohan kernel: hdmi-audio-codec hdmi-audio-codec.8.auto: ASoC: error at snd_soc_dai_hw_params on i2s-hifi: -22
> > rohan kernel: hdmi-audio-codec hdmi-audio-codec.8.auto: ASoC: error at snd_soc_dai_hw_params on i2s-hifi: -22
> >
> >    I think this happens if previously I have selected DP as an output,
> >    then closed gnome session, unplugged the cable and tried logging in
> >    again.
> >
> > Generally, it looks like even though the Jack is reporting
> > 'unplugged', sound daemon still can switch to to the disabled output
> I think this is to do with ucm changes requried for new jack name.

No. The jack (and the pipewire status) reports unconnected.

>
> > (or the audio card can be left in the stale state).  In case of DP
> > this frequently results in audio daemon or DSP failures.
> >
> > So, the DP implementation needs to be made more robust, so that if
> > DP output gets selected when the cable is unplugged, the driver will not
> > attempt to configure the DSP.
>
> I have tested this with
>
> kernel:
> https://git.codelinaro.org/srinivas.kandagatla/linux/-/tree/dp/sc8280xp-6.10-rc1?ref_type=heads
> ucm: https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp
> tplg:
> https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/tree/topic/x13s-dp?ref_type=heads
>
>
> with the above on my x13s, I can properly do switching between dp0,dp1
> and speakers with no issues.

Have you tried switching to the unconnected sink? Starting the
pipewire when the previously selected sink is now disconnected?

>
> Can you try them?

Is the changing of the JACK names the only change in the UCM? compared
to your previous version?

I've used the following topology, fom the topology repo / x13s-dp branch

5206af2e1915b8dba52da2e59fb5ebff audioreach-tplg.bin
Srinivas Kandagatla June 10, 2024, 3:36 p.m. UTC | #4
On 08/06/2024 15:56, Dmitry Baryshkov wrote:
> On Sat, 8 Jun 2024 at 12:12, Srinivas Kandagatla
> <srinivas.kandagatla@linaro.org> wrote:
>>
>> Thanks Dmitry for testing this out.
>>
>> On 08/06/2024 03:23, Dmitry Baryshkov wrote:
>>> On Thu, Jun 06, 2024 at 11:49:18AM +0100, srinivas.kandagatla@linaro.org wrote:
>>>> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>>>>
>>>> This patchset adds support for.
>>>>       1. parse Display Port module tokens from ASoC topology
>>>>       2. add support to DP/HDMI Jack events.
>>>>       3. fixes a typo in function name in sm8250
>>>>
>>>> Verified these patches on X13s along with changes to tplg in
>>>> https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/tree/topic/x13s-dp?ref_type=heads
>>>> and ucm changes from https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp
>>>>
>>>> x1e80100 is verified by Krzysztof with his changes in tplg
>>>>
>>>> https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/merge_requests/7/commits
>>>>
>>>> Thanks,
>>>> Srini
>>>>
>>>
>>> I have been testing this patchset on X13s, switching between speakers,
>>> connected and disconnected DP output.
>>>
>>
>> This series changed the Jack event names by removing HDMI string from it
>> as suggested, did you update the UCM to reflect this?
> 
> Yes, I did. The pipewire properly reports 'unconnected' state, but
> nothing stops user from selecting the unconnected device / verb.

No, the jack events should prevent that from happening. You should not 
see them in output devices in settings->Sound.


> 
>> I have pushed changes required to
>> https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp
>>
...

>> kernel:
>> https://git.codelinaro.org/srinivas.kandagatla/linux/-/tree/dp/sc8280xp-6.10-rc1?ref_type=heads
>> ucm: https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp
>> tplg:
>> https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/tree/topic/x13s-dp?ref_type=heads
>>
>>
>> with the above on my x13s, I can properly do switching between dp0,dp1
>> and speakers with no issues.
> 
> Have you tried switching to the unconnected sink? Starting the
> pipewire when the previously selected sink is now disconnected?
> 
>>
>> Can you try them?
> 
> Is the changing of the JACK names the only change in the UCM? compared
> to your previous version?

Yes.

> 
> I've used the following topology, fom the topology repo / x13s-dp branch
> 
> 5206af2e1915b8dba52da2e59fb5ebff audioreach-tplg.bin
> 
> 
> 
>
Dmitry Baryshkov June 10, 2024, 6:01 p.m. UTC | #5
On Mon, 10 Jun 2024 at 18:36, Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> wrote:
>
>
>
> On 08/06/2024 15:56, Dmitry Baryshkov wrote:
> > On Sat, 8 Jun 2024 at 12:12, Srinivas Kandagatla
> > <srinivas.kandagatla@linaro.org> wrote:
> >>
> >> Thanks Dmitry for testing this out.
> >>
> >> On 08/06/2024 03:23, Dmitry Baryshkov wrote:
> >>> On Thu, Jun 06, 2024 at 11:49:18AM +0100, srinivas.kandagatla@linaro.org wrote:
> >>>> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> >>>>
> >>>> This patchset adds support for.
> >>>>       1. parse Display Port module tokens from ASoC topology
> >>>>       2. add support to DP/HDMI Jack events.
> >>>>       3. fixes a typo in function name in sm8250
> >>>>
> >>>> Verified these patches on X13s along with changes to tplg in
> >>>> https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/tree/topic/x13s-dp?ref_type=heads
> >>>> and ucm changes from https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp
> >>>>
> >>>> x1e80100 is verified by Krzysztof with his changes in tplg
> >>>>
> >>>> https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/merge_requests/7/commits
> >>>>
> >>>> Thanks,
> >>>> Srini
> >>>>
> >>>
> >>> I have been testing this patchset on X13s, switching between speakers,
> >>> connected and disconnected DP output.
> >>>
> >>
> >> This series changed the Jack event names by removing HDMI string from it
> >> as suggested, did you update the UCM to reflect this?
> >
> > Yes, I did. The pipewire properly reports 'unconnected' state, but
> > nothing stops user from selecting the unconnected device / verb.
>
> No, the jack events should prevent that from happening. You should not
> see them in output devices in settings->Sound.

No. With PulseAudio and with PipeWire unconnected devices are still
visible. They are annotated as (unconnected), but it's still possible
to select them.

Anyway, even if the sound daemon were to forbid that (or to hide these
devices), it would be perfectly possible to select them via alsaucm,
not to mention the amixer.

>
>
> >
> >> I have pushed changes required to
> >> https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp
> >>
> ...
>
> >> kernel:
> >> https://git.codelinaro.org/srinivas.kandagatla/linux/-/tree/dp/sc8280xp-6.10-rc1?ref_type=heads
> >> ucm: https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp
> >> tplg:
> >> https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/tree/topic/x13s-dp?ref_type=heads
> >>
> >>
> >> with the above on my x13s, I can properly do switching between dp0,dp1
> >> and speakers with no issues.
> >
> > Have you tried switching to the unconnected sink? Starting the
> > pipewire when the previously selected sink is now disconnected?
> >
> >>
> >> Can you try them?
> >
> > Is the changing of the JACK names the only change in the UCM? compared
> > to your previous version?
>
> Yes.
>

Then consider it tested with your patches (I did fix the jack names).
Dmitry Baryshkov June 13, 2024, 12:40 p.m. UTC | #6
On Thu, Jun 06, 2024 at 11:49:18AM +0100, srinivas.kandagatla@linaro.org wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> 
> This patchset adds support for.
> 	1. parse Display Port module tokens from ASoC topology
> 	2. add support to DP/HDMI Jack events.
> 	3. fixes a typo in function name in sm8250
> 
> Verified these patches on X13s along with changes to tplg in 
> https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/tree/topic/x13s-dp?ref_type=heads
> and ucm changes from https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp
> 
> x1e80100 is verified by Krzysztof with his changes in tplg 
> 
> https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/merge_requests/7/commits

Together with [1] and corresponding DT changes:

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> # X13s

Note, patch [1] is required to get the switching between Speakers and DP
work in a stable way, so I'd consider for it to be a dependency for this
series.

[1] https://lore.kernel.org/linux-sound/20240613-q6apm-fixes-v1-1-d88953675ab3@linaro.org/

> 
> Thanks,
> Srini
> 
> Changes since v2:
>  - remove hdmi references.
>  - added more DP jacks
>  - added some comments in code
>  - added x1e80100 patch to this series
> 
> Krzysztof Kozlowski (1):
>   ASoC: qcom: x1e80100: Add USB DisplayPort plug support
> 
> Srinivas Kandagatla (3):
>   ASoC: qcom: q6dsp: parse Display port tokens
>   ASoC: qcom: common: add Display port Jack function
>   ASoC: qcom: sc8280xp: add Display port Jack
> 
>  sound/soc/qcom/common.c         | 35 +++++++++++++++++++++++++++++++++
>  sound/soc/qcom/common.h         |  3 +++
>  sound/soc/qcom/qdsp6/topology.c | 26 ++++++++++++++++++++++++
>  sound/soc/qcom/sc8280xp.c       | 15 ++++++++++++++
>  sound/soc/qcom/x1e80100.c       | 20 +++++++++++++++++++
>  5 files changed, 99 insertions(+)
> 
> -- 
> 2.43.0
>
Mark Brown June 23, 2024, 5:21 p.m. UTC | #7
On Thu, 06 Jun 2024 11:49:18 +0100, srinivas.kandagatla@linaro.org wrote:
> This patchset adds support for.
> 	1. parse Display Port module tokens from ASoC topology
> 	2. add support to DP/HDMI Jack events.
> 	3. fixes a typo in function name in sm8250
> 
> Verified these patches on X13s along with changes to tplg in
> https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/tree/topic/x13s-dp?ref_type=heads
> and ucm changes from https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/4] ASoC: qcom: q6dsp: parse Display port tokens
      commit: 6d620e50bb055e072c8c50cf95cd397fc24378c2
[2/4] ASoC: qcom: common: add Display port Jack function
      commit: 735db4ea16caaebf8e4884ec0c2e419c96391ac8
[3/4] ASoC: qcom: sc8280xp: add Display port Jack
      commit: 7e815bb9abd16f99c987987242a9fe13dfa0f052
[4/4] ASoC: qcom: x1e80100: Add USB DisplayPort plug support
      commit: 24790a3cd1bdc083f9989f2fdb223f6494ebc99c

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark