[Sound-open-firmware] [RFC PATCH 2/2] topology: add sof-apl-da7219 support

Keyon Jie yang.jie at linux.intel.com
Thu Jul 12 09:02:33 CEST 2018



On 2018年07月12日 09:14, Ranjani Sridharan wrote:
> On Wed, 2018-07-11 at 17:52 -0500, Pierre-Louis Bossart wrote:
>>
>> On 07/11/2018 04:43 PM, Ranjani Sridharan wrote:
>>> On Wed, 2018-07-11 at 11:55 -0500, Pierre-Louis Bossart wrote:
>>>> On 07/11/2018 01:23 AM, Ranjani Sridharan wrote:
>>>>> On Tue, 2018-07-10 at 18:15 -0500, Pierre-Louis Bossart wrote:
>>>>>> Add based on sof-glk-codec. In theory this is the same
>>>>>> topology
>>>>>> with only a swap of SSPs
>>>>>>
>>>>>> FIXME: this is a mess between pipeline ID, PCM ID, DAI ID,
>>>>>> DAI #.
>>>>>> I could use additional eyes to proof-read this...
>>>>>
>>>>> Looks good to me. I couldnt spot any mistakes.
>>>>> Keyon, Could you please also check?
>>>>>> FIXME: not sure why we would need
>>>>>> PCM_CAPTURE_ADD/PCM_PLAYBACK_DAI,
>>>>>> this seems to be already done by DAI_ADD?
>>>>>
>>>>> DAI_ADD only adds the BE DAI's. PCM_CAPTURE_ADD/PLAYBACK_ADD
>>>>> are
>>>>> needed
>>>>> for adding the FE dai links.
>>>>
>>>> ok, but then why do those macros make references to the DAIs?
>>>
>>> The dai_id is used when creating the cpu_dai for the PCM elems and
>>> their ID is set to the dai_id specified here.
>>>
>>> I wish I understood cpu dai's better but I couldnt wrap my head
>>> around
>>> why we do that.
>>>
>>> Keyon, any hints?
>>
>> So it's a different dai_id from what is used for back-ends? Looks
>> like a
>> complete mess to me...
> 
> It is the same ID that is used for the BE DAI, Pierre.
> Here's a quick look at the all the DAI's that are registered in the
> case of up2 with the hifiberry dac+ with the test-playback-ssp5*.tplg.
> 
> The "Passthrough 0" dai is the last one and has the dai_id of 0 which
> is the same as the SSP5 id in the topology.
> 
> [    0.076806] NET: Registered protocol family 16
> [    0.176459] Registered efivars operations
> [    0.319302] NET: Registered protocol family 2
> [    0.320794] NET: Registered protocol family 1
> [    1.467017] NET: Registered protocol family 10
> [    1.467826] NET: Registered protocol family 17
> [    3.038697] snd-soc-dummy snd-soc-dummy: ASoC: Registered DAI 'snd-
> soc-dummy-dai' with id 0
> [    3.227853] sof-audio sof-audio: ASoC: Registered platform 'sof-
> audio'
> [    3.227862] sof-audio sof-audio: ASoC: Registered DAI 'SSP0 Pin'
> with id 0
> [    3.227866] sof-audio sof-audio: ASoC: Registered DAI 'SSP1 Pin'
> with id 1
> [    3.227869] sof-audio sof-audio: ASoC: Registered DAI 'SSP2 Pin'
> with id 2
> [    3.227873] sof-audio sof-audio: ASoC: Registered DAI 'SSP3 Pin'
> with id 3
> [    3.227876] sof-audio sof-audio: ASoC: Registered DAI 'SSP4 Pin'
> with id 4
> [    3.227879] sof-audio sof-audio: ASoC: Registered DAI 'SSP5 Pin'
> with id 5
> [    3.227883] sof-audio sof-audio: ASoC: Registered DAI 'DMIC01 Pin'
> with id 6
> [    3.227886] sof-audio sof-audio: ASoC: Registered DAI 'DMIC16k Pin'
> with id 7
> [    3.227889] sof-audio sof-audio: ASoC: Registered DAI 'iDisp1 Pin'
> with id 8
> [    3.227893] sof-audio sof-audio: ASoC: Registered DAI 'iDisp2 Pin'
> with id 9
> [    3.227896] sof-audio sof-audio: ASoC: Registered DAI 'iDisp3 Pin'
> with id 10
> [    3.227900] sof-audio sof-audio: ASoC: Registered DAI 'Analog Codec
> DAI' with id 11
> [    3.227903] sof-audio sof-audio: ASoC: Registered DAI 'Digital Codec
> DAI' with id 12

