Skip to content

DAPM graph fixes and clean ups - #675

Merged
plbossart merged 4 commits into
thesofproject:topic/sof-devfrom
ranj063:fix/pcm_binding
Feb 28, 2019
Merged

plbossart merged 4 commits into
thesofproject:topic/sof-devfrom
ranj063:fix/pcm_binding

Conversation

@ranj063

@ranj063 ranj063 commented Feb 25, 2019 •

Copy link
Copy Markdown
Collaborator

This PR does the following:

  1. Fixes issue DAPM widget will not power off after playback is stop #661
  2. removes the duplicate connections in the dapm graph from the PCM dev to host comp
  3. cleans up the dapm graph by removing the dai capabilities from the dai definitions

@ranj063

ranj063 commented Feb 25, 2019

Copy link
Copy Markdown
Collaborator Author

This PR should be merged alongside thesofproject/sof#1047

@ranj063
ranj063 requested review from bardliao, lgirdwood and plbossart and removed request for lgirdwood and plbossart February 25, 2019 23:19
Previously, PCM's were bound to the host component by
using an explicit pipeline graph path from the PCM device
to the host comp in topology. This graph route is unnecessary
and it results in a duplicate connection shown for the host
dapm widget from the PCM device. Instead, pcm's should be bound
to the respective host comp when the dai is loaded.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
@ranj063

ranj063 commented Feb 26, 2019

Copy link
Copy Markdown
Collaborator Author

this PR also fixes #661

Confirmed by Yong to fix the noise issue on the chromebook. @keqiaozhang can you please confirm?

@ranj063

ranj063 commented Feb 26, 2019 •

Copy link
Copy Markdown
Collaborator Author

removing the DAI capabilities from the dai definitions cleans up the dapm graph.
Before:
pcm512x-idle

After
pcm-512x-cleanup

@ranj063 ranj063 changed the title Fix PCM binding and add power_check for buffer/scheduler dapm widgets DAPM graph fixes and clean ups Feb 26, 2019
@ranj063
ranj063 requested a review from keyonjie February 26, 2019 03:38

@bardliao bardliao left a comment

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.

It seems that we should also free capture tables if bind capture pcm failed since the capture table is allocated successfully above.

Comment thread sound/soc/sof/topology.c Resolved
@bardliao
bardliao self-requested a review February 26, 2019 11:45

@bardliao bardliao left a comment

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.

LGTM and f94e65e should go upstream

@plbossart plbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comments below.

Comment thread sound/soc/soc-dapm.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what about all the effects/src/asrc that were added at the same time as buffer/scheduler? Should they really be always on?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@plbossart no, added them too now.

Comment thread sound/soc/sof/intel/bdw.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

these formats may not be used, but at the same time we currently have restrictions on what the topology can do (single format per DAI), and there will be no check that the topology settings are correct and supported by the firmware. We should probably have a layer that does check the topology is indeed supported, otherwise with a single error in a topology file we have a risk of reaching unsupported configurations. it's just too risky.
In short, I would really like the topology to support multiple DAI configs/formats, and a per-platform check in the driver.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@plbossart makes sense. I can add the check but looking at the formats defined for all platforms, I see no restrictions. All platforms seem to support 16/24/32 bit formats. Is that a mistake? If it is, could you please remind me what they should look like?

@plbossart

plbossart commented Feb 26, 2019 via email

Copy link
Copy Markdown
Member

@ranj063

ranj063 commented Feb 26, 2019

Copy link
Copy Markdown
Collaborator Author

-#define BDW_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | \ - SNDRV_PCM_FMTBIT_S32_LE) - @plbossart https://github.com/plbossart makes sense. I can add the check but looking at the formats defined for all platforms, I see no restrictions. All platforms seem to support 16/24/32 bit formats. Is that a mistake? If it is, could you please remind me what they should look like?
the main goal is to make sure the SSP are configured in topology with 1..8 channels, frequency between 8..192 and with 16, 24, 32 bits. There are other exotic formats such as 24_3LE or FLOAT that should not be handled. More channels as well.

@plbossart another question. Is sof_pcm_dai_link_fixup() the place to do the check? Today we seem to align the dai format and channels in the fixup method to fix the min and max rate to fsync rate and the min and max channels to tdm_slots. Do these need to expand to support a range?

@ranj063

ranj063 commented Feb 27, 2019

Copy link
Copy Markdown
Collaborator Author

@plbossart I've updated the PR with the check for SSP fsync rate and channel count.

@plbossart plbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor issue with the soc-dapm correction, we're missing asrc/encoder/decoder.

Comment thread sound/soc/soc-dapm.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Meh. this isn't the same order as definitions and it's missing asrc/encoder/decoder.

…ays on

Currently, buffers, schedulers, src's, encoders, decoders
and effect type dapm widgets remain always on as their
power_check method is not set. Setting this callback allows these
widgets in the audio path to be powered managed properly.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Dai capabilities/configuration are defined in topology.
The capabilities defined in the dai drv for the resp
platforms don't seem to be used at all. As an additional benefit,
removing these cleans up the DAPM graph.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Validate the fsync rate and channel count for SSP before
configuring the DAI.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
@ranj063

ranj063 commented Feb 27, 2019

Copy link
Copy Markdown
Collaborator Author

Minor issue with the soc-dapm correction, we're missing asrc/encoder/decoder.

oh yes, fixed now @plbossart

@plbossart plbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks @ranj063, can you please send patch2 on soc-dapm.c to alsa-devel?

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