mbox series

[RESEND,v10,00/17] ASoC: qcom: Add AudioReach support

Message ID 20211026103815.19468-1-srinivas.kandagatla@linaro.org (mailing list archive)
Headers show
Series ASoC: qcom: Add AudioReach support | expand

Message

Srinivas Kandagatla Oct. 26, 2021, 10:37 a.m. UTC
Hi Mark,

Am resending this series as I ended up sending incorrect patches for v10.

Sorry for the resend noise.

This version is a respin of v9 fixing a build error in 12/17 patch.

QCOM SoC relevant non-audio patches in this series has been merged into
the Qualcomm drivers-for-5.16 tree, as this series depends those patches
an immutable tag is available at:
https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git tags/20210927135559.738-6-srinivas.kandagatla@linaro.org

This patchset adds ASoC driver support to configure signal processing
framework ("AudioReach") which is integral part of Qualcomm next
generation audio SDK and will be deployed on upcoming Qualcomm chipsets.
It makes use of ASoC Topology to load graphs on to the DSP which is then
managed by APM (Audio Processing Manager) service to prepare/start/stop.

Here is simplified high-level block diagram of AudioReach:

 ___________________________________________________________
|                 CPU (Application Processor)               |
|  +---------+          +---------+         +----------+    |
|  |  q6apm  |          |  q6apm  |         |  q6apm   |    |
|  |   dais  | <------> |         | <-----> |lpass-dais|    |
|  +---------+          +---------+         +----------+    |
|                            ^  ^                           |
|                            |  |           +---------+     |
|  +---------+               v  +---------->|topology |     |
|  | q6prm   |          +---------+         |         |     |
|  |         |<-------->|   GPR   |         +---------+     |
|  +---------+          +---------+                         |
|       ^                    ^                              |
|       |                    |                              |
|  +----------+              |                              |
|  |   q6prm  |              |                              |
|  |lpass-clks|              |                              |
|  +----------+              |                              |
|____________________________|______________________________|
                             |  
                             | RPMSG (IPC over GLINK)              
 ____________________________|______________________________
|                            |                              |
|    +-----------------------+                              |
|    |                       |                              |
|    v                       v              q6 (Audio DSP)  |
|+-----+    +----------------------------------+            |
|| PRM |    | APM (Audio Processing Manager)   |            |
|+-----+    |  . Graph Management              |            |  
|           |  . Command Handing               |            |  
|           |  . Event Management              |            |  
|           |  ...                             |            |  
|           +----------------------------------+            |  
|                            ^                              |
|____________________________|______________________________|
                             |  
                             |   LPASS AIF
 ____________________________|______________________________
|                            |            Audio I/O         |
|                            v                              |
|   +--------------------------------------------------+    |
|    |                Audio devices                     |   |
|    | CODEC | HDMI-TX | PCM  | SLIMBUS | I2S |MI2S |...|   |
|    |                                                  |   |
|    +--------------------------------------------------+   |
|___________________________________________________________|

AudioReach has constructs of sub-graph, container and modules.
Each sub-graph can have N containers and each Container can have N Modules
and connections between them can be linear or non-linear.
An audio function can be realized with one or many connected
sub-graphs. There are also control/event paths between modules that can
be wired up while building graph to achieve various control mechanism
between modules. These concepts of Sub-Graph, Containers and Modules
are represented in ASoC topology.

Here is simple I2S graph with a Write Shared Memory and a
Volume control module within a single Subgraph (1) with one Container (1)
and 5 modules.

  ____________________________________________________________
 |                        Sub-Graph [1]                       |
 |  _______________________________________________________   |
 | |                       Container [1]                   |  |
 | | [WR_SH] -> [PCM DEC] -> [PCM CONV] -> [VOL]-> [I2S-EP]|  |
 | |_______________________________________________________|  |
 |____________________________________________________________|

For now this graph is split into two subgraphs to achieve dpcm like below:
 ________________________________________________    _________________
