[Sound-open-firmware] [PATCH 1/2] topology: utils: add get format name helper function
From: Pan Xiuli xiuli.pan@linux.intel.com
We may need to get format name from some format short name.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- Test with: Mininow max rt5651 and GP-MRB nocodec and CNL nocodec SOF 1.1-stable: 480407f4745a2edf9c51e3a14be7533970122f23 SOF-Tool 1.1-stable: 105c88febf1b974b9f03b02712dbc154eff5eb4d https://github.com/plbossart/sound/tree/topic/sof-v4.14: 95d77adbaadc44b28c8975a3714f70824d1a8529 --- topology/m4/utils.m4 | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/topology/m4/utils.m4 b/topology/m4/utils.m4 index e929244..ba87c8d 100644 --- a/topology/m4/utils.m4 +++ b/topology/m4/utils.m4 @@ -35,6 +35,15 @@ define(`COMP_SAMPLE_SIZE', $1, `float', `4', `4')')
+dnl COMP_FORMAT_NAME(FMT) +define(`COMP_FORMAT_NAME', +`ifelse( + $1, `s16le', `S16_LE', + $1, `s24le', `S24_LE', + $1, `s32le', `S32_LE', + $1, `float', `FLOAT_LE', + )') + dnl P_GRAPH(name, CONNECTIONS) define(`P_GRAPH', `SectionGraph.STR($1) {'
From: Pan Xiuli xiuli.pan@linux.intel.com
For passthrough PCM, we can only support the SSP DAI format as PCM capabilities.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- Test with: Mininow max rt5651 and GP-MRB nocodec and CNL nocodec SOF 1.1-stable: 480407f4745a2edf9c51e3a14be7533970122f23 SOF-Tool 1.1-stable: 105c88febf1b974b9f03b02712dbc154eff5eb4d https://github.com/plbossart/sound/tree/topic/sof-v4.14: 95d77adbaadc44b28c8975a3714f70824d1a8529 --- topology/sof/pipe-passthrough-capture.m4 | 2 +- topology/sof/pipe-passthrough-playback.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/topology/sof/pipe-passthrough-capture.m4 b/topology/sof/pipe-passthrough-capture.m4 index 203003c..c6850f9 100644 --- a/topology/sof/pipe-passthrough-capture.m4 +++ b/topology/sof/pipe-passthrough-capture.m4 @@ -44,4 +44,4 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Capture PCM_ID # PCM Configuration #
-PCM_CAPABILITIES(Passthrough Capture PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 4, 2, 16, 192, 16384, 65536, 65536) +PCM_CAPABILITIES(Passthrough Capture PCM_ID, COMP_FORMAT_NAME(PIPELINE_FORMAT), 48000, 48000, 2, 4, 2, 16, 192, 16384, 65536, 65536) diff --git a/topology/sof/pipe-passthrough-playback.m4 b/topology/sof/pipe-passthrough-playback.m4 index a2a88ad..e2cd645 100644 --- a/topology/sof/pipe-passthrough-playback.m4 +++ b/topology/sof/pipe-passthrough-playback.m4 @@ -44,4 +44,4 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Playback PCM_I # PCM Configuration #
-PCM_CAPABILITIES(Passthrough Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 4, 2, 16, 192, 16384, 65536, 65536) +PCM_CAPABILITIES(Passthrough Playback PCM_ID, COMP_FORMAT_NAME(PIPELINE_FORMAT), 48000, 48000, 2, 4, 2, 16, 192, 16384, 65536, 65536)
On 3/22/2018 17:55, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
For passthrough PCM, we can only support the SSP DAI format as PCM capabilities.
On BYT, pulseaudio will try 16bit wav on 24bit pass through PCM. And it will fail since no enough data is passed to DAI. And S16_LE format should not be supported by this 24bit pass through PCM.
Hi Liam,
Is my understanding on pass through pipeline is wrong?
Thanks Xiuli
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
Test with: Mininow max rt5651 and GP-MRB nocodec and CNL nocodec SOF 1.1-stable: 480407f4745a2edf9c51e3a14be7533970122f23 SOF-Tool 1.1-stable: 105c88febf1b974b9f03b02712dbc154eff5eb4d https://github.com/plbossart/sound/tree/topic/sof-v4.14: 95d77adbaadc44b28c8975a3714f70824d1a8529
topology/sof/pipe-passthrough-capture.m4 | 2 +- topology/sof/pipe-passthrough-playback.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/topology/sof/pipe-passthrough-capture.m4 b/topology/sof/pipe-passthrough-capture.m4 index 203003c..c6850f9 100644 --- a/topology/sof/pipe-passthrough-capture.m4 +++ b/topology/sof/pipe-passthrough-capture.m4 @@ -44,4 +44,4 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Capture PCM_ID # PCM Configuration #
-PCM_CAPABILITIES(Passthrough Capture PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 4, 2, 16, 192, 16384, 65536, 65536) +PCM_CAPABILITIES(Passthrough Capture PCM_ID, COMP_FORMAT_NAME(PIPELINE_FORMAT), 48000, 48000, 2, 4, 2, 16, 192, 16384, 65536, 65536) diff --git a/topology/sof/pipe-passthrough-playback.m4 b/topology/sof/pipe-passthrough-playback.m4 index a2a88ad..e2cd645 100644 --- a/topology/sof/pipe-passthrough-playback.m4 +++ b/topology/sof/pipe-passthrough-playback.m4 @@ -44,4 +44,4 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Playback PCM_I # PCM Configuration #
-PCM_CAPABILITIES(Passthrough Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 4, 2, 16, 192, 16384, 65536, 65536) +PCM_CAPABILITIES(Passthrough Playback PCM_ID, COMP_FORMAT_NAME(PIPELINE_FORMAT), 48000, 48000, 2, 4, 2, 16, 192, 16384, 65536, 65536)
On Thu, 2018-03-22 at 18:09 +0800, Pan, Xiuli wrote:
On 3/22/2018 17:55, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
For passthrough PCM, we can only support the SSP DAI format as PCM capabilities.
On BYT, pulseaudio will try 16bit wav on 24bit pass through PCM. And it will fail since no enough data is passed to DAI. And S16_LE format should not be supported by this 24bit pass through PCM.
Hi Liam,
Is my understanding on pass through pipeline is wrong?
Passthrough pipeline cannot change any audio parameters like rate, format etc, it just passes the data straight through from PCM to DAI (or vice versa).
Liam
On Thu, 2018-03-22 at 17:55 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
For passthrough PCM, we can only support the SSP DAI format as PCM capabilities.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
Both applied.
Liam
participants (3)
-
Liam Girdwood
-
Pan, Xiuli
-
Xiuli Pan