Skip to content

ASoC: SOF: Intel: detect DMIC number in SoundWire mixed config - #2704

Closed
plbossart wants to merge 1 commit into
thesofproject:topic/sof-devfrom
plbossart:sdw/detect-dmic-nhlt
Closed

plbossart wants to merge 1 commit into
thesofproject:topic/sof-devfrom
plbossart:sdw/detect-dmic-nhlt

Conversation

@plbossart

Copy link
Copy Markdown
Member

The pinmux allows for 2 SoundWire links to be enabled along with
DMICs. This was the default configuration on the TGL-RVP.

One issue with this configuration is that we don't have a means to
automatically detect how many DMICs are used, which in turn requires
the user to manually rename the topology file required on a platform.

This was borderline acceptable for Intel RVPs, but now that this
configuration is present in HP devices we need to automate the
process.

This patch makes use of the NHTL information and will pass the DMIC
number to the machine driver as a parameter. A follow-up patch will
expose the DMIC number to userspace/UCM with the configuration strings.

The Google devices do make use of DMICs instead of SoundWire link 2
and 3, but their topology is unique enough that they do not need any
NHTL support or topology renaming.

Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com

@plbossart

Copy link
Copy Markdown
Member Author

This is a compile-tested PR, I will need help from @RanderWang and @fredoh9 to test it on TGL-RVP.

Note that this may break sof-test, I have no idea what topology files are deployed and used. I would like to make sure that we never require users to rename topology filenames. This is not right and does not scale.

@plbossart

Copy link
Copy Markdown
Member Author

Two problems reported:

a) timeout on TGL-H RVP, not sure what the issue is? @fredoh9 @RanderWang can you check if the DMICs are actually enabled on that platform?

b) cml-rt700 does not have DMIC support. @bardliao @fredoh9 @RanderWang can you also check if the DMIC is supported on this hardware/BIOS, I wonder if all we need is a topology change? Alternatively we could use a kernel parameter to override the NHLT and discard the DMIC.

@libinyang libinyang mentioned this pull request Jan 21, 2021
Comment thread sound/soc/sof/intel/hda.c
pdata->tplg_filename = mach->sof_tplg_filename;

/* see if DMICs are pin-muxed with SoundWire link 2 and 3 */
if (!(mach->link_mask & GENMASK(3, 2))) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could there be an exception someday? For example .link_mask = BIT(2),, but it is not a DMIC. There is no DMIC in the case though. Another example is tgl_sdw_rt711_link1_rt1308_link2_rt715_link0 where rt715 is on link 0.
The if (!(mach->link_mask & GENMASK(3, 2))) test is still valid for both examples, but I am wondering if we can have a better way to test if PCH DMIC is used.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@bardliao in the UpExtreme example BIT(2) is set so there is no way a DMIC can be used on that platform. that's what the test does.

I added two levels
a) detection based on link
b) check on NHLT

The combination of the two removes the dependency on a bad BIOS with NHLT even when there's no DMIC.

Comment thread sound/soc/sof/intel/hda.c
@bardliao

ghost commented Jan 21, 2021

Copy link
Copy Markdown
Collaborator

b) cml-rt700 does not have DMIC support. @bardliao @fredoh9 @RanderWang can you also check if the DMIC is supported on this hardware/BIOS, I wonder if all we need is a topology change? Alternatively we could use a kernel parameter to override the NHLT and discard the DMIC.

DMICs are actually defined in sof-cml-rt700.m4. The issue is just we didn't add -2ch or -4ch postfix for all tplg file.

@plbossart

ghost commented Jan 21, 2021

Copy link
Copy Markdown
Member Author

b) cml-rt700 does not have DMIC support. @bardliao @fredoh9 @RanderWang can you also check if the DMIC is supported on this hardware/BIOS, I wonder if all we need is a topology change? Alternatively we could use a kernel parameter to override the NHLT and discard the DMIC.

DMICs are actually defined in sof-cml-rt700.m4. The issue is just we didn't add -2ch or -4ch postfix for all tplg file.

ah, that's an easy fix then. let's add a new topology name then (keeping the old to avoid breaking CI)

The pinmux allows for 2 SoundWire links to be enabled along with
DMICs. This was the default configuration on the TGL-RVP.

One issue with this configuration is that we don't have a means to
automatically detect how many DMICs are used, which in turn requires
the user to manually rename the topology file required on a platform.

This was borderline acceptable for Intel RVPs, but now that this
configuration is present in HP devices we need to automate the
process.

This patch makes use of the NHTL information and will pass the DMIC
number to the machine driver as a parameter. A follow-up patch will
expose the DMIC number to userspace/UCM with the configuration strings.

The Google devices do make use of DMICs instead of SoundWire link 2
and 3, but their topology is unique enough that they do not need any
NHTL support or topology renaming.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@plbossart
plbossart force-pushed the sdw/detect-dmic-nhlt branch from 183b123 to 0021f4a Compare January 21, 2021 16:03
@plbossart

ghost commented Jan 21, 2021

Copy link
Copy Markdown
Member Author

added to PR #2701

@plbossart plbossart closed this Jan 21, 2021
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.

3 participants