|                Sub-Graph [1]                   |  |  Sub-Graph [2]  |
|  ____________________________________________  |  |  _____________  |
| |              Container [1]                 | |  | |Container [2]| |
| | [WR_SH] -> [PCM DEC] -> [PCM CONV] -> [VOL]| |  | |   [I2S-EP]  | |
| |____________________________________________| |  | |_____________| |
|________________________________________________|  |_________________|

                                                      _________________
                                                    |  Sub-Graph [3]  |
                                                    |  _____________  |
                                                    | |Container [3]| |
                                                    | |  [DMA-EP]   | |
                                                    | |_____________| |
                                                    |_________________|


This patchset adds very minimal support for AudioReach which includes
supporting sub-graphs containing CODEC DMA ports and simple PCM
Decoder/Encoder and Logger Modules. Additional capabilities will
be built over time to expose features offered by AudioReach. 

This patchset is Tested on SM8250 SoC based Qualcomm Robotics Platform RB5
and SM9250 MTP with WSA881X Smart Speaker Amplifiers, DMICs connected via
VA Macro and WCD938x Codec connected via TX and RX Macro and HDMI audio
via I2S.

First 10 Patches are mostly reorganization existing Old QDSP Audio
Framework code and bindings so that we could reuse them on AudioReach.

ASoC topology graphs for DragonBoard RB5 and SM8250 MTP are available at 
https://git.linaro.org/people/srinivas.kandagatla/audioreach-topology.git/
and Qualcomm AudioReach DSP headers are available at:
https://source.codeaurora.org/quic/la/platform/vendor/opensource/arspf-headers

Note: There is one false positive warning in this patchset:
audioreach.c:80:45: warning: array of flexible structures

Thanks,
srini

Changes since v9:
- fix build error during arm64 defconfig build reported by Mark in 12/17 patch

Srinivas Kandagatla (17):
  ASoC: dt-bindings: move LPASS dai related bindings out of q6afe
  ASoC: dt-bindings: move LPASS clocks related bindings out of q6afe
  ASoC: dt-bindings: rename q6afe.h to q6dsp-lpass-ports.h
  ASoC: qdsp6: q6afe-dai: move lpass audio ports to common file
  ASoC: qdsp6: q6afe-clocks: move audio-clocks to common file
  ASoC: dt-bindings: q6dsp: add q6apm-lpass-dai compatible
  ASoC: dt-bindings: lpass-clocks: add q6prm clocks compatible
  ASoC: dt-bindings: add q6apm digital audio stream bindings
  ASoC: qdsp6: audioreach: add basic pkt alloc support
  ASoC: qdsp6: audioreach: add q6apm support
  ASoC: qdsp6: audioreach: add module configuration command helpers
  ASoC: qdsp6: audioreach: add Kconfig and Makefile
  ASoC: qdsp6: audioreach: add topology support
  ASoC: qdsp6: audioreach: add q6apm-dai support
  ASoC: qdsp6: audioreach: add q6apm lpass dai support
  ASoC: qdsp6: audioreach: add q6prm support
  ASoC: qdsp6: audioreach: add support for q6prm-clocks

 .../devicetree/bindings/sound/qcom,q6afe.txt  |  181 ---
 .../bindings/sound/qcom,q6apm-dai.yaml        |   53 +
 .../sound/qcom,q6dsp-lpass-clocks.yaml        |   77 ++
 .../sound/qcom,q6dsp-lpass-ports.yaml         |  205 +++
 include/dt-bindings/sound/qcom,q6afe.h        |  203 +--
 .../sound/qcom,q6dsp-lpass-ports.h            |  208 +++
 include/uapi/sound/snd_ar_tokens.h            |  208 +++
 sound/soc/qcom/Kconfig                        |   22 +
 sound/soc/qcom/qdsp6/Makefile                 |   11 +-
 sound/soc/qcom/qdsp6/audioreach.c             | 1130 +++++++++++++++++
 sound/soc/qcom/qdsp6/audioreach.h             |  726 +++++++++++
 sound/soc/qcom/qdsp6/q6afe-clocks.c           |  187 +--
 sound/soc/qcom/qdsp6/q6afe-dai.c              |  687 +---------
 sound/soc/qcom/qdsp6/q6apm-dai.c              |  416 ++++++
 sound/soc/qcom/qdsp6/q6apm-lpass-dais.c       |  260 ++++
 sound/soc/qcom/qdsp6/q6apm.c                  |  822 ++++++++++++
 sound/soc/qcom/qdsp6/q6apm.h                  |  152 +++
 sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.c     |  186 +++
 sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.h     |   30 +
 sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c      |  627 +++++++++
 sound/soc/qcom/qdsp6/q6dsp-lpass-ports.h      |   22 +
 sound/soc/qcom/qdsp6/q6prm-clocks.c           |   85 ++
 sound/soc/qcom/qdsp6/q6prm.c                  |  202 +++
 sound/soc/qcom/qdsp6/q6prm.h                  |   78 ++
 sound/soc/qcom/qdsp6/topology.c               | 1113 ++++++++++++++++
 25 files changed, 6664 insertions(+), 1227 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6apm-dai.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-clocks.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-ports.yaml
 create mode 100644 include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h
 create mode 100644 include/uapi/sound/snd_ar_tokens.h
 create mode 100644 sound/soc/qcom/qdsp6/audioreach.c
 create mode 100644 sound/soc/qcom/qdsp6/audioreach.h
 create mode 100644 sound/soc/qcom/qdsp6/q6apm-dai.c
 create mode 100644 sound/soc/qcom/qdsp6/q6apm-lpass-dais.c
 create mode 100644 sound/soc/qcom/qdsp6/q6apm.c
 create mode 100644 sound/soc/qcom/qdsp6/q6apm.h
 create mode 100644 sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.c
 create mode 100644 sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.h
 create mode 100644 sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c
 create mode 100644 sound/soc/qcom/qdsp6/q6dsp-lpass-ports.h
 create mode 100644 sound/soc/qcom/qdsp6/q6prm-clocks.c
 create mode 100644 sound/soc/qcom/qdsp6/q6prm.c
 create mode 100644 sound/soc/qcom/qdsp6/q6prm.h
 create mode 100644 sound/soc/qcom/qdsp6/topology.c

Comments

Mark Brown Oct. 26, 2021, 10:47 a.m. UTC | #1
On Tue, Oct 26, 2021 at 11:37:58AM +0100, Srinivas Kandagatla wrote:

> Am resending this series as I ended up sending incorrect patches for v10.

If you're sending something different it's not just a new version!
Srinivas Kandagatla Oct. 26, 2021, 10:55 a.m. UTC | #2
On 26/10/2021 11:47, Mark Brown wrote:
> On Tue, Oct 26, 2021 at 11:37:58AM +0100, Srinivas Kandagatla wrote:
> 
>> Am resending this series as I ended up sending incorrect patches for v10.
> 
> If you're sending something different it's not just a new version!
No, this is not different to v10 which I send out Yesterday, v10 is 
meant to address the arm64 build error that you reported.

For some reasons yesterday's patches did not reflect the changes that I 
wanted, so I RESEND v10 again.

--srini


>
Mark Brown Oct. 26, 2021, 10:59 a.m. UTC | #3
On Tue, Oct 26, 2021 at 11:55:37AM +0100, Srinivas Kandagatla wrote:

> No, this is not different to v10 which I send out Yesterday, v10 is meant to
> address the arm64 build error that you reported.

> For some reasons yesterday's patches did not reflect the changes that I
> wanted, so I RESEND v10 again.

