Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

topology: fix bad parameters in generic dmic dai add #2089

Merged
merged 14 commits into from
Nov 25, 2019

Conversation

juimonen
Copy link

Intel generic dmic pipelines have bad extra parameters in
their dai add macros, so remove them.

Signed-off-by: Jaska Uimonen jaska.uimonen@intel.com

Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments below

@@ -46,14 +46,14 @@ dnl deadline, priority, core, time_domain)
DAI_ADD(sof/pipe-dai-capture.m4,
DMIC_PIPELINE_48k_ID, DMIC, 0, dmic01,
concat(`PIPELINE_SINK_', DMIC_PIPELINE_48k_ID), 2, s32le,
1000, 0, 0, 48000, 48000, 48000)
Copy link
Member

@plbossart plbossart Nov 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those parameters are obviously wrong, but shouldn't we use the TIMER now?
The DMIC is clock master so there's no real benefit in using DMA interrupts here, is there?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, ok someone needs to jump in here, because I don't know this area.... maybe before the wrong value 16000 something has been just interpreted as != 0 -> so timer?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tlauda @lgirdwood see above?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juimonen these are wrong, please validate against the DAI_ADD defn. It looks like we are also missing some macro defs for Time domain, these can be added too in order to avoid ambiguous definitions.

dnl DAI_ADD(pipeline,
dnl     pipe id, dai type, dai_index, dai_be,
dnl     buffer, periods, format,
dnl     period , priority, core, time_domain)
define(`DAI_ADD',
`undefine(`PIPELINE_ID')'
`undefine(`DAI_TYPE')'
`undefine(`DAI_INDEX')'
`undefine(`DAI_BE')'
`undefine(`DAI_BUF')'
`undefine(`DAI_PERIODS')'
`undefine(`DAI_FORMAT')'
`undefine(`SCHEDULE_PERIOD')'
`undefine(`SCHEDULE_PRIORITY')'
`undefine(`SCHEDULE_CORE')'
`undefine(`SCHEDULE_TIME_DOMAIN')'
`define(`PIPELINE_ID', $2)'
`define(`DAI_TYPE', STR($3))'
`define(`DAI_INDEX', STR($4))'
`define(`DAI_BE', $5)'
`define(`DAI_BUF', $6)'
`define(`DAI_NAME', $3$4)'
`define(`DAI_PERIODS', $7)'
`define(`DAI_FORMAT', $8)'
`define(`SCHEDULE_PERIOD', $9)'
`define(`SCHEDULE_PRIORITY', $10)'
`define(`SCHEDULE_CORE', $11)'
`define(`SCHEDULE_TIME_DOMAIN', $12)'
`include($1)'
`DEBUG_DAI($3, $4)'

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgirdwood Pierre's questions was should this be TIMER or DMA...? And I guess it is TIMER as I see only that defined anywhere. And then I see DAI_ADD macros without either TIMER or DMA that compiles to "" in conf files, which is alsp probably not good.... So should those then be DMA?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and forget last comment about not using, was not grepping for tokens... so question is should the empty "" be DOMAIN_DMA?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in below topologies the TIME_DOMAIN is not specified so it is "":

sof-cht-max98090.m4
sof-cht-nocodec.m4
sof-cht-rt5682.m4
sof-imx8qxp-nocodec.m4
sof-imx8qxp-nocodec-sai.m4
sof-imx8qxp-cs42888.m4
sof-imx8qxp-wm8960.m4
sof-hsw-rt5640.m4
sof-bdw-codec.m4
sof-cht-src-50khz-pcm512x.m4
platform/intel/intel-generic-dmic.m4
sof-byt-codec.m4

Any objections I just change it to TIMER in all?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juimonen The imx8qxp ones are 100% DMA-driven, so TIMER might/will break them. No words on the other ones though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juimonen all topologies use the SOC clock master so there's no problem using the TIMER
the two cases where the codec is master is wm8804 and some versions of pcm512x, those would need to remain DMA based.

In general when the DAI uses 'codec_slave' we can use the TIMER.

sof-apl-wm8804.m4:              SSP_CLOCK(bclk, 3072000, codec_master),
sof-apl-wm8804.m4:              SSP_CLOCK(fsync, 48000, codec_master),
sof-imx8qxp-wm8960.m4:          SAI_CLOCK(bclk, 3072000, codec_master),
sof-imx8qxp-wm8960.m4:          SAI_CLOCK(fsync, 48000, codec_master),

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tlauda any comment here ?

@juimonen
Copy link
Author

@plbossart @paulstelian97 thanks for the info and PR updated. All imx ones should have DMA domain now. I now explicitly defined either TIMER or DMA everywhere. I also found couple of related issues which are separate commits... I have no idea how those topologies have ever worked with all pipelines.

@ranj063
Copy link
Collaborator

ranj063 commented Nov 14, 2019

@juimonen Would you mind splitting up the commit per tplg file? It is easy to figure out which commit caused issues when debugging that way

@juimonen juimonen force-pushed the dmic_dai_fix branch 3 times, most recently from a2fbe54 to 179d639 Compare November 15, 2019 08:48
@juimonen
Copy link
Author

@ranj063 @plbossart @paulstelian97 PR now divided per topology file basis. @plbossart I needed to change byt and cht based topology timers to DMA, because CI just went crazy otherwise...

@juimonen
Copy link
Author

@paulstelian97 updated, hope it is more clear now.

Copy link
Collaborator

@paulstelian97 paulstelian97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, looks good to me now.

@plbossart
Copy link
Member

@ranj063 @plbossart @paulstelian97 PR now divided per topology file basis. @plbossart I needed to change byt and cht based topology timers to DMA, because CI just went crazy otherwise...

yes, my baytrail device went in the weeds with your PR.
I think we should change from DMA to TIMER one platform at a time, separately, with tests done by different people, not just CI.

Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's keep broadwell the way it is and remove haswell


# capture DAI is SSP0 using 2 periods
# Buffers use s24le format, 1000us deadline on core 0 with priority 0
DAI_ADD(sof/pipe-dai-capture.m4,
2, SSP, 0, Codec,
PIPELINE_SINK_2, 2, s24le,
1000, 0, 0)
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably better to keep DMAs on broadwell, this is difficult enough with DMAs alone and IIRC there are no external timers?


# capture DAI is SSP0 using 2 periods
# Buffers use s24le format, 1000us deadline on core 0 with priority 0
DAI_ADD(sof/pipe-dai-capture.m4,
2, SSP, 0, Codec,
PIPELINE_SINK_2, 2, s24le,
1000, 0, 0)
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep as DMA.
we need to remove this topology anyways, hsw is not supported

8000, 96000, 48000)
8000, 96000, 48000,
SCHEDULE_TIME_DOMAIN_TIMER,
PIPELINE_PLAYBACK_SCHED_COMP_1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leave broadwell with DMA

8000, 96000, 48000)
8000, 96000, 48000,
SCHEDULE_TIME_DOMAIN_TIMER,
PIPELINE_PLAYBACK_SCHED_COMP_1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this file, not supported

Jaska Uimonen added 8 commits November 25, 2019 11:25
Fix errorneous parameters in DAI_ADD.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Add time domain DMA explicitly to DAI_ADD.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Add time domain DMA explicitly to DAI_ADD and pipeline.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Add time domain DMA explicitly to DAI_ADD.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Add time domain DMA explicitly to DAI_ADD and pipeline.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Add time domain DMA explicitly to DAI_ADD.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Add time domain DMA explicitly to DAI_ADD.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Add time domain DMA explicitly to DAI_ADD.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Jaska Uimonen added 6 commits November 25, 2019 11:28
Add time domain DMA explicitly to DAI_ADD.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Add time domain DMA explicitly to DAI_ADD.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Add time domain DMA explicitly to DAI_ADD.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
sof-cml-rt5682 dmic definition has some extra parameters that should be
removed.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Media pipe is missing the scheduling component, so move it after the dai
definition and add the scheduling component.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Remove as unsupported platform.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
@juimonen
Copy link
Author

@plbossart updated. bdw changed to dma, hsw removed.

Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @juimonen

@lgirdwood
Copy link
Member

Internal CI test passed - all green.

@lgirdwood lgirdwood merged commit db7671a into thesofproject:master Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants