Skip to content

Conversation

@RDharageswari
Copy link

@RDharageswari RDharageswari commented Aug 13, 2020

This patch set creates a Read only byte kcontrol with access type as read & volatile. Reading values from DSM audio component is very important for speaker calibration & diagnosis.Temperature, DC resistance, Fc and Q of the speaker are always changing, and every speaker has its own unique value. DSM requires Rdc calibration for each speaker in the factory line to match speaker coil resistance with actual ambient temperature. Customer also monitors above speaker parameters to make sure if there is any temperature/excursion violation. This mandates the need for a kcontrol interface to read the "actual" data from DSP. Today we already have the read/write kcontrol, where read always returns the cached data, that was set during write, as the kcontrol read need not wake up DSP everytime. But the "actual" data is needed for tuning and hence the patch set.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

Looks good, just minor items.

Copy link
Member

Choose a reason for hiding this comment

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

ditto, just a small inline comment here (I know some of the others dont have them, but that's something we need to update fro readability)

Copy link
Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

Choose a reason for hiding this comment

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

The comment doesnt match the number 260?

Copy link
Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

Choose a reason for hiding this comment

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

@lgirdwood this change will make the tplg incompatible with older kernels. Should this be tied to ABI as well?

Copy link
Member

Choose a reason for hiding this comment

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

yes. Added.

@lgirdwood lgirdwood added the ABI ABI change involved label Aug 13, 2020
@lgirdwood lgirdwood added this to the ABI-3.17 milestone Aug 13, 2020
@plbossart
Copy link
Member

@RDharageswari I presume there will be a matching kernel PR, to change the behavior and force an IPC read?

@RDharageswari
Copy link
Author

@RDharageswari I presume there will be a matching kernel PR, to change the behavior and force an IPC read?

Yes Pierre, have them ready, yet to test and submit the patches

@RDharageswari RDharageswari force-pushed the Read_only_byte_kcontrol branch 2 times, most recently from 6d5b4f8 to 176d743 Compare August 14, 2020 07:10
Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

Minor stuff.

This patch adds the support for read-only volatile byte kcontrol with
access type as read and volatile to read the actual values from DSP,
write-only byte kcontrol with access type as just write and read-write
volatile byte control with access type as read, write and volatile.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
@RDharageswari RDharageswari force-pushed the Read_only_byte_kcontrol branch from 176d743 to 42b1543 Compare August 15, 2020 01:59
Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

Looks good now, can you link the kernel PR URL here.

@RDharageswari
Copy link
Author

RDharageswari commented Aug 17, 2020

Hi Liam,
This is the Kernel PR: thesofproject/linux#2368

@RDharageswari RDharageswari requested a review from ranj063 August 17, 2020 20:30
@lgirdwood
Copy link
Member

CI has stalled - rerun.

@lgirdwood
Copy link
Member

SOFCI TEST

Copy link
Collaborator

@ranj063 ranj063 left a comment

Choose a reason for hiding this comment

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

@RDharageswari one last change before this is merged

@RDharageswari RDharageswari force-pushed the Read_only_byte_kcontrol branch from 42b1543 to a9278e8 Compare August 20, 2020 23:58
Copy link
Collaborator

Choose a reason for hiding this comment

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

dont you need the ABI check here as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry to chime in late, why we need an extra read-only kcontrol if it denotes the same model configure params? can't we just modify the existed one directly to be RW-volatile?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@keyonjie we want to keep our RW control non-volatile so that what we write and subsequently read are consistent.

Copy link
Contributor

Choose a reason for hiding this comment

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

@keyonjie we want to keep our RW control non-volatile so that what we write and subsequently read are consistent.

How will the FW module use this model data, if the RW one and the Read only one are with the same meaning, we don't need to preserve the original written one consistent with what we have written. e.g. we write an volume level, and then FW update it internally, the read back of the volume should return this FW internal updated one.

Copy link
Contributor

Choose a reason for hiding this comment

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

My point is adding one more kcontrol with almost the same meaning could confuse us.

Copy link
Author

Choose a reason for hiding this comment

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

Hi Keyon,
The actual intention here is not to wake up DSP, if the intention of the user is just to read back the parameters that he has set. Eg: Hotword model.
Whereas this Read volatile control is actually going to return the real-time data, that will be helpful for the tuning purpose. In this way we can minimize the DSP wakes for reading the parameters.

Copy link
Contributor

Choose a reason for hiding this comment

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

The parameters cached from that been set will mislead us, we should have only one original data (e.g. from real register or real-time data) which should be read back. In case that the cached data is different from the real-time one, the cached one makes no sense but only introducing confusion. IMHO we should delete this cached one but keep the real-time one only if it will be changed by the Firmware, reading back the misleading cached data to avoid waking up the DSP looks worse than refusing to reading it back when DSP is suspended.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@RDharageswari you need to change this to add the first 2 controls by default and the get_params control only if the abj is >= 3.17

Copy link
Author

Choose a reason for hiding this comment

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

Done

Dharageswari R added 2 commits August 20, 2020 23:10
This patch adds the smart amplifier get parameter byte kcontrol
to read the actual algorithm parameters from DSP during runtime.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
This patch checks for the access type of kcontrol and returns error
only when the access type is not read or write.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
@RDharageswari RDharageswari force-pushed the Read_only_byte_kcontrol branch from adc6bb0 to e96449a Compare August 21, 2020 06:11
@lgirdwood
Copy link
Member

SOFCI TEST

@lgirdwood
Copy link
Member

SOFCI TEST

@lgirdwood
Copy link
Member

I'm a bit perplexed about the CI failure on ICL. Going to run again as I know kernel updates for ICL were pending.

@lgirdwood
Copy link
Member

SOFCI TEST

@ranj063
Copy link
Collaborator

ranj063 commented Aug 26, 2020

I'm a bit perplexed about the CI failure on ICL. Going to run again as I know kernel updates for ICL were pending.

@lgirdwood I missed the ICL failure but there's known issue with ICL requiring more than 1 attempt for FW boot which has been fixed with thesofproject/linux#2382.

@ranj063 ranj063 closed this Aug 26, 2020
@ranj063 ranj063 reopened this Aug 26, 2020
@lgirdwood lgirdwood merged commit 49d432d into master Aug 27, 2020
@lgirdwood lgirdwood deleted the Read_only_byte_kcontrol branch January 27, 2021 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ABI ABI change involved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants