-
Notifications
You must be signed in to change notification settings - Fork 139
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: NHLT: Intel: Fix mono DMIC configure for MTL platform #286
base: master
Are you sure you want to change the base?
Conversation
0162116
to
d94ed97
Compare
@@ -654,6 +662,8 @@ static int configure_registers(struct intel_dmic_params *dmic, struct dmic_calc_ | |||
{ | |||
int stereo[DMIC_HW_CONTROLLERS]; | |||
int swap[DMIC_HW_CONTROLLERS]; | |||
int source[OUTCONTROLX_IPM_NUMSOURCES]; | |||
int ipmsm[DMIC_HW_FIFOS]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: if you moved the source anyways, why not spread them to have a nicer looking reverse xmas tree look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw: what is 'ipmsm' stands for?
Oh, Stereo Mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I was thinking nicer to move all arrays first but was a bit shy. With the tree style, should initialized variables be still in the end?
Yes, short version for OUTCONTROLx_IPM_SOURCE_MODE, where 0 is mono, 1 is stereo. And I've forgotten what IPM was for... but it's the FIFO packer, consumes samples from stereo PDM controllers and interleaves/packs them to FIFO.
d94ed97
to
e125ba1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@singalsu, I would not do a big variable declaration shuffling it hides the change you have made.
int th = 3; /* Used with TIE=1 */ | ||
int source[OUTCONTROLX_IPM_NUMSOURCES]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh my, I cannot see what is changed now ;)
@@ -762,6 +774,12 @@ static int configure_registers(struct intel_dmic_params *dmic, struct dmic_calc_ | |||
of0 = (dmic->dmic_prm[0].fifo_bits == 32) ? 2 : 0; | |||
of1 = (dmic->dmic_prm[1].fifo_bits == 32) ? 2 : 0; | |||
|
|||
ret = stereo_helper(dmic, stereo, swap, ipmsm); | |||
if (ret < 0) { | |||
fprintf(stderr, "%s: enable conflict\n", __func__); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it is a code move, but what the error means?
The only error is in case of if (swap_check && swap[i])
but how that is 'enable conflict'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In topology you can freely enable Mic A or Mic B for dmic0 and dmic1 in any pdmX for DAI, as if they were fully independent, but you can't enable e.g. for dmic0 mono from A and for dmic1 mono from B from same pdm0 controller. Enable of pdm0 stereo A & B for dmic0 and only prm0 mono A as mono can be done. It's difficult to phrase to a compact error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this part of allowing some funky mic selections and blocking impossible ones is still not fully up-to-date. Need still to revisit this after fixing some tplg2 limitations in freedom for those and when I'm able to better test these with new generation HW.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside commit message, looks good to me!
e125ba1
to
d3c7c10
Compare
This change fixes the blob generator for mono microphone configuration. As difference to previous platforms the FIFO packer mono/stereo mode set up in OUTCONTROLx IPM_SOURCE_MODE bit-field. The previous code version hard-codes the FIFO packer to stereo mode without support for mono. As a fix if only one microphone is enabled for dmic0 or dmic1, then the corresponding IPM_SOURCE_MODE in OUTCONTROL0 or OUTCONTROL1 is set to 0. Otherwise it is set to 1 for stereo mode. Signed-off-by: Seppo Ingalsuo <[email protected]>
The DMIC HW does not provide all the freedom that topology syntax appears to provide for DAI configuration. This change helps to understand better what the error is about. Signed-off-by: Seppo Ingalsuo <[email protected]>
d3c7c10
to
b08c8df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This change fixes the blob generator for mono microphone configuration. As difference to previous platforms the FIFO packer mono/stereo mode set up in OUTCONTROLx IPM_SOURCE_MODE bit-field.