OK, but that means that this v10 is different to the v10 that went out
yesterday, right/
Srinivas Kandagatla Oct. 26, 2021, 11:04 a.m. UTC | #4
On 26/10/2021 11:59, Mark Brown wrote:
> On Tue, Oct 26, 2021 at 11:55:37AM +0100, Srinivas Kandagatla wrote:
> 
>> No, this is not different to v10 which I send out Yesterday, v10 is meant to
>> address the arm64 build error that you reported.
> 
>> For some reasons yesterday's patches did not reflect the changes that I
>> wanted, so I RESEND v10 again.
> 
> OK, but that means that this v10 is different to the v10 that went out
> yesterday, right/

Yes it is. I see your point.

I will send out this as V11.

--srini


>
Mark Brown Oct. 26, 2021, 7:06 p.m. UTC | #5
On Tue, 26 Oct 2021 11:37:58 +0100, Srinivas Kandagatla wrote:
> Am resending this series as I ended up sending incorrect patches for v10.
> 
> Sorry for the resend noise.
> 
> This version is a respin of v9 fixing a build error in 12/17 patch.
> 
> QCOM SoC relevant non-audio patches in this series has been merged into
> the Qualcomm drivers-for-5.16 tree, as this series depends those patches
> an immutable tag is available at:
> https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git tags/20210927135559.738-6-srinivas.kandagatla@linaro.org
> 
> [...]

Applied to

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

Thanks!

[01/17] ASoC: dt-bindings: move LPASS dai related bindings out of q6afe
        commit: e1b26ac90287d513699edbb8cae009ec89fe79b7
[02/17] ASoC: dt-bindings: move LPASS clocks related bindings out of q6afe
        commit: e44cfc9d82d8189ea15556052eb9d8640804f954
[03/17] ASoC: dt-bindings: rename q6afe.h to q6dsp-lpass-ports.h
        commit: e3008b7ccb1dedcea954505ff964a53641d2b980
[04/17] ASoC: qdsp6: q6afe-dai: move lpass audio ports to common file
        commit: 95b6cd57e9e8210fca315270ac05ce66fc536703
[05/17] ASoC: qdsp6: q6afe-clocks: move audio-clocks to common file
        commit: 9ab71ac372407acc93045931ed9da867b9415360
[06/17] ASoC: dt-bindings: q6dsp: add q6apm-lpass-dai compatible
        commit: accaa13167363f22835fe904c3ccee8bd624423d
[07/17] ASoC: dt-bindings: lpass-clocks: add q6prm clocks compatible
        commit: c04f02d63d0d9c794df889d396da14f735a270eb
[08/17] ASoC: dt-bindings: add q6apm digital audio stream bindings
        commit: 96d0232564c3b16e9a4286f183e1e6d317521a5a
[09/17] ASoC: qdsp6: audioreach: add basic pkt alloc support
        commit: 44c28dbdb6195b2a92e1fcb2946d1e987658f8b5
[10/17] ASoC: qdsp6: audioreach: add q6apm support
        commit: 5477518b8a0e8a45239646acd80c9bafc4401522
[11/17] ASoC: qdsp6: audioreach: add module configuration command helpers
        commit: 25ab80db6b133c20adb9ee39ce5cfdf347c92d5c
[12/17] ASoC: qdsp6: audioreach: add Kconfig and Makefile
        commit: cf989b68fcadbeeea1446e50fd8b2f24a0f1275c
[13/17] ASoC: qdsp6: audioreach: add topology support
        commit: 36ad9bf1d93d66b901342eab9f8ed6c1537655a6
[14/17] ASoC: qdsp6: audioreach: add q6apm-dai support
        commit: 9b4fe0f1cd791d540100d98a3baf94c1f9994647
[15/17] ASoC: qdsp6: audioreach: add q6apm lpass dai support
        commit: 30ad723b93ade607a678698e5947a55a4375c3a1
[16/17] ASoC: qdsp6: audioreach: add q6prm support
        commit: 9a0e5d6fb16f5a92a8e7e7626666665d0ff79474
[17/17] ASoC: qdsp6: audioreach: add support for q6prm-clocks
        commit: d07568686793f840b4144b19e0a52020b5c7bf94

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