-
Notifications
You must be signed in to change notification settings - Fork 349
smart amp: added Maxim DSM audio component #3248
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
smart amp: added Maxim DSM audio component #3248
Conversation
plbossart
left a comment
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.
License question below:
|
I think you need to rebase your commit, you have conflicts and appear to be merging more than you intend |
6e0af57 to
5ee011a
Compare
Thanks for the comment. I rebased my commit. |
cujomalainey
left a comment
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.
general review comments as I am by no means an expert in DSM algorithms :)
6f15b9c to
589439e
Compare
lgirdwood
left a comment
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.
Mostly minor stuff. @mmaka1 are we good to use the new trace UUID API here too ?
589439e to
e60e820
Compare
|
@plbossart @cujomalainey @lgirdwood I appreciate for your review. |
e60e820 to
2de5785
Compare
9bd9b90 to
47b9e16
Compare
|
Added one more commit about 'memmove' implementation in lib/lib.c |
lgirdwood
left a comment
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.
@ryans-lee can you make the memmove into it's own PR and add the comment about POSIX
@singalsu any comments ? This looks good to me.
@RDharageswari are there any Smart AMP dependencies that ned to be merged prior to this ?
src/lib/lib.c
Outdated
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'm assuming this allings with the POSIX version of memove ? If so, we should say so in the commit 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.
@lgirdwood Let me create separate PR to add memmove function. Actually all memmove functions in this PR can be replaced by memcpy because it is copying higher address to lower address. memcpy cannot be used for the opposite case.
Let me switch memmove function to memcpy in this PR.
47b9e16 to
10235e9
Compare
|
I removed 'memmove' from this PR and updated the code again. Please help to review and approve. |
|
@cujomalainey any comments ? |
src/audio/smart_amp/smart_amp.c
Outdated
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.
no handling of the data here?
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.
Parameter read/write function have not been implemented yet.
'SOF_CTRL_CMD_BINARY' covers general parameter update to the component and I'm not sure configuration by 'SOF_CTRL_CMD_ENUM' at this moment. Will add implementation if needed when I submit separate PR for the parameter read/write function. Thank you.
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.
Ok, would you mind removing the ENUM since you have no usage? it looks like a bug there as it stands.
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.
OK. Shall fix it.
src/audio/smart_amp/smart_amp.c
Outdated
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.
should we return error on streams that are not S32LE so we don't have silent memory failures?
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 took this code from the smart amp reference code smart_amp_test.c and I don't quite well understand about the reason why it is s32_le hardcoded. I confirmed feedback data is coming in s32_le but frame_fmt was still s16_le.
I suppose this issue is still there because smart_amp_test.c is still same.
Let me remove the hardcoded value later once frmae_fmt variable get the correct value.
@bkokoszx Could you please add comment here? Thanks for your help.
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.
There were two reasons why S32_LE format is hardcoded here:
- At the beginning there was requirement only for that format on feedback stream.
- Our pipeline params propagation mechanism does not handle case with DSM topology (format parameter is not properly propagated to feedback buffer, so it was hardcoded at that moment (assuming that we only need s32_le)).
If we want to delete this hardcode, we should reopen @keyonjie PR with params negotiation #2788.
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.
If the current platforms only support S32LE then i am fine with the hardcode but I recommend we open a tracking bug in case other formats such float wish to use this then we have a bug we can refer to
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.
@bkokoszx Could you please help on this?
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.
@ryans-lee can you put a check in here that returns error with some trace error output so this does not silenttly fail. You should keep the TODO info so that this can be addressed one the negotion is completed by @keyonjie .
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.
@lgirdwood I've added a check and put 'com_err' message to notify the issue. I considered to return error in smart_amp_process, but it causes several errors and blocked testing for capture stream.
10235e9 to
0b56909
Compare
|
Removed 'SOF_CTRL_CMD_ENUM' case. One additional modification - Removed topology change from this PR. Created separate PR3342 for the same thing. |
|
@lgirdwood : There are no dependencies for this patch |
lgirdwood
left a comment
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 think we just need the one chnage and we are good ?
src/audio/smart_amp/smart_amp.c
Outdated
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.
@ryans-lee can you put a check in here that returns error with some trace error output so this does not silenttly fail. You should keep the TODO info so that this can be addressed one the negotion is completed by @keyonjie .
Maxim DSM(Dynamic Speaker Management) audio component is added. This component takes stereo input + 4 channel IV feedback. Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
0b56909 to
6df8437
Compare
|
Jenkins CI is kernel ROM status errors for ICL and CML. |
|
@cujomalainey Would you please provide your comments? |
| */ | ||
| if (sad->feedback_buf->stream.frame_fmt != SOF_IPC_FRAME_S32_LE) { | ||
| sad->feedback_buf->stream.frame_fmt = SOF_IPC_FRAME_S32_LE; | ||
| comp_err(dev, "smart_amp_prepare(): S32_LE format is hardcoded as workaround"); |
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.
no return error code?
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.
@cujomalainey I considered to return error in smart_amp_process, but it causes several errors and blocks testing for capture stream. Hence I removed error return and added error message to move forward.
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.
Got it, as long as userspace handles the change properly then Im ok with this.
|
Jenkins CI showing ROM status errors on CML and ICL around PM flows that are unrelated. |
|
I appreciate for all your time and effort for the review. |
|
Thanks for the patience in the review |
This commit is about adding "Maxim DSM(Dynamic Speaker Management) component".
This component is written based on "Smart amplifier test component".
SOF audio component get variable length frame per approximately 1ms.
Because DSM requires fixed frame size(16 bit, 240 samples per channel), this component do internal buffering
to get desired input format.
This component originally works with DSM function library, but I removed it from this commit because it is not open source based and it has potential license issue. So it is currently working as bypass component.
This component tested on Volteer board with MAX98373 amp over I2S.
Please help to review.
Thank you in advance.