[Sound-open-firmware] [PTACH RFC 0/5] Add switch widget for loopback
From: Pan Xiuli xiuli.pan@linux.intel.com
Have some clean up for the code may used. Add some macros that are needed for the switch widget. TODO: Have the useable get/put function for the kcontrol.
Pan Xiuli (5): topology: mixer: Add CONTROLMIXER_MIN topology: utils: Add kdapm macro for route with kcontrol topology: m4: add switch widget topology: sof: add pipeline loopback dai topology: test: add loopback test topology
topology/m4/mixercontrol.m4 | 16 ++++-- topology/m4/switch.m4 | 46 +++++++++++++++ topology/m4/utils.m4 | 4 ++ topology/sof/pipe-dai-loopback.m4 | 36 ++++++++++++ topology/sof/pipe-low-latency-capture.m4 | 3 +- topology/sof/pipe-low-latency-playback.m4 | 2 + topology/sof/pipe-pcm-media.m4 | 1 + topology/sof/pipe-tone.m4 | 2 + topology/sof/pipe-volume-capture.m4 | 1 + topology/sof/pipe-volume-playback.m4 | 1 + topology/test/test-loopback-ssp.m4 | 94 +++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 12 files changed, 201 insertions(+), 7 deletions(-) create mode 100644 topology/m4/switch.m4 create mode 100644 topology/sof/pipe-dai-loopback.m4 create mode 100644 topology/test/test-loopback-ssp.m4
From: Pan Xiuli xiuli.pan@linux.intel.com
CONTROLMIXER_MIN should go pair with CONTROLMIXER_MAX.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- topology/m4/mixercontrol.m4 | 16 +++++++++++----- topology/sof/pipe-low-latency-capture.m4 | 3 ++- topology/sof/pipe-low-latency-playback.m4 | 2 ++ topology/sof/pipe-pcm-media.m4 | 1 + topology/sof/pipe-tone.m4 | 2 ++ topology/sof/pipe-volume-capture.m4 | 1 + topology/sof/pipe-volume-playback.m4 | 1 + 7 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/topology/m4/mixercontrol.m4 b/topology/m4/mixercontrol.m4 index a3423c3..2a16d2c 100644 --- a/topology/m4/mixercontrol.m4 +++ b/topology/m4/mixercontrol.m4 @@ -14,6 +14,11 @@ define(`CONTROLMIXER_MAX', `#$1' ` max STR($2)')
+dnl CONTROLMIXER_MIN(comment, value) +define(`CONTROLMIXER_MIN', +`#$1' +` min STR($2)') + dnl CONTROLMIXER_TLV(comment, value) define(`CONTROLMIXER_TLV', `#$1' @@ -28,21 +33,22 @@ define(`CONTROLMIXER_OPS', ` put STR($4)' ` }')
-dnl C_CONTROLMIXER(name, index, ops, max, invert, tlv, KCONTROL_CHANNELS) +dnl C_CONTROLMIXER(name, index, ops, min, max, invert, tlv, KCONTROL_CHANNELS) define(`C_CONTROLMIXER', `SectionControlMixer."$1 PIPELINE_ID" {' `' ` # control belongs to this index group' ` index STR($2)' `' -` #$7' -` $8' +` #$8' +` $9' ` # control uses bespoke driver get/put/info ID' ` $3' `' ` $4' -` invert STR($5)' -` $6' +` $5' +` invert STR($6)' +` $7'
`}')
diff --git a/topology/sof/pipe-low-latency-capture.m4 b/topology/sof/pipe-low-latency-capture.m4 index 39be2bc..73340a4 100644 --- a/topology/sof/pipe-low-latency-capture.m4 +++ b/topology/sof/pipe-low-latency-capture.m4 @@ -17,7 +17,8 @@ include(`mixercontrol.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(PCM PCM_ID Capture Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), - CONTROLMIXER_MAX(, 40), + CONTROLMIXER_MIN(, 0), + CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3), Channel register and shift for Front Left/Right, diff --git a/topology/sof/pipe-low-latency-playback.m4 b/topology/sof/pipe-low-latency-playback.m4 index b40b793..b4451ff 100644 --- a/topology/sof/pipe-low-latency-playback.m4 +++ b/topology/sof/pipe-low-latency-playback.m4 @@ -33,6 +33,7 @@ include(`mixercontrol.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(PCM PCM_ID Playback Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3), @@ -42,6 +43,7 @@ C_CONTROLMIXER(PCM PCM_ID Playback Volume, PIPELINE_ID, # Volume Mixer control with max value of 32 C_CONTROLMIXER(Master Playback Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3), diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm-media.m4 index 7f68977..2c0ebee 100644 --- a/topology/sof/pipe-pcm-media.m4 +++ b/topology/sof/pipe-pcm-media.m4 @@ -22,6 +22,7 @@ include(`pcm.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(PCM PCM_ID Playback Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3), diff --git a/topology/sof/pipe-tone.m4 b/topology/sof/pipe-tone.m4 index 3cdd408..2bba8b7 100644 --- a/topology/sof/pipe-tone.m4 +++ b/topology/sof/pipe-tone.m4 @@ -22,6 +22,7 @@ include(`pipeline.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(Tone Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3), @@ -31,6 +32,7 @@ C_CONTROLMIXER(Tone Volume, PIPELINE_ID, # Switch type Mixer Control with max value of 1 C_CONTROLMIXER(Tone Switch, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(max 1 indicates switch type control, 1), false, , diff --git a/topology/sof/pipe-volume-capture.m4 b/topology/sof/pipe-volume-capture.m4 index b3d3206..71ff970 100644 --- a/topology/sof/pipe-volume-capture.m4 +++ b/topology/sof/pipe-volume-capture.m4 @@ -19,6 +19,7 @@ include(`pipeline.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(Master Capture Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3), diff --git a/topology/sof/pipe-volume-playback.m4 b/topology/sof/pipe-volume-playback.m4 index 4b12d2a..163507c 100644 --- a/topology/sof/pipe-volume-playback.m4 +++ b/topology/sof/pipe-volume-playback.m4 @@ -19,6 +19,7 @@ include(`pipeline.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(Master Playback Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3),
Should the prefix be mixer control? mixer might also imply the mixer component?
On Wed, 2018-05-30 at 17:51 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
CONTROLMIXER_MIN should go pair with CONTROLMIXER_MAX.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/m4/mixercontrol.m4 | 16 +++++++++++----- topology/sof/pipe-low-latency-capture.m4 | 3 ++- topology/sof/pipe-low-latency-playback.m4 | 2 ++ topology/sof/pipe-pcm-media.m4 | 1 + topology/sof/pipe-tone.m4 | 2 ++ topology/sof/pipe-volume-capture.m4 | 1 + topology/sof/pipe-volume-playback.m4 | 1 + 7 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/topology/m4/mixercontrol.m4 b/topology/m4/mixercontrol.m4 index a3423c3..2a16d2c 100644 --- a/topology/m4/mixercontrol.m4 +++ b/topology/m4/mixercontrol.m4 @@ -14,6 +14,11 @@ define(`CONTROLMIXER_MAX', `#$1' ` max STR($2)')
+dnl CONTROLMIXER_MIN(comment, value) +define(`CONTROLMIXER_MIN', +`#$1' +` min STR($2)')
dnl CONTROLMIXER_TLV(comment, value) define(`CONTROLMIXER_TLV', `#$1' @@ -28,21 +33,22 @@ define(`CONTROLMIXER_OPS', ` put STR($4)' ` }')
-dnl C_CONTROLMIXER(name, index, ops, max, invert, tlv, KCONTROL_CHANNELS) +dnl C_CONTROLMIXER(name, index, ops, min, max, invert, tlv, KCONTROL_CHANNELS) define(`C_CONTROLMIXER', `SectionControlMixer."$1 PIPELINE_ID" {' `' ` # control belongs to this index group' ` index STR($2)' `' -` #$7' -` $8' +` #$8' +` $9' ` # control uses bespoke driver get/put/info ID' ` $3' `' ` $4' -` invert STR($5)' -` $6' +` $5' +` invert STR($6)' +` $7'
`}')
diff --git a/topology/sof/pipe-low-latency-capture.m4 b/topology/sof/pipe-low-latency-capture.m4 index 39be2bc..73340a4 100644 --- a/topology/sof/pipe-low-latency-capture.m4 +++ b/topology/sof/pipe-low-latency-capture.m4 @@ -17,7 +17,8 @@ include(`mixercontrol.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(PCM PCM_ID Capture Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256),
- CONTROLMIXER_MAX(, 40),
- CONTROLMIXER_MIN(, 0),
- CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
vtlv_m90s3), Channel register and shift for Front Left/Right, diff --git a/topology/sof/pipe-low-latency-playback.m4 b/topology/sof/pipe-low-latency-playback.m4 index b40b793..b4451ff 100644 --- a/topology/sof/pipe-low-latency-playback.m4 +++ b/topology/sof/pipe-low-latency-playback.m4 @@ -33,6 +33,7 @@ include(`mixercontrol.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(PCM PCM_ID Playback Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256),
- CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
vtlv_m90s3), @@ -42,6 +43,7 @@ C_CONTROLMIXER(PCM PCM_ID Playback Volume, PIPELINE_ID, # Volume Mixer control with max value of 32 C_CONTROLMIXER(Master Playback Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256),
- CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
vtlv_m90s3), diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm- media.m4 index 7f68977..2c0ebee 100644 --- a/topology/sof/pipe-pcm-media.m4 +++ b/topology/sof/pipe-pcm-media.m4 @@ -22,6 +22,7 @@ include(`pcm.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(PCM PCM_ID Playback Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256),
- CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
vtlv_m90s3), diff --git a/topology/sof/pipe-tone.m4 b/topology/sof/pipe-tone.m4 index 3cdd408..2bba8b7 100644 --- a/topology/sof/pipe-tone.m4 +++ b/topology/sof/pipe-tone.m4 @@ -22,6 +22,7 @@ include(`pipeline.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(Tone Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256),
- CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
vtlv_m90s3), @@ -31,6 +32,7 @@ C_CONTROLMIXER(Tone Volume, PIPELINE_ID, # Switch type Mixer Control with max value of 1 C_CONTROLMIXER(Tone Switch, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256),
- CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(max 1 indicates switch type control, 1), false, ,
diff --git a/topology/sof/pipe-volume-capture.m4 b/topology/sof/pipe- volume-capture.m4 index b3d3206..71ff970 100644 --- a/topology/sof/pipe-volume-capture.m4 +++ b/topology/sof/pipe-volume-capture.m4 @@ -19,6 +19,7 @@ include(`pipeline.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(Master Capture Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256),
- CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
vtlv_m90s3), diff --git a/topology/sof/pipe-volume-playback.m4 b/topology/sof/pipe-volume-playback.m4 index 4b12d2a..163507c 100644 --- a/topology/sof/pipe-volume-playback.m4 +++ b/topology/sof/pipe-volume-playback.m4 @@ -19,6 +19,7 @@ include(`pipeline.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(Master Playback Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256),
- CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
vtlv_m90s3),
On 5/31/2018 00:02, Ranjani Sridharan wrote:
Should the prefix be mixer control? mixer might also imply the mixer component?
Yes, these naming are very confusing. The switch is implemented by mixer kcontrol. And we also have switch widget and mixer widget.
Thanks Xiuli
On Wed, 2018-05-30 at 17:51 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
CONTROLMIXER_MIN should go pair with CONTROLMIXER_MAX. Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/m4/mixercontrol.m4 | 16 +++++++++++----- topology/sof/pipe-low-latency-capture.m4 | 3 ++- topology/sof/pipe-low-latency-playback.m4 | 2 ++ topology/sof/pipe-pcm-media.m4 | 1 + topology/sof/pipe-tone.m4 | 2 ++ topology/sof/pipe-volume-capture.m4 | 1 + topology/sof/pipe-volume-playback.m4 | 1 + 7 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/topology/m4/mixercontrol.m4 b/topology/m4/mixercontrol.m4 index a3423c3..2a16d2c 100644 --- a/topology/m4/mixercontrol.m4 +++ b/topology/m4/mixercontrol.m4 @@ -14,6 +14,11 @@ define(`CONTROLMIXER_MAX', `#$1' ` max STR($2)')
+dnl CONTROLMIXER_MIN(comment, value) +define(`CONTROLMIXER_MIN', +`#$1' +` min STR($2)')
- dnl CONTROLMIXER_TLV(comment, value) define(`CONTROLMIXER_TLV', `#$1'
@@ -28,21 +33,22 @@ define(`CONTROLMIXER_OPS', ` put STR($4)' ` }')
-dnl C_CONTROLMIXER(name, index, ops, max, invert, tlv, KCONTROL_CHANNELS) +dnl C_CONTROLMIXER(name, index, ops, min, max, invert, tlv, KCONTROL_CHANNELS) define(`C_CONTROLMIXER', `SectionControlMixer."$1 PIPELINE_ID" {' `' ` # control belongs to this index group' ` index STR($2)' `' -` #$7' -` $8' +` #$8' +` $9' ` # control uses bespoke driver get/put/info ID' ` $3' `' ` $4' -` invert STR($5)' -` $6' +` $5' +` invert STR($6)' +` $7'
`}')
diff --git a/topology/sof/pipe-low-latency-capture.m4 b/topology/sof/pipe-low-latency-capture.m4 index 39be2bc..73340a4 100644 --- a/topology/sof/pipe-low-latency-capture.m4 +++ b/topology/sof/pipe-low-latency-capture.m4 @@ -17,7 +17,8 @@ include(`mixercontrol.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(PCM PCM_ID Capture Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256),
- CONTROLMIXER_MAX(, 40),
- CONTROLMIXER_MIN(, 0),
- CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
vtlv_m90s3), Channel register and shift for Front Left/Right, diff --git a/topology/sof/pipe-low-latency-playback.m4 b/topology/sof/pipe-low-latency-playback.m4 index b40b793..b4451ff 100644 --- a/topology/sof/pipe-low-latency-playback.m4 +++ b/topology/sof/pipe-low-latency-playback.m4 @@ -33,6 +33,7 @@ include(`mixercontrol.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(PCM PCM_ID Playback Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256),
- CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
vtlv_m90s3), @@ -42,6 +43,7 @@ C_CONTROLMIXER(PCM PCM_ID Playback Volume, PIPELINE_ID, # Volume Mixer control with max value of 32 C_CONTROLMIXER(Master Playback Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256),
- CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
vtlv_m90s3), diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm- media.m4 index 7f68977..2c0ebee 100644 --- a/topology/sof/pipe-pcm-media.m4 +++ b/topology/sof/pipe-pcm-media.m4 @@ -22,6 +22,7 @@ include(`pcm.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(PCM PCM_ID Playback Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256),
- CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
vtlv_m90s3), diff --git a/topology/sof/pipe-tone.m4 b/topology/sof/pipe-tone.m4 index 3cdd408..2bba8b7 100644 --- a/topology/sof/pipe-tone.m4 +++ b/topology/sof/pipe-tone.m4 @@ -22,6 +22,7 @@ include(`pipeline.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(Tone Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256),
- CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
vtlv_m90s3), @@ -31,6 +32,7 @@ C_CONTROLMIXER(Tone Volume, PIPELINE_ID, # Switch type Mixer Control with max value of 1 C_CONTROLMIXER(Tone Switch, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256),
- CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(max 1 indicates switch type control, 1), false, ,
diff --git a/topology/sof/pipe-volume-capture.m4 b/topology/sof/pipe- volume-capture.m4 index b3d3206..71ff970 100644 --- a/topology/sof/pipe-volume-capture.m4 +++ b/topology/sof/pipe-volume-capture.m4 @@ -19,6 +19,7 @@ include(`pipeline.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(Master Capture Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256),
- CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
vtlv_m90s3), diff --git a/topology/sof/pipe-volume-playback.m4 b/topology/sof/pipe-volume-playback.m4 index 4b12d2a..163507c 100644 --- a/topology/sof/pipe-volume-playback.m4 +++ b/topology/sof/pipe-volume-playback.m4 @@ -19,6 +19,7 @@ include(`pipeline.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(Master Playback Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256),
- CONTROLMIXER_MIN(, 0), CONTROLMIXER_MAX(, 32), false, CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
vtlv_m90s3),
On Wed, 2018-05-30 at 17:51 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
CONTROLMIXER_MIN should go pair with CONTROLMIXER_MAX.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/m4/mixercontrol.m4 | 16 +++++++++++----- topology/sof/pipe-low-latency-capture.m4 | 3 ++- topology/sof/pipe-low-latency-playback.m4 | 2 ++ topology/sof/pipe-pcm-media.m4 | 1 + topology/sof/pipe-tone.m4 | 2 ++ topology/sof/pipe-volume-capture.m4 | 1 + topology/sof/pipe-volume-playback.m4 | 1 + 7 files changed, 20 insertions(+), 6 deletions(-)
Why is this needed ? Commit message is very sparse.
Liam
From: Pan Xiuli xiuli.pan@linux.intel.com
mixer with kcontrol need the path name match the kcontrol name. Add the macro to include the kcontrol in the dapm route
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- topology/m4/utils.m4 | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/topology/m4/utils.m4 b/topology/m4/utils.m4 index 73faae6..3af586a 100644 --- a/topology/m4/utils.m4 +++ b/topology/m4/utils.m4 @@ -26,6 +26,10 @@ define(`MEMCAPS', `pushdef(`i', $#) pushdef(`j', `1') SUM_LOOP($@)') dnl create direct DAPM/pipeline link between 2 widgets) define(`dapm', `"$1, , $2"')
+dnl create DAPM/pipeline link between 2 widgets with kcontrol) +define(`kdapm', `"$1, $2, $3"') + + dnl COMP_SAMPLE_SIZE(FMT) define(`COMP_SAMPLE_SIZE', `ifelse(
On 2018年05月30日 17:51, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
mixer with kcontrol need the path name match the kcontrol name. Add the macro to include the kcontrol in the dapm route
Thinking it more, I realize that we don't need the LBM switch to be added between other 2 widgets, it only change the content of the capture pipeline, but not any on/off for playback/capture pipelines, from this aspect, it is somewhat like a muxer.
Thanks, ~Keyon
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/m4/utils.m4 | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/topology/m4/utils.m4 b/topology/m4/utils.m4 index 73faae6..3af586a 100644 --- a/topology/m4/utils.m4 +++ b/topology/m4/utils.m4 @@ -26,6 +26,10 @@ define(`MEMCAPS', `pushdef(`i', $#) pushdef(`j', `1') SUM_LOOP($@)') dnl create direct DAPM/pipeline link between 2 widgets) define(`dapm', `"$1, , $2"')
+dnl create DAPM/pipeline link between 2 widgets with kcontrol) +define(`kdapm', `"$1, $2, $3"')
- dnl COMP_SAMPLE_SIZE(FMT) define(`COMP_SAMPLE_SIZE', `ifelse(
On Thu, 2018-05-31 at 09:02 +0800, Keyon Jie wrote:
On 2018年05月30日 17:51, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
mixer with kcontrol need the path name match the kcontrol name. Add the macro to include the kcontrol in the dapm route
Thinking it more, I realize that we don't need the LBM switch to be added between other 2 widgets, it only change the content of the capture pipeline, but not any on/off for playback/capture pipelines, from this aspect, it is somewhat like a muxer.
Maybe I am missing the point here but why cant we tap the buffer feeding into the DAI for the loopback mode?
Is the idea to also be able to play the audio on the SSP?
Thanks, ~Keyon
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/m4/utils.m4 | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/topology/m4/utils.m4 b/topology/m4/utils.m4 index 73faae6..3af586a 100644 --- a/topology/m4/utils.m4 +++ b/topology/m4/utils.m4 @@ -26,6 +26,10 @@ define(`MEMCAPS', `pushdef(`i', $#) pushdef(`j', `1') SUM_LOOP($@)') dnl create direct DAPM/pipeline link between 2 widgets) define(`dapm', `"$1, , $2"')
+dnl create DAPM/pipeline link between 2 widgets with kcontrol) +define(`kdapm', `"$1, $2, $3"')
- dnl COMP_SAMPLE_SIZE(FMT) define(`COMP_SAMPLE_SIZE', `ifelse(
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On 5/31/2018 09:02, Keyon Jie wrote:
On 2018年05月30日 17:51, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
mixer with kcontrol need the path name match the kcontrol name. Add the macro to include the kcontrol in the dapm route
Thinking it more, I realize that we don't need the LBM switch to be added between other 2 widgets, it only change the content of the capture pipeline, but not any on/off for playback/capture pipelines, from this aspect, it is somewhat like a muxer.
This patch may be helpful for our future usage of mixer/switch widget. The DAPM will not expose a kcontrol for a mixer if it is not on the route.
Thanks Xiuli
Thanks, ~Keyon
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/m4/utils.m4 | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/topology/m4/utils.m4 b/topology/m4/utils.m4 index 73faae6..3af586a 100644 --- a/topology/m4/utils.m4 +++ b/topology/m4/utils.m4 @@ -26,6 +26,10 @@ define(`MEMCAPS', `pushdef(`i', $#) pushdef(`j', `1') SUM_LOOP($@)') dnl create direct DAPM/pipeline link between 2 widgets) define(`dapm', `"$1, , $2"') +dnl create DAPM/pipeline link between 2 widgets with kcontrol) +define(`kdapm', `"$1, $2, $3"')
dnl COMP_SAMPLE_SIZE(FMT) define(`COMP_SAMPLE_SIZE', `ifelse(
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On Wed, 2018-05-30 at 17:51 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
mixer with kcontrol need the path name match the kcontrol name. Add the macro to include the kcontrol in the dapm route
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/m4/utils.m4 | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/topology/m4/utils.m4 b/topology/m4/utils.m4 index 73faae6..3af586a 100644 --- a/topology/m4/utils.m4 +++ b/topology/m4/utils.m4 @@ -26,6 +26,10 @@ define(`MEMCAPS', `pushdef(`i', $#) pushdef(`j', `1') SUM_LOOP($@)') dnl create direct DAPM/pipeline link between 2 widgets) define(`dapm', `"$1, , $2"')
+dnl create DAPM/pipeline link between 2 widgets with kcontrol) +define(`kdapm', `"$1, $2, $3"')
I would change the name to dapm_path
Liam
dnl COMP_SAMPLE_SIZE(FMT) define(`COMP_SAMPLE_SIZE', `ifelse(
From: Pan Xiuli xiuli.pan@linux.intel.com
Add macro to build for switch widget
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- topology/m4/switch.m4 | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 topology/m4/switch.m4
diff --git a/topology/m4/switch.m4 b/topology/m4/switch.m4 new file mode 100644 index 0000000..33be9f2 --- /dev/null +++ b/topology/m4/switch.m4 @@ -0,0 +1,46 @@ +divert(-1) + +dnl Define macro for Switch widget + +dnl Mixer Name) +define(`N_SWITCH', `SWITCH'PIPELINE_ID`.'$1) + +dnl Pipe Buffer name in pipeline (pipeline, buffer) +define(`NPIPELINE_SWITCH', `SWITCH'$1`.'$2) + +dnl W_SWITCH(name, format, periods_sink, periods_source, preload, kcontrols_list) +define(`W_SWITCH', +`SectionVendorTuples."'N_SWITCH($1)`_tuples_w" {' +` tokens "sof_comp_tokens"' +` tuples."word" {' +` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($3) +` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($4) +` SOF_TKN_COMP_PRELOAD_COUNT' STR($5) +` }' +`}' +`SectionData."'N_SWITCH($1)`_data_w" {' +` tuples "'N_SWITCH($1)`_tuples_w"' +`}' +`SectionVendorTuples."'N_SWITCH($1)`_tuples_str" {' +` tokens "sof_comp_tokens"' +` tuples."string" {' +` SOF_TKN_COMP_FORMAT' STR($2) +` }' +`}' +`SectionData."'N_SWITCH($1)`_data_str" {' +` tuples "'N_SWITCH($1)`_tuples_str"' +`}' +`SectionWidget."'N_SWITCH($1)`" {' +` index "'PIPELINE_ID`"' +` type "mixer"' +` no_pm "true"' +` data [' +` "'N_SWITCH($1)`_data_w"' +` "'N_SWITCH($1)`_data_str"' +` ]' +` mixer [' + $6 +` ]' +`}') + +divert(0)dnl
On Wed, 2018-05-30 at 17:51 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Add macro to build for switch widget
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/m4/switch.m4 | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 topology/m4/switch.m4
diff --git a/topology/m4/switch.m4 b/topology/m4/switch.m4 new file mode 100644 index 0000000..33be9f2 --- /dev/null +++ b/topology/m4/switch.m4 @@ -0,0 +1,46 @@ +divert(-1)
+dnl Define macro for Switch widget
+dnl Mixer Name) +define(`N_SWITCH', `SWITCH'PIPELINE_ID`.'$1)
+dnl Pipe Buffer name in pipeline (pipeline, buffer) +define(`NPIPELINE_SWITCH', `SWITCH'$1`.'$2)
+dnl W_SWITCH(name, format, periods_sink, periods_source, preload, kcontrols_list) +define(`W_SWITCH', +`SectionVendorTuples."'N_SWITCH($1)`_tuples_w" {' +` tokens "sof_comp_tokens"' +` tuples."word" {' +` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR( $3) +` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($4) +` SOF_TKN_COMP_PRELOAD_COUNT' STR($5) +` }' +`}' +`SectionData."'N_SWITCH($1)`_data_w" {' +` tuples "'N_SWITCH($1)`_tuples_w"' +`}' +`SectionVendorTuples."'N_SWITCH($1)`_tuples_str" {' +` tokens "sof_comp_tokens"' +` tuples."string" {' +` SOF_TKN_COMP_FORMAT' STR($2) +` }' +`}' +`SectionData."'N_SWITCH($1)`_data_str" {' +` tuples "'N_SWITCH($1)`_tuples_str"' +`}' +`SectionWidget."'N_SWITCH($1)`" {' +` index "'PIPELINE_ID`"' +` type "mixer"'
Is this a misnomer maybe, there's already a mixer widget in mixer.m4 thats type "mixer". If not, maybe we use that instead?
+` no_pm "true"' +` data [' +` "'N_SWITCH($1)`_data_w"' +` "'N_SWITCH($1)`_data_str"' +` ]' +` mixer ['
$6
+` ]' +`}')
+divert(0)dnl
On 5/31/2018 00:04, Ranjani Sridharan wrote:
On Wed, 2018-05-30 at 17:51 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Add macro to build for switch widget
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/m4/switch.m4 | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 topology/m4/switch.m4
diff --git a/topology/m4/switch.m4 b/topology/m4/switch.m4 new file mode 100644 index 0000000..33be9f2 --- /dev/null +++ b/topology/m4/switch.m4 @@ -0,0 +1,46 @@ +divert(-1)
+dnl Define macro for Switch widget
+dnl Mixer Name) +define(`N_SWITCH', `SWITCH'PIPELINE_ID`.'$1)
+dnl Pipe Buffer name in pipeline (pipeline, buffer) +define(`NPIPELINE_SWITCH', `SWITCH'$1`.'$2)
+dnl W_SWITCH(name, format, periods_sink, periods_source, preload, kcontrols_list) +define(`W_SWITCH', +`SectionVendorTuples."'N_SWITCH($1)`_tuples_w" {' +` tokens "sof_comp_tokens"' +` tuples."word" {' +` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR( $3) +` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($4) +` SOF_TKN_COMP_PRELOAD_COUNT' STR($5) +` }' +`}' +`SectionData."'N_SWITCH($1)`_data_w" {' +` tuples "'N_SWITCH($1)`_tuples_w"' +`}' +`SectionVendorTuples."'N_SWITCH($1)`_tuples_str" {' +` tokens "sof_comp_tokens"' +` tuples."string" {' +` SOF_TKN_COMP_FORMAT' STR($2) +` }' +`}' +`SectionData."'N_SWITCH($1)`_data_str" {' +` tuples "'N_SWITCH($1)`_tuples_str"' +`}' +`SectionWidget."'N_SWITCH($1)`" {' +` index "'PIPELINE_ID`"' +` type "mixer"'
Is this a misnomer maybe, there's already a mixer widget in mixer.m4 thats type "mixer". If not, maybe we use that instead?
Sorry, this is a copy paste typo. I will change it to "switch"
Thanks Xiuli
+` no_pm "true"' +` data [' +` "'N_SWITCH($1)`_data_w"' +` "'N_SWITCH($1)`_data_str"' +` ]' +` mixer ['
$6
+` ]' +`}')
+divert(0)dnl
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On Thu, 2018-05-31 at 10:09 +0800, Pan, Xiuli wrote:
On 5/31/2018 00:04, Ranjani Sridharan wrote:
On Wed, 2018-05-30 at 17:51 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Add macro to build for switch widget
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/m4/switch.m4 | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 topology/m4/switch.m4
diff --git a/topology/m4/switch.m4 b/topology/m4/switch.m4 new file mode 100644 index 0000000..33be9f2 --- /dev/null +++ b/topology/m4/switch.m4 @@ -0,0 +1,46 @@ +divert(-1)
+dnl Define macro for Switch widget
+dnl Mixer Name) +define(`N_SWITCH', `SWITCH'PIPELINE_ID`.'$1)
+dnl Pipe Buffer name in pipeline (pipeline, buffer) +define(`NPIPELINE_SWITCH', `SWITCH'$1`.'$2)
+dnl W_SWITCH(name, format, periods_sink, periods_source, preload, kcontrols_list) +define(`W_SWITCH', +`SectionVendorTuples."'N_SWITCH($1)`_tuples_w" {' +` tokens "sof_comp_tokens"' +` tuples."word" {' +` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR( $3) +` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($4 ) +` SOF_TKN_COMP_PRELOAD_COUNT' STR( $5) +` }' +`}' +`SectionData."'N_SWITCH($1)`_data_w" {' +` tuples "'N_SWITCH($1)`_tuples_w"' +`}' +`SectionVendorTuples."'N_SWITCH($1)`_tuples_str" {' +` tokens "sof_comp_tokens"' +` tuples."string" {' +` SOF_TKN_COMP_FORMAT' STR($2) +` }' +`}' +`SectionData."'N_SWITCH($1)`_data_str" {' +` tuples "'N_SWITCH($1)`_tuples_str"' +`}' +`SectionWidget."'N_SWITCH($1)`" {' +` index "'PIPELINE_ID`"' +` type "mixer"'
Is this a misnomer maybe, there's already a mixer widget in mixer.m4 thats type "mixer". If not, maybe we use that instead?
Sorry, this is a copy paste typo. I will change it to "switch"
Xiuli, widget types are described in soc-dapm.h.
A switch type widget is described as follows:
snd_soc_dapm_switch, /* analog switch */
Are you sure we want this here?
Thanks Xiuli
+` no_pm "true"' +` data [' +` "'N_SWITCH($1)`_data_w"' +` "'N_SWITCH($1)`_data_str"' +` ]' +` mixer ['
$6
+` ]' +`}')
+divert(0)dnl
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmwar e
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On Wed, 2018-05-30 at 17:51 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Add macro to build for switch widget
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/m4/switch.m4 | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 topology/m4/switch.m4
diff --git a/topology/m4/switch.m4 b/topology/m4/switch.m4 new file mode 100644 index 0000000..33be9f2 --- /dev/null +++ b/topology/m4/switch.m4 @@ -0,0 +1,46 @@ +divert(-1)
+dnl Define macro for Switch widget
+dnl Mixer Name) +define(`N_SWITCH', `SWITCH'PIPELINE_ID`.'$1)
+dnl Pipe Buffer name in pipeline (pipeline, buffer) +define(`NPIPELINE_SWITCH', `SWITCH'$1`.'$2)
+dnl W_SWITCH(name, format, periods_sink, periods_source, preload, kcontrols_list)
preload deprecated so can be removed.
+define(`W_SWITCH', +`SectionVendorTuples."'N_SWITCH($1)`_tuples_w" {' +` tokens "sof_comp_tokens"' +` tuples."word" {' +` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($3) +` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($4) +` SOF_TKN_COMP_PRELOAD_COUNT' STR($5) +` }' +`}' +`SectionData."'N_SWITCH($1)`_data_w" {' +` tuples "'N_SWITCH($1)`_tuples_w"' +`}' +`SectionVendorTuples."'N_SWITCH($1)`_tuples_str" {' +` tokens "sof_comp_tokens"' +` tuples."string" {' +` SOF_TKN_COMP_FORMAT' STR($2) +` }' +`}' +`SectionData."'N_SWITCH($1)`_data_str" {' +` tuples "'N_SWITCH($1)`_tuples_str"' +`}' +`SectionWidget."'N_SWITCH($1)`" {' +` index "'PIPELINE_ID`"' +` type "mixer"' +` no_pm "true"' +` data [' +` "'N_SWITCH($1)`_data_w"' +` "'N_SWITCH($1)`_data_str"' +` ]' +` mixer ['
$6
+` ]' +`}')
+divert(0)dnl
From: Pan Xiuli xiuli.pan@linux.intel.com
Add a switch widget for playback dai as the loopback dai. The switch will control the software dai loopback.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- topology/sof/pipe-dai-loopback.m4 | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 topology/sof/pipe-dai-loopback.m4
diff --git a/topology/sof/pipe-dai-loopback.m4 b/topology/sof/pipe-dai-loopback.m4 new file mode 100644 index 0000000..e62f6b0 --- /dev/null +++ b/topology/sof/pipe-dai-loopback.m4 @@ -0,0 +1,36 @@ +# DAI Playback connector + +# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4') +include(`mixercontrol.m4') +include(`switch.m4') + +# +# DAI definitions +# +C_CONTROLMIXER(Loop Back Switch, PIPELINE_ID, + CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, volsw, volsw), + CONTROLMIXER_MIN(, 0), + CONTROLMIXER_MAX(, 1), + false, + , + Channel register and shift for Front Left/Right, + LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), KCONTROL_CHANNEL(FR, 2, 1))) + +W_DAI_OUT(DAI_TYPE, DAI_INDEX, DAI_BE, DAI_FORMAT, 0, 2, 2, dai0p_plat_conf) +W_SWITCH(LoopBack, DAI_FORMAT, 1, 1, 1, LIST(` ', "Loop Back Switch PIPELINE_ID")) + +# +# DAI pipeline - always use 0 for DAIs +# +W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, 0, pipe_dai_schedule_plat) + +# +# Graph connections to pipelines + +P_GRAPH(DAI_NAME, PIPELINE_ID, + LIST(` ', + `kdapm(N_SWITCH(LoopBack), Loop Back Switch PIPELINE_ID, DAI_BUF)', + `dapm(N_DAI_OUT, N_SWITCH(LoopBack))'))
On 2018年05月30日 17:51, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Add a switch widget for playback dai as the loopback dai. The switch will control the software dai loopback.
This should belong to a DAI, not pipeline, we should add LBM switch for each dai(or actually SSP), not for specific playback or capture pipelines.
Thanks, ~Keyon
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/sof/pipe-dai-loopback.m4 | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 topology/sof/pipe-dai-loopback.m4
diff --git a/topology/sof/pipe-dai-loopback.m4 b/topology/sof/pipe-dai-loopback.m4 new file mode 100644 index 0000000..e62f6b0 --- /dev/null +++ b/topology/sof/pipe-dai-loopback.m4 @@ -0,0 +1,36 @@ +# DAI Playback connector
+# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4') +include(`mixercontrol.m4') +include(`switch.m4')
+# +# DAI definitions +# +C_CONTROLMIXER(Loop Back Switch, PIPELINE_ID,
- CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, volsw, volsw),
- CONTROLMIXER_MIN(, 0),
- CONTROLMIXER_MAX(, 1),
- false,
- ,
- Channel register and shift for Front Left/Right,
- LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), KCONTROL_CHANNEL(FR, 2, 1)))
+W_DAI_OUT(DAI_TYPE, DAI_INDEX, DAI_BE, DAI_FORMAT, 0, 2, 2, dai0p_plat_conf) +W_SWITCH(LoopBack, DAI_FORMAT, 1, 1, 1, LIST(` ', "Loop Back Switch PIPELINE_ID"))
+# +# DAI pipeline - always use 0 for DAIs +# +W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, 0, pipe_dai_schedule_plat)
+# +# Graph connections to pipelines
+P_GRAPH(DAI_NAME, PIPELINE_ID,
- LIST(` ',
- `kdapm(N_SWITCH(LoopBack), Loop Back Switch PIPELINE_ID, DAI_BUF)',
- `dapm(N_DAI_OUT, N_SWITCH(LoopBack))'))
On 5/31/2018 08:53, Keyon Jie wrote:
On 2018年05月30日 17:51, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Add a switch widget for playback dai as the loopback dai. The switch will control the software dai loopback.
This should belong to a DAI, not pipeline, we should add LBM switch for each dai(or actually SSP), not for specific playback or capture pipelines.
I tried with DAI. DAPM will not expose any kcontrol for a DAI.
Thanks Xiuli
Thanks, ~Keyon
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/sof/pipe-dai-loopback.m4 | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 topology/sof/pipe-dai-loopback.m4
diff --git a/topology/sof/pipe-dai-loopback.m4 b/topology/sof/pipe-dai-loopback.m4 new file mode 100644 index 0000000..e62f6b0 --- /dev/null +++ b/topology/sof/pipe-dai-loopback.m4 @@ -0,0 +1,36 @@ +# DAI Playback connector
+# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4') +include(`mixercontrol.m4') +include(`switch.m4')
+# +# DAI definitions +# +C_CONTROLMIXER(Loop Back Switch, PIPELINE_ID, + CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, volsw, volsw), + CONTROLMIXER_MIN(, 0), + CONTROLMIXER_MAX(, 1), + false, + , + Channel register and shift for Front Left/Right, + LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), KCONTROL_CHANNEL(FR, 2, 1)))
+W_DAI_OUT(DAI_TYPE, DAI_INDEX, DAI_BE, DAI_FORMAT, 0, 2, 2, dai0p_plat_conf) +W_SWITCH(LoopBack, DAI_FORMAT, 1, 1, 1, LIST(` ', "Loop Back Switch PIPELINE_ID"))
+# +# DAI pipeline - always use 0 for DAIs +# +W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, 0, pipe_dai_schedule_plat)
+# +# Graph connections to pipelines
+P_GRAPH(DAI_NAME, PIPELINE_ID, + LIST(` ', + `kdapm(N_SWITCH(LoopBack), Loop Back Switch PIPELINE_ID, DAI_BUF)', + `dapm(N_DAI_OUT, N_SWITCH(LoopBack))'))
From: Pan Xiuli xiuli.pan@linux.intel.com
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- topology/test/test-loopback-ssp.m4 | 94 ++++++++++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 topology/test/test-loopback-ssp.m4
diff --git a/topology/test/test-loopback-ssp.m4 b/topology/test/test-loopback-ssp.m4 new file mode 100644 index 0000000..886876f --- /dev/null +++ b/topology/test/test-loopback-ssp.m4 @@ -0,0 +1,94 @@ +# +# Topology for pass through pipeline +# + +# Include topology builder +include(`dai.m4') +include(`utils.m4') +include(`pipeline.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Baytrail DSP configuration +include(`dsps/byt.m4') + +# +# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! +# +# TEST_PIPE_NAME - Pipe name +# TEST_DAI_LINK_NAME - BE DAI link name e.g. "NoCodec" +# TEST_SSP_PORT - SSP port number e.g. 2 +# TEST_SSP_FORMAT - SSP data format e.g s16le +# TEST_PIPE_FORMAT - Pipeline format e.g. s16le +# TEST_SSP_MCLK - SSP BCLK in Hz +# TEST_SSP_BCLK - SSP BCLK in Hz +# TEST_SSP_PHY_BITS - SSP physical slot size +# TEST_SSP_DATA_BITS - SSP data slot size +# TEST_SSP_MODE - SSP mode e.g. I2S, LEFT_J, DSP_A and DSP_B +# + +# +# Define the pipeline +# +# PCM0 <-- TEST_PIPE_NAME pipe --> SSP TEST_SSP_PORT +# +# + +# Passthrough playback pipeline 1 on PCM 0 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data + +PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-playback.m4, + 1, 0, 2, TEST_PIPE_FORMAT, + 48, 1000, 0, 0, 0, 1, + SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2) + + +# Passthrough playback pipeline 2 on PCM 0 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data + +PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-capture.m4, + 2, 0, 2, TEST_PIPE_FORMAT, + 48, 1000, 0, 0, 0, 1, + SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2) + +# +# DAI configuration +# +# SSP port TEST_SSP_PORT is our only pipeline DAI +# + +# playback DAI is SSP TEST_SSP_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-loopback.m4, + 1, SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, + PIPELINE_SOURCE_1, 2, TEST_SSP_FORMAT, + 48, 1000, 0, 0) + +# capture DAI is SSP TEST_SSP_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4, + 2, SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, + PIPELINE_SINK_2, 2, TEST_SSP_FORMAT, + 48, 1000, 0, 0) + +# PCM Passthrough +PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) + +# +# BE configurations - overrides config in ACPI if present +# +# Clocks masters wrt codec +# +# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT +# +DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, TEST_SSP_MODE, TEST_SSP_DATA_BITS, + DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in), + DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3)) diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index c88537b..43379d7 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -12,7 +12,7 @@ export M4PATH="../:../m4:../common"
# Simple component test cases # can be used on components with 1 sink and 1 source. -SIMPLE_TESTS=(test-ssp test-capture-ssp test-playback-ssp) +SIMPLE_TESTS=(test-ssp test-capture-ssp test-playback-ssp test-loopback-ssp) TONE_TEST=test-tone-playback-ssp TEST_STRINGS="" M4_STRINGS=""
Please ignore this patch with typo.
On 5/30/2018 17:51, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/test/test-loopback-ssp.m4 | 94 ++++++++++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 topology/test/test-loopback-ssp.m4
diff --git a/topology/test/test-loopback-ssp.m4 b/topology/test/test-loopback-ssp.m4 new file mode 100644 index 0000000..886876f --- /dev/null +++ b/topology/test/test-loopback-ssp.m4 @@ -0,0 +1,94 @@ +# +# Topology for pass through pipeline +#
+# Include topology builder +include(`dai.m4') +include(`utils.m4') +include(`pipeline.m4')
+# Include TLV library +include(`common/tlv.m4')
+# Include Token library +include(`sof/tokens.m4')
+# Include Baytrail DSP configuration +include(`dsps/byt.m4')
+# +# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! +# +# TEST_PIPE_NAME - Pipe name +# TEST_DAI_LINK_NAME - BE DAI link name e.g. "NoCodec" +# TEST_SSP_PORT - SSP port number e.g. 2 +# TEST_SSP_FORMAT - SSP data format e.g s16le +# TEST_PIPE_FORMAT - Pipeline format e.g. s16le +# TEST_SSP_MCLK - SSP BCLK in Hz +# TEST_SSP_BCLK - SSP BCLK in Hz +# TEST_SSP_PHY_BITS - SSP physical slot size +# TEST_SSP_DATA_BITS - SSP data slot size +# TEST_SSP_MODE - SSP mode e.g. I2S, LEFT_J, DSP_A and DSP_B +#
+# +# Define the pipeline +# +# PCM0 <-- TEST_PIPE_NAME pipe --> SSP TEST_SSP_PORT +# +#
+# Passthrough playback pipeline 1 on PCM 0 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data
+PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-playback.m4,
- 1, 0, 2, TEST_PIPE_FORMAT,
- 48, 1000, 0, 0, 0, 1,
- SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2)
+# Passthrough playback pipeline 2 on PCM 0 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data
+PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-capture.m4,
- 2, 0, 2, TEST_PIPE_FORMAT,
- 48, 1000, 0, 0, 0, 1,
- SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2)
+# +# DAI configuration +# +# SSP port TEST_SSP_PORT is our only pipeline DAI +#
+# playback DAI is SSP TEST_SSP_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-loopback.m4,
- 1, SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME,
- PIPELINE_SOURCE_1, 2, TEST_SSP_FORMAT,
- 48, 1000, 0, 0)
+# capture DAI is SSP TEST_SSP_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4,
- 2, SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME,
- PIPELINE_SINK_2, 2, TEST_SSP_FORMAT,
- 48, 1000, 0, 0)
+# PCM Passthrough +PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
+# +# BE configurations - overrides config in ACPI if present +# +# Clocks masters wrt codec +# +# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT +# +DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, TEST_SSP_MODE, TEST_SSP_DATA_BITS,
- DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in),
- DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave),
- DAI_CLOCK(fsync, 48000, codec_slave),
- DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3))
diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index c88537b..43379d7 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -12,7 +12,7 @@ export M4PATH="../:../m4:../common"
# Simple component test cases # can be used on components with 1 sink and 1 source. -SIMPLE_TESTS=(test-ssp test-capture-ssp test-playback-ssp) +SIMPLE_TESTS=(test-ssp test-capture-ssp test-playback-ssp test-loopback-ssp) TONE_TEST=test-tone-playback-ssp TEST_STRINGS="" M4_STRINGS=""
On Wed, 2018-05-30 at 17:51 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/test/test-loopback-ssp.m4 | 94 ++++++++++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 topology/test/test-loopback-ssp.m4
diff --git a/topology/test/test-loopback-ssp.m4 b/topology/test/test- loopback-ssp.m4
Could we please avoid hardcoding test file names with the DAI type? It is much easier to re-use these if we dont. I just had to clean up the original ones so I could use the same with DMIC.
new file mode 100644 index 0000000..886876f --- /dev/null +++ b/topology/test/test-loopback-ssp.m4 @@ -0,0 +1,94 @@ +# +# Topology for pass through pipeline +#
+# Include topology builder +include(`dai.m4') +include(`utils.m4') +include(`pipeline.m4')
+# Include TLV library +include(`common/tlv.m4')
+# Include Token library +include(`sof/tokens.m4')
+# Include Baytrail DSP configuration +include(`dsps/byt.m4')
+# +# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! +# +# TEST_PIPE_NAME - Pipe name +# TEST_DAI_LINK_NAME - BE DAI link name e.g. "NoCodec" +# TEST_SSP_PORT - SSP port number e.g. 2 +# TEST_SSP_FORMAT - SSP data format e.g s16le +# TEST_PIPE_FORMAT - Pipeline format e.g. s16le +# TEST_SSP_MCLK - SSP BCLK in Hz +# TEST_SSP_BCLK - SSP BCLK in Hz +# TEST_SSP_PHY_BITS - SSP physical slot size +# TEST_SSP_DATA_BITS - SSP data slot size +# TEST_SSP_MODE - SSP mode e.g. I2S, LEFT_J, DSP_A and DSP_B +#
+# +# Define the pipeline +# +# PCM0 <-- TEST_PIPE_NAME pipe --> SSP TEST_SSP_PORT +# +#
+# Passthrough playback pipeline 1 on PCM 0 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data
+PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-playback.m4,
- 1, 0, 2, TEST_PIPE_FORMAT,
- 48, 1000, 0, 0, 0, 1,
- SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2)
+# Passthrough playback pipeline 2 on PCM 0 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data
+PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-capture.m4,
- 2, 0, 2, TEST_PIPE_FORMAT,
- 48, 1000, 0, 0, 0, 1,
- SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2)
+# +# DAI configuration +# +# SSP port TEST_SSP_PORT is our only pipeline DAI +#
+# playback DAI is SSP TEST_SSP_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-loopback.m4,
- 1, SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME,
- PIPELINE_SOURCE_1, 2, TEST_SSP_FORMAT,
- 48, 1000, 0, 0)
+# capture DAI is SSP TEST_SSP_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4,
- 2, SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME,
- PIPELINE_SINK_2, 2, TEST_SSP_FORMAT,
- 48, 1000, 0, 0)
+# PCM Passthrough +PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
+# +# BE configurations - overrides config in ACPI if present +# +# Clocks masters wrt codec +# +# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT +# +DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, TEST_SSP_MODE, TEST_SSP_DATA_BITS,
- DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in),
- DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave),
- DAI_CLOCK(fsync, 48000, codec_slave),
- DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3))
diff --git a/topology/test/tplg-build.sh b/topology/test/tplg- build.sh index c88537b..43379d7 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -12,7 +12,7 @@ export M4PATH="../:../m4:../common"
# Simple component test cases # can be used on components with 1 sink and 1 source. -SIMPLE_TESTS=(test-ssp test-capture-ssp test-playback-ssp) +SIMPLE_TESTS=(test-ssp test-capture-ssp test-playback-ssp test- loopback-ssp) TONE_TEST=test-tone-playback-ssp TEST_STRINGS="" M4_STRINGS=""
On 2018年05月30日 17:51, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/test/test-loopback-ssp.m4 | 94 ++++++++++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 topology/test/test-loopback-ssp.m4
diff --git a/topology/test/test-loopback-ssp.m4 b/topology/test/test-loopback-ssp.m4 new file mode 100644
Better to reuse the test-ssp.m4 to avoiding expansion, we only add a kcontrol switch to it, and it should be set to be switched off by default, which won't influence people who don't wanna touch this loopback mode.
Thanks, ~Keyon
index 0000000..886876f --- /dev/null +++ b/topology/test/test-loopback-ssp.m4 @@ -0,0 +1,94 @@ +# +# Topology for pass through pipeline +#
+# Include topology builder +include(`dai.m4') +include(`utils.m4') +include(`pipeline.m4')
+# Include TLV library +include(`common/tlv.m4')
+# Include Token library +include(`sof/tokens.m4')
+# Include Baytrail DSP configuration +include(`dsps/byt.m4')
+# +# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! +# +# TEST_PIPE_NAME - Pipe name +# TEST_DAI_LINK_NAME - BE DAI link name e.g. "NoCodec" +# TEST_SSP_PORT - SSP port number e.g. 2 +# TEST_SSP_FORMAT - SSP data format e.g s16le +# TEST_PIPE_FORMAT - Pipeline format e.g. s16le +# TEST_SSP_MCLK - SSP BCLK in Hz +# TEST_SSP_BCLK - SSP BCLK in Hz +# TEST_SSP_PHY_BITS - SSP physical slot size +# TEST_SSP_DATA_BITS - SSP data slot size +# TEST_SSP_MODE - SSP mode e.g. I2S, LEFT_J, DSP_A and DSP_B +#
+# +# Define the pipeline +# +# PCM0 <-- TEST_PIPE_NAME pipe --> SSP TEST_SSP_PORT +# +#
+# Passthrough playback pipeline 1 on PCM 0 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data
+PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-playback.m4,
- 1, 0, 2, TEST_PIPE_FORMAT,
- 48, 1000, 0, 0, 0, 1,
- SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2)
+# Passthrough playback pipeline 2 on PCM 0 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data
+PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-capture.m4,
- 2, 0, 2, TEST_PIPE_FORMAT,
- 48, 1000, 0, 0, 0, 1,
- SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2)
+# +# DAI configuration +# +# SSP port TEST_SSP_PORT is our only pipeline DAI +#
+# playback DAI is SSP TEST_SSP_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-loopback.m4,
- 1, SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME,
- PIPELINE_SOURCE_1, 2, TEST_SSP_FORMAT,
- 48, 1000, 0, 0)
+# capture DAI is SSP TEST_SSP_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4,
- 2, SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME,
- PIPELINE_SINK_2, 2, TEST_SSP_FORMAT,
- 48, 1000, 0, 0)
+# PCM Passthrough +PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
+# +# BE configurations - overrides config in ACPI if present +# +# Clocks masters wrt codec +# +# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT +# +DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, TEST_SSP_MODE, TEST_SSP_DATA_BITS,
- DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in),
- DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave),
- DAI_CLOCK(fsync, 48000, codec_slave),
- DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3))
diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index c88537b..43379d7 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -12,7 +12,7 @@ export M4PATH="../:../m4:../common"
# Simple component test cases # can be used on components with 1 sink and 1 source. -SIMPLE_TESTS=(test-ssp test-capture-ssp test-playback-ssp) +SIMPLE_TESTS=(test-ssp test-capture-ssp test-playback-ssp test-loopback-ssp) TONE_TEST=test-tone-playback-ssp TEST_STRINGS="" M4_STRINGS=""
On Wed, 2018-05-30 at 17:51 +0800, Xiuli Pan wrote:
+# +# DAI configuration +# +# SSP port TEST_SSP_PORT is our only pipeline DAI +#
+# playback DAI is SSP TEST_SSP_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-loopback.m4,
1, SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME,
PIPELINE_SOURCE_1, 2, TEST_SSP_FORMAT,
48, 1000, 0, 0)
+# capture DAI is SSP TEST_SSP_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4,
2, SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME,
PIPELINE_SINK_2, 2, TEST_SSP_FORMAT,
48, 1000, 0, 0)
I would add a new macro call DAI_ADD_SSP (defined in ssp.m4) which adds the DAI loopback kcontrol and then just calls DAI_ADD.
This way you get the kcontrol for SSP loopback for free on every topology.
Liam
From: Pan Xiuli xiuli.pan@linux.intel.com
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- topology/test/test-loopback-ssp.m4 | 94 ++++++++++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 topology/test/test-loopback-ssp.m4
diff --git a/topology/test/test-loopback-ssp.m4 b/topology/test/test-loopback-ssp.m4 new file mode 100644 index 0000000..886876f --- /dev/null +++ b/topology/test/test-loopback-ssp.m4 @@ -0,0 +1,94 @@ +# +# Topology for pass through pipeline +# + +# Include topology builder +include(`dai.m4') +include(`utils.m4') +include(`pipeline.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Baytrail DSP configuration +include(`dsps/byt.m4') + +# +# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! +# +# TEST_PIPE_NAME - Pipe name +# TEST_DAI_LINK_NAME - BE DAI link name e.g. "NoCodec" +# TEST_SSP_PORT - SSP port number e.g. 2 +# TEST_SSP_FORMAT - SSP data format e.g s16le +# TEST_PIPE_FORMAT - Pipeline format e.g. s16le +# TEST_SSP_MCLK - SSP BCLK in Hz +# TEST_SSP_BCLK - SSP BCLK in Hz +# TEST_SSP_PHY_BITS - SSP physical slot size +# TEST_SSP_DATA_BITS - SSP data slot size +# TEST_SSP_MODE - SSP mode e.g. I2S, LEFT_J, DSP_A and DSP_B +# + +# +# Define the pipeline +# +# PCM0 <-- TEST_PIPE_NAME pipe --> SSP TEST_SSP_PORT +# +# + +# Passthrough playback pipeline 1 on PCM 0 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data + +PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-playback.m4, + 1, 0, 2, TEST_PIPE_FORMAT, + 48, 1000, 0, 0, 0, 1, + SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2) + + +# Passthrough playback pipeline 2 on PCM 0 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data + +PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-capture.m4, + 2, 0, 2, TEST_PIPE_FORMAT, + 48, 1000, 0, 0, 0, 1, + SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2) + +# +# DAI configuration +# +# SSP port TEST_SSP_PORT is our only pipeline DAI +# + +# playback DAI is SSP TEST_SSP_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-loopback.m4, + 1, SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, + PIPELINE_SOURCE_1, 2, TEST_SSP_FORMAT, + 48, 1000, 0, 0) + +# capture DAI is SSP TEST_SSP_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4, + 2, SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, + PIPELINE_SINK_2, 2, TEST_SSP_FORMAT, + 48, 1000, 0, 0) + +# PCM Passthrough +PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) + +# +# BE configurations - overrides config in ACPI if present +# +# Clocks masters wrt codec +# +# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT +# +DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, TEST_SSP_MODE, TEST_SSP_DATA_BITS, + DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in), + DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3)) diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index c88537b..43379d7 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -12,7 +12,7 @@ export M4PATH="../:../m4:../common"
# Simple component test cases # can be used on components with 1 sink and 1 source. -SIMPLE_TESTS=(test-ssp test-capture-ssp test-playback-ssp) +SIMPLE_TESTS=(test-ssp test-capture-ssp test-playback-ssp test-loopback-ssp) TONE_TEST=test-tone-playback-ssp TEST_STRINGS="" M4_STRINGS=""
On 5/30/18 4:51 AM, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Have some clean up for the code may used. Add some macros that are needed for the switch widget. TODO: Have the useable get/put function for the kcontrol.
Pan Xiuli (5): topology: mixer: Add CONTROLMIXER_MIN topology: utils: Add kdapm macro for route with kcontrol topology: m4: add switch widget topology: sof: add pipeline loopback dai topology: test: add loopback test topology
What do you mean by "loopback"? a) enabling capture on SSP with hardware LBM (LoopBackMode) - mirroring the playback data? b) enabling a capture-to-playback hostless pipeline - mirroring the capture data?
topology/m4/mixercontrol.m4 | 16 ++++-- topology/m4/switch.m4 | 46 +++++++++++++++ topology/m4/utils.m4 | 4 ++ topology/sof/pipe-dai-loopback.m4 | 36 ++++++++++++ topology/sof/pipe-low-latency-capture.m4 | 3 +- topology/sof/pipe-low-latency-playback.m4 | 2 + topology/sof/pipe-pcm-media.m4 | 1 + topology/sof/pipe-tone.m4 | 2 + topology/sof/pipe-volume-capture.m4 | 1 + topology/sof/pipe-volume-playback.m4 | 1 + topology/test/test-loopback-ssp.m4 | 94 +++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 12 files changed, 201 insertions(+), 7 deletions(-) create mode 100644 topology/m4/switch.m4 create mode 100644 topology/sof/pipe-dai-loopback.m4 create mode 100644 topology/test/test-loopback-ssp.m4
On 5/30/2018 21:06, Pierre-Louis Bossart wrote:
On 5/30/18 4:51 AM, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Have some clean up for the code may used. Add some macros that are needed for the switch widget. TODO: Have the useable get/put function for the kcontrol.
Pan Xiuli (5): topology: mixer: Add CONTROLMIXER_MIN topology: utils: Add kdapm macro for route with kcontrol topology: m4: add switch widget topology: sof: add pipeline loopback dai topology: test: add loopback test topology
What do you mean by "loopback"? a) enabling capture on SSP with hardware LBM (LoopBackMode) - mirroring the playback data? b) enabling a capture-to-playback hostless pipeline - mirroring the capture data?
I think the it should be the a). This will try to enable SSP driver loopback mode with a kcontrol. Maybe we can try to make the b) also work.
Thanks Xiuli
topology/m4/mixercontrol.m4 | 16 ++++-- topology/m4/switch.m4 | 46 +++++++++++++++ topology/m4/utils.m4 | 4 ++ topology/sof/pipe-dai-loopback.m4 | 36 ++++++++++++ topology/sof/pipe-low-latency-capture.m4 | 3 +- topology/sof/pipe-low-latency-playback.m4 | 2 + topology/sof/pipe-pcm-media.m4 | 1 + topology/sof/pipe-tone.m4 | 2 + topology/sof/pipe-volume-capture.m4 | 1 + topology/sof/pipe-volume-playback.m4 | 1 + topology/test/test-loopback-ssp.m4 | 94 +++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 12 files changed, 201 insertions(+), 7 deletions(-) create mode 100644 topology/m4/switch.m4 create mode 100644 topology/sof/pipe-dai-loopback.m4 create mode 100644 topology/test/test-loopback-ssp.m4
On 5/30/18 9:08 PM, Pan, Xiuli wrote:
On 5/30/2018 21:06, Pierre-Louis Bossart wrote:
On 5/30/18 4:51 AM, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Have some clean up for the code may used. Add some macros that are needed for the switch widget. TODO: Have the useable get/put function for the kcontrol.
Pan Xiuli (5): topology: mixer: Add CONTROLMIXER_MIN topology: utils: Add kdapm macro for route with kcontrol topology: m4: add switch widget topology: sof: add pipeline loopback dai topology: test: add loopback test topology
What do you mean by "loopback"? a) enabling capture on SSP with hardware LBM (LoopBackMode) - mirroring the playback data? b) enabling a capture-to-playback hostless pipeline - mirroring the capture data?
I think the it should be the a). This will try to enable SSP driver loopback mode with a kcontrol.
Not sure if it's wise to expose a kcontrol to users for what is largely a test capability - not to mention that you will not typically turn this on/off dynamically. I'd suggest looking into using the topology+IPC to enable such custom tests.
Maybe we can try to make the b) also work.
Thanks Xiuli
topology/m4/mixercontrol.m4 | 16 ++++-- topology/m4/switch.m4 | 46 +++++++++++++++ topology/m4/utils.m4 | 4 ++ topology/sof/pipe-dai-loopback.m4 | 36 ++++++++++++ topology/sof/pipe-low-latency-capture.m4 | 3 +- topology/sof/pipe-low-latency-playback.m4 | 2 + topology/sof/pipe-pcm-media.m4 | 1 + topology/sof/pipe-tone.m4 | 2 + topology/sof/pipe-volume-capture.m4 | 1 + topology/sof/pipe-volume-playback.m4 | 1 + topology/test/test-loopback-ssp.m4 | 94 +++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 12 files changed, 201 insertions(+), 7 deletions(-) create mode 100644 topology/m4/switch.m4 create mode 100644 topology/sof/pipe-dai-loopback.m4 create mode 100644 topology/test/test-loopback-ssp.m4
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On Thu, 2018-05-31 at 07:55 -0500, Pierre-Louis Bossart wrote:
On 5/30/18 9:08 PM, Pan, Xiuli wrote:
On 5/30/2018 21:06, Pierre-Louis Bossart wrote:
On 5/30/18 4:51 AM, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Have some clean up for the code may used. Add some macros that are needed for the switch widget. TODO: Have the useable get/put function for the kcontrol.
Pan Xiuli (5): topology: mixer: Add CONTROLMIXER_MIN topology: utils: Add kdapm macro for route with kcontrol topology: m4: add switch widget topology: sof: add pipeline loopback dai topology: test: add loopback test topology
What do you mean by "loopback"? a) enabling capture on SSP with hardware LBM (LoopBackMode) - mirroring the playback data? b) enabling a capture-to-playback hostless pipeline - mirroring the capture data?
I think the it should be the a). This will try to enable SSP driver loopback mode with a kcontrol.
Not sure if it's wise to expose a kcontrol to users for what is largely a test capability - not to mention that you will not typically turn this on/off dynamically. I'd suggest looking into using the topology+IPC to enable such custom tests.
If it is not needed to turn this ON/OFF dynamically, then could we possibly just use a test FW with loopback mode enabled by default instead? That way we can avoid the extra work on the topology/driverside.
Maybe we can try to make the b) also work.
Thanks Xiuli
topology/m4/mixercontrol.m4 | 16 ++++-- topology/m4/switch.m4 | 46 +++++++++++++++ topology/m4/utils.m4 | 4 ++ topology/sof/pipe-dai-loopback.m4 | 36 ++++++++++++ topology/sof/pipe-low-latency-capture.m4 | 3 +- topology/sof/pipe-low-latency-playback.m4 | 2 + topology/sof/pipe-pcm-media.m4 | 1 + topology/sof/pipe-tone.m4 | 2 + topology/sof/pipe-volume-capture.m4 | 1 + topology/sof/pipe-volume-playback.m4 | 1 + topology/test/test-loopback-ssp.m4 | 94 +++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 12 files changed, 201 insertions(+), 7 deletions(-) create mode 100644 topology/m4/switch.m4 create mode 100644 topology/sof/pipe-dai-loopback.m4 create mode 100644 topology/test/test-loopback-ssp.m4
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmwar e
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On 5/31/18 12:37 PM, Ranjani Sridharan wrote:
On Thu, 2018-05-31 at 07:55 -0500, Pierre-Louis Bossart wrote:
On 5/30/18 9:08 PM, Pan, Xiuli wrote:
On 5/30/2018 21:06, Pierre-Louis Bossart wrote:
On 5/30/18 4:51 AM, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Have some clean up for the code may used. Add some macros that are needed for the switch widget. TODO: Have the useable get/put function for the kcontrol.
Pan Xiuli (5): topology: mixer: Add CONTROLMIXER_MIN topology: utils: Add kdapm macro for route with kcontrol topology: m4: add switch widget topology: sof: add pipeline loopback dai topology: test: add loopback test topology
What do you mean by "loopback"? a) enabling capture on SSP with hardware LBM (LoopBackMode) - mirroring the playback data? b) enabling a capture-to-playback hostless pipeline - mirroring the capture data?
I think the it should be the a). This will try to enable SSP driver loopback mode with a kcontrol.
Not sure if it's wise to expose a kcontrol to users for what is largely a test capability - not to mention that you will not typically turn this on/off dynamically. I'd suggest looking into using the topology+IPC to enable such custom tests.
If it is not needed to turn this ON/OFF dynamically, then could we possibly just use a test FW with loopback mode enabled by default instead? That way we can avoid the extra work on the topology/driverside.
It's one token and one field in the IPC structure, with no framework change. Compare that with requiring everyone to create a custom firmware when they want to test if the output looks correct...
Maybe we can try to make the b) also work.
Thanks Xiuli
topology/m4/mixercontrol.m4 | 16 ++++-- topology/m4/switch.m4 | 46 +++++++++++++++ topology/m4/utils.m4 | 4 ++ topology/sof/pipe-dai-loopback.m4 | 36 ++++++++++++ topology/sof/pipe-low-latency-capture.m4 | 3 +- topology/sof/pipe-low-latency-playback.m4 | 2 + topology/sof/pipe-pcm-media.m4 | 1 + topology/sof/pipe-tone.m4 | 2 + topology/sof/pipe-volume-capture.m4 | 1 + topology/sof/pipe-volume-playback.m4 | 1 + topology/test/test-loopback-ssp.m4 | 94 +++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 12 files changed, 201 insertions(+), 7 deletions(-) create mode 100644 topology/m4/switch.m4 create mode 100644 topology/sof/pipe-dai-loopback.m4 create mode 100644 topology/test/test-loopback-ssp.m4
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmwar e
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On Thu, 2018-05-31 at 16:08 -0500, Pierre-Louis Bossart wrote:
On 5/31/18 12:37 PM, Ranjani Sridharan wrote:
On Thu, 2018-05-31 at 07:55 -0500, Pierre-Louis Bossart wrote:
On 5/30/18 9:08 PM, Pan, Xiuli wrote:
On 5/30/2018 21:06, Pierre-Louis Bossart wrote:
On 5/30/18 4:51 AM, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Have some clean up for the code may used. Add some macros that are needed for the switch widget. TODO: Have the useable get/put function for the kcontrol.
Pan Xiuli (5): topology: mixer: Add CONTROLMIXER_MIN topology: utils: Add kdapm macro for route with kcontrol topology: m4: add switch widget topology: sof: add pipeline loopback dai topology: test: add loopback test topology
What do you mean by "loopback"? a) enabling capture on SSP with hardware LBM (LoopBackMode) - mirroring the playback data? b) enabling a capture-to-playback hostless pipeline - mirroring the capture data?
I think the it should be the a). This will try to enable SSP driver loopback mode with a kcontrol.
Not sure if it's wise to expose a kcontrol to users for what is largely a test capability - not to mention that you will not typically turn this on/off dynamically. I'd suggest looking into using the topology+IPC to enable such custom tests.
If it is not needed to turn this ON/OFF dynamically, then could we possibly just use a test FW with loopback mode enabled by default instead? That way we can avoid the extra work on the topology/driverside.
It's one token and one field in the IPC structure, with no framework change. Compare that with requiring everyone to create a custom firmware when they want to test if the output looks correct...
Fair enough. I think topology is certainly the way to go.
Xiuli, now that you dont need a kcontrol, are you still going to work on that patch with a generic switch IO handler? Or should I take care of it?
Maybe we can try to make the b) also work.
Thanks Xiuli
topology/m4/mixercontrol.m4 | 16 ++++-- topology/m4/switch.m4 | 46 +++++++++++++++ topology/m4/utils.m4 | 4 ++ topology/sof/pipe-dai-loopback.m4 | 36 ++++++++++++ topology/sof/pipe-low-latency-capture.m4 | 3 +- topology/sof/pipe-low-latency-playback.m4 | 2 + topology/sof/pipe-pcm-media.m4 | 1 + topology/sof/pipe-tone.m4 | 2 + topology/sof/pipe-volume-capture.m4 | 1 + topology/sof/pipe-volume-playback.m4 | 1 + topology/test/test-loopback-ssp.m4 | 94 +++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 12 files changed, 201 insertions(+), 7 deletions(-) create mode 100644 topology/m4/switch.m4 create mode 100644 topology/sof/pipe-dai-loopback.m4 create mode 100644 topology/test/test-loopback-ssp.m4
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-fir mwar e
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmw are
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmwar e
On 6/1/2018 07:15, Ranjani Sridharan wrote:
On Thu, 2018-05-31 at 16:08 -0500, Pierre-Louis Bossart wrote:
On 5/31/18 12:37 PM, Ranjani Sridharan wrote:
On Thu, 2018-05-31 at 07:55 -0500, Pierre-Louis Bossart wrote:
On 5/30/18 9:08 PM, Pan, Xiuli wrote:
On 5/30/2018 21:06, Pierre-Louis Bossart wrote:
On 5/30/18 4:51 AM, Xiuli Pan wrote: > From: Pan Xiuli xiuli.pan@linux.intel.com > > Have some clean up for the code may used. > Add some macros that are needed for the switch widget. > TODO: Have the useable get/put function for the kcontrol. > > Pan Xiuli (5): > topology: mixer: Add CONTROLMIXER_MIN > topology: utils: Add kdapm macro for route with > kcontrol > topology: m4: add switch widget > topology: sof: add pipeline loopback dai > topology: test: add loopback test topology What do you mean by "loopback"? a) enabling capture on SSP with hardware LBM (LoopBackMode) - mirroring the playback data? b) enabling a capture-to-playback hostless pipeline - mirroring the capture data?
I think the it should be the a). This will try to enable SSP driver loopback mode with a kcontrol.
Not sure if it's wise to expose a kcontrol to users for what is largely a test capability - not to mention that you will not typically turn this on/off dynamically. I'd suggest looking into using the topology+IPC to enable such custom tests.
If it is not needed to turn this ON/OFF dynamically, then could we possibly just use a test FW with loopback mode enabled by default instead? That way we can avoid the extra work on the topology/driverside.
It's one token and one field in the IPC structure, with no framework change. Compare that with requiring everyone to create a custom firmware when they want to test if the output looks correct...
Fair enough. I think topology is certainly the way to go.
Xiuli, now that you dont need a kcontrol, are you still going to work on that patch with a generic switch IO handler? Or should I take care of it?
I think Pierre give me another solution for this loopback mode. I would like to do a cleanup for the topology with kcontrol. But I think it is not in high priority right now. We can have a sync later about how to make all kinds kcontrol work with topology.
Thanks Xiuli
Maybe we can try to make the b) also work.
Thanks Xiuli
> topology/m4/mixercontrol.m4 | 16 ++++-- > topology/m4/switch.m4 | 46 > +++++++++++++++ > topology/m4/utils.m4 | 4 ++ > topology/sof/pipe-dai-loopback.m4 | 36 > ++++++++++++ > topology/sof/pipe-low-latency-capture.m4 | 3 +- > topology/sof/pipe-low-latency-playback.m4 | 2 + > topology/sof/pipe-pcm-media.m4 | 1 + > topology/sof/pipe-tone.m4 | 2 + > topology/sof/pipe-volume-capture.m4 | 1 + > topology/sof/pipe-volume-playback.m4 | 1 + > topology/test/test-loopback-ssp.m4 | 94 > +++++++++++++++++++++++++++++++ > topology/test/tplg-build.sh | 2 +- > 12 files changed, 201 insertions(+), 7 deletions(-) > create mode 100644 topology/m4/switch.m4 > create mode 100644 topology/sof/pipe-dai-loopback.m4 > create mode 100644 topology/test/test-loopback-ssp.m4 >
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-fir mwar e
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmw are
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmwar e
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
Hi Liam,
Ping for RFC.
This is my previous kcontrol solution for topology part.
Does this can work with the runtime switch to loopback mode?
On 6/1/2018 11:24, Pan, Xiuli wrote:
On 6/1/2018 07:15, Ranjani Sridharan wrote:
On Thu, 2018-05-31 at 16:08 -0500, Pierre-Louis Bossart wrote:
On 5/31/18 12:37 PM, Ranjani Sridharan wrote:
On Thu, 2018-05-31 at 07:55 -0500, Pierre-Louis Bossart wrote:
On 5/30/18 9:08 PM, Pan, Xiuli wrote:
On 5/30/2018 21:06, Pierre-Louis Bossart wrote: > On 5/30/18 4:51 AM, Xiuli Pan wrote: >> From: Pan Xiuli xiuli.pan@linux.intel.com >> >> Have some clean up for the code may used. >> Add some macros that are needed for the switch widget. >> TODO: Have the useable get/put function for the kcontrol. >> >> Pan Xiuli (5): >> topology: mixer: Add CONTROLMIXER_MIN >> topology: utils: Add kdapm macro for route with >> kcontrol >> topology: m4: add switch widget >> topology: sof: add pipeline loopback dai >> topology: test: add loopback test topology > What do you mean by "loopback"? > a) enabling capture on SSP with hardware LBM (LoopBackMode) - > mirroring the playback data? > b) enabling a capture-to-playback hostless pipeline - > mirroring > the > capture data? I think the it should be the a). This will try to enable SSP driver loopback mode with a kcontrol.
Not sure if it's wise to expose a kcontrol to users for what is largely a test capability - not to mention that you will not typically turn this on/off dynamically. I'd suggest looking into using the topology+IPC to enable such custom tests.
If it is not needed to turn this ON/OFF dynamically, then could we possibly just use a test FW with loopback mode enabled by default instead? That way we can avoid the extra work on the topology/driverside.
It's one token and one field in the IPC structure, with no framework change. Compare that with requiring everyone to create a custom firmware when they want to test if the output looks correct...
I take Pierre's suggestion with the TOKEN version.
Thanks Xiuli
Fair enough. I think topology is certainly the way to go.
Xiuli, now that you dont need a kcontrol, are you still going to work on that patch with a generic switch IO handler? Or should I take care of it?
I think Pierre give me another solution for this loopback mode. I would like to do a cleanup for the topology with kcontrol. But I think it is not in high priority right now. We can have a sync later about how to make all kinds kcontrol work with topology.
Thanks Xiuli
Maybe we can try to make the b) also work.
Thanks Xiuli > >> topology/m4/mixercontrol.m4 | 16 ++++-- >> topology/m4/switch.m4 | 46 >> +++++++++++++++ >> topology/m4/utils.m4 | 4 ++ >> topology/sof/pipe-dai-loopback.m4 | 36 >> ++++++++++++ >> topology/sof/pipe-low-latency-capture.m4 | 3 +- >> topology/sof/pipe-low-latency-playback.m4 | 2 + >> topology/sof/pipe-pcm-media.m4 | 1 + >> topology/sof/pipe-tone.m4 | 2 + >> topology/sof/pipe-volume-capture.m4 | 1 + >> topology/sof/pipe-volume-playback.m4 | 1 + >> topology/test/test-loopback-ssp.m4 | 94 >> +++++++++++++++++++++++++++++++ >> topology/test/tplg-build.sh | 2 +- >> 12 files changed, 201 insertions(+), 7 deletions(-) >> create mode 100644 topology/m4/switch.m4 >> create mode 100644 topology/sof/pipe-dai-loopback.m4 >> create mode 100644 topology/test/test-loopback-ssp.m4 >> _______________________________________________ Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-fir mwar e
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmw are
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmwar e
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On Mon, 2018-06-04 at 17:10 +0800, Pan, Xiuli wrote:
Hi Liam,
Ping for RFC.
This is my previous kcontrol solution for topology part.
Does this can work with the runtime switch to loopback mode?
Please make the review changes for this series and send a v2.
Thanks
Liam
--------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
On 5/31/2018 20:55, Pierre-Louis Bossart wrote:
On 5/30/18 9:08 PM, Pan, Xiuli wrote:
On 5/30/2018 21:06, Pierre-Louis Bossart wrote:
On 5/30/18 4:51 AM, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Have some clean up for the code may used. Add some macros that are needed for the switch widget. TODO: Have the useable get/put function for the kcontrol.
Pan Xiuli (5): topology: mixer: Add CONTROLMIXER_MIN topology: utils: Add kdapm macro for route with kcontrol topology: m4: add switch widget topology: sof: add pipeline loopback dai topology: test: add loopback test topology
What do you mean by "loopback"? a) enabling capture on SSP with hardware LBM (LoopBackMode) - mirroring the playback data? b) enabling a capture-to-playback hostless pipeline - mirroring the capture data?
I think the it should be the a). This will try to enable SSP driver loopback mode with a kcontrol.
Not sure if it's wise to expose a kcontrol to users for what is largely a test capability - not to mention that you will not typically turn this on/off dynamically. I'd suggest looking into using the topology+IPC to enable such custom tests.
Thus we should not have a kcontrol with topology. But to add some widget or something else then we parse the topology and set the loopback mode? This will make the loopback mode unchangeable but stilll a good solution.
Thanks Xiuli
Maybe we can try to make the b) also work.
Thanks Xiuli
topology/m4/mixercontrol.m4 | 16 ++++-- topology/m4/switch.m4 | 46 +++++++++++++++ topology/m4/utils.m4 | 4 ++ topology/sof/pipe-dai-loopback.m4 | 36 ++++++++++++ topology/sof/pipe-low-latency-capture.m4 | 3 +- topology/sof/pipe-low-latency-playback.m4 | 2 + topology/sof/pipe-pcm-media.m4 | 1 + topology/sof/pipe-tone.m4 | 2 + topology/sof/pipe-volume-capture.m4 | 1 + topology/sof/pipe-volume-playback.m4 | 1 + topology/test/test-loopback-ssp.m4 | 94 +++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 12 files changed, 201 insertions(+), 7 deletions(-) create mode 100644 topology/m4/switch.m4 create mode 100644 topology/sof/pipe-dai-loopback.m4 create mode 100644 topology/test/test-loopback-ssp.m4
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
participants (7)
-
Keyon Jie
-
Liam Girdwood
-
Liam Girdwood
-
Pan, Xiuli
-
Pierre-Louis Bossart
-
Ranjani Sridharan
-
Xiuli Pan