These are all BE cpu_dais.


> [    3.227906] sof-audio sof-audio: ASoC: Registered DAI 'Alt Analog
> Codec DAI' with id 1
> [    3.578667] pcm512x i2c-104C5122:00: ASoC: Registered DAI 'pcm512x-
> hifi' with id 0
> [    4.141636] pstore: Registered efi as persistent store backend
> [    4.203432] sof-audio sof-audio: ASoC: Registered DAI 'Passthrough
> 0' with id 0

What's this? it should be FE cpu_dai IMO.

~Keyon

> [    4.609670] NET: Registered protocol family 31
> 
>>
>>>
>>>> +# PCM (PCM_CAPTURE_ADD(name, pipeline, pcm_id, dai_id, capture))
>>>> +#PCM_CAPTURE_ADD(DMIC0, 1, 0, 0, PIPELINE_PCM_1)
>>>> +#PCM_PLAYBACK_ADD(SSP5, 2, 0, 5, PIPELINE_PCM_2)
>>>> +#PCM_PLAYBACK_ADD(SSP1, 3, 1, 1, PIPELINE_PCM_3)
>>>>
>>>> In addition the information on the PCM # is already provided in
>>>> PIPELINE_ADD, so this looks redundant on both the FE and BE
>>>> sides?
>>>>>> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at lin
>>>>>> ux.i
>>>>>> ntel
>>>>>> .com>
>>>>>> ---
>>>>>>     topology/Makefile.am       |   1 +
>>>>>>     topology/sof-apl-da7219.m4 | 104
>>>>>> +++++++++++++++++++++++++++++++++++++++++++++
>>>>>>     2 files changed, 105 insertions(+)
>>>>>>     create mode 100644 topology/sof-apl-da7219.m4
>>>>>>
>>>>>> diff --git a/topology/Makefile.am b/topology/Makefile.am
>>>>>> index 33d0418..396b5b9 100644
>>>>>> --- a/topology/Makefile.am
>>>>>> +++ b/topology/Makefile.am
>>>>>> @@ -31,6 +31,7 @@ MACHINES = \
>>>>>>     	sof-hsw-rt5640.tplg \
>>>>>>     	sof-apl-tdf8532.tplg \
>>>>>>     	sof-apl-pcm512x.tplg \
>>>>>> +	sof-apl-da7219.tplg \
>>>>>>     	sof-glk-codec.tplg
>>>>>>     
>>>>>>     # Uncomment the following line if you want to debug conf
>>>>>> files
>>>>>> diff --git a/topology/sof-apl-da7219.m4 b/topology/sof-apl-
>>>>>> da7219.m4
>>>>>> new file mode 100644
>>>>>> index 0000000..3934df5
>>>>>> --- /dev/null
>>>>>> +++ b/topology/sof-apl-da7219.m4
>>>>>> @@ -0,0 +1,104 @@
>>>>>> +#
>>>>>> +# Topology for AppoloLake with headset on SSP1, spk on SSP5
>>>>>> and
>>>>>> DMIC+# PCM (PCM_CAPTURE_ADD(name, pipeline, pcm_id, dai_id,
>>>>>> capture))
>>>>>> +#PCM_CAPTURE_ADD(DMIC0, 1, 0, 0, PIPELINE_PCM_1)
>>>>>> +#PCM_PLAYBACK_ADD(SSP5, 2, 0, 5, PIPELINE_PCM_2)
>>>>>> +#PCM_PLAYBACK_ADD(SSP1, 3, 1, 1, PIPELINE_PCM_3)
>>>>>> capture
>>>>>> +#
>>>>>> +
>>>>>> +# Include topology builder
>>>>>> +include(`utils.m4')
>>>>>> +include(`dai.m4')
>>>>>> +include(`pipeline.m4')
>>>>>> +include(`ssp.m4')
>>>>>> +
>>>>>> +# Include TLV library
>>>>>> +include(`common/tlv.m4')
>>>>>> +
>>>>>> +# Include Token library
>>>>>> +include(`sof/tokens.m4')
>>>>>> +
>>>>>> +# Include bxt DSP configuration
>>>>>> +include(`platform/intel/bxt.m4')
>>>>>> +include(`platform/intel/dmic.m4')
>>>>>> +
>>>>>> +#
>>>>>> +# Define the pipelines
>>>>>> +#
>>>>>> +# PCM0 <---- volume <----- DMIC0 (dmic capture)
>>>>>> +# PCM0 ----> volume -----> SSP5 (speaker - maxim98357a)
>>>>>> +# PCM1 ----> volume -----> SSP1 (headset - da7219)
>>>>>> +#
>>>>>> +
>>>>>> +# Low Latency capture pipeline 1 on PCM 0 using max 4
>>>>>> channels
>>>>>> of
>>>>>> s32le.
>>>>>> +# Schedule 48 frames per 1000us deadline on core 0 with
>>>>>> priority
>>>>>> 0
>>>>>> +PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4,
>>>>>> +	1, 0, 4, s32le,
>>>>>> +	48, 1000, 0, 0)
>>>>>> +
>>>>>> +# Low Latency playback pipeline 2 on PCM 0 using max 2
>>>>>> channels
>>>>>> of
>>>>>> s16le.
>>>>>> +# Schedule 48 frames per 1000us deadline on core 0 with
>>>>>> priority
>>>>>> 0
>>>>>> +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
>>>>>> +	2, 0, 2, s16le,
>>>>>> +	48, 1000, 0, 0)
>>>>>> +
>>>>>> +# Low Latency playback pipeline 3 on PCM 1 using max 2
>>>>>> channels
>>>>>> of
>>>>>> s16le.
>>>>>> +# Schedule 48 frames per 1000us deadline on core 0 with
>>>>>> priority
>>>>>> 0
>>>>>> +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
>>>>>> +	3, 1, 2, s16le,
>>>>>> +	48, 1000, 0, 0)
>>>>>> +
>>>>>> +#
>>>>>> +# DAIs configuration
>>>>>> +#
>>>>>> +
>>>>>> +# capture DAI is DMIC0 using 2 periods
>>>>>> +# Buffers use s16le format, with 48 frame per 1000us on core
>>>>>> 0
>>>>>> with
>>>>>> priority 0
>>>>>> +DAI_ADD(sof/pipe-dai-capture.m4,
>>>>>> +	1, DMIC, 0, DMIC0,
>>>>>> +	PIPELINE_SINK_1, 2, s32le,
>>>>>> +	48, 1000, 0, 0)
>>>>>> +
>>>>>> +# playback DAI is SSP5 using 2 periods
>>>>>> +# Buffers use s16le format, with 48 frame per 1000us on core
>>>>>> 0
>>>>>> with
>>>>>> priority 0
>>>>>> +DAI_ADD(sof/pipe-dai-playback.m4,
>>>>>> +	2, SSP, 5, SSP5-Codec,
>>>>>> +	PIPELINE_SOURCE_2, 2, s16le,
>>>>>> +	48, 1000, 0, 0)
>>>>>> +
>>>>>> +# playback DAI is SSP1 using 2 periods
>>>>>> +# Buffers use s16le format, with 48 frame per 1000us on core
>>>>>> 0
>>>>>> with
>>>>>> priority 0
>>>>>> +DAI_ADD(sof/pipe-dai-playback.m4,
>>>>>> +	3, SSP, 1, SSP1-Codec,
>>>>>> +	PIPELINE_SOURCE_3, 2, s16le,
>>>>>> +	48, 1000, 0, 0)
>>>>>> +
>>>>>> +# FIXME: Why is this needed? And is this correct?
>>>>>> +# PCM (PCM_CAPTURE_ADD(name, pipeline, pcm_id, dai_id,
>>>>>> capture))
>>>>>> +#PCM_CAPTURE_ADD(DMIC0, 1, 0, 0, PIPELINE_PCM_1)
>>>>>> +#PCM_PLAYBACK_ADD(SSP5, 2, 0, 5, PIPELINE_PCM_2)
>>>>>> +#PCM_PLAYBACK_ADD(SSP1, 3, 1, 1, PIPELINE_PCM_3)
>>>>>> +
>>>>>> +#
>>>>>> +# BE configurations - overrides config in ACPI if present
>>>>>> +#
>>>>>> +# FIXME: the machine driver uses .name = "dmic01" and .id=2
>>>>>> +# DMIC0 (id: 2)
>>>>>> +DAI_CONFIG(DMIC, 0, 2, dmic01,
>>>>>> +	DMIC_CONFIG(1, 500000, 4800000, 40, 60, 48000,
>>>>>> +		DMIC_WORD_LENGTH(s32le), DMIC, 0,
>>>>>> +		PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1)))
>>>>>> +
>>>>>> +# FIXME: the machine driver uses .name = "SSP5-Codec",
>>>>>> .id=0,
>>>>>> .cpu_name="SSP5 Pin"
>>>>>> +#SSP 5 (ID: 0) with 19.2MHz mclk with MCLK_ID 0
>>>>>> +DAI_CONFIG(SSP, 5, 0, SSP5-Codec,
>>>>>> +	SSP_CONFIG(I2S, SSP_CLOCK(mclk, 19200000,
>>>>>> codec_mclk_in),
>>>>>> +		SSP_CLOCK(bclk, 1920000, codec_slave),
>>>>>> +		SSP_CLOCK(fsync, 48000, codec_slave),
>>>>>> +		SSP_TDM(2, 20, 3, 3),
>>>>>> +		SSP_CONFIG_DATA(SSP, 5, 16, 0)))
>>>>>> +
>>>>>> +# FIXME: the machine driver uses .name = "SSP1-Codec",
>>>>>> .id=1,
>>>>>> .cpu_name="SSP1 Pin"
>>>>>> +#SSP 1 (ID: 1) with 19.2MHz mclk with MCLK_ID 0
>>>>>> +DAI_CONFIG(SSP, 1, 1, SSP1-Codec,
>>>>>> +	SSP_CONFIG(I2S, SSP_CLOCK(mclk, 19200000,
>>>>>> codec_mclk_in),
>>>>>> +		SSP_CLOCK(bclk, 1920000, codec_slave),
>>>>>> +		SSP_CLOCK(fsync, 48000, codec_slave),
>>>>>> +		SSP_TDM(2, 20, 3, 3),
>>>>>> +		SSP_CONFIG_DATA(SSP, 1, 16, 0)))
>>>>>
>>>>> _______________________________________________
>>>>> Sound-open-firmware mailing list
>>>>> Sound-open-firmware at alsa-project.org
>>>>> http://mailman.alsa-project.org/mailman/listinfo/sound-open-fir
>>>>> mwar
>>>>> e
>>
>> _______________________________________________
>> Sound-open-firmware mailing list
>> Sound-open-firmware at alsa-project.org
>> http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
> 


More information about the Sound-open-firmware mailing list