Repository navigation
Fix Bug:Amp: eliminat pops when switch device between speaker and headphone. - #7048
Conversation
|
Can one of the admins verify this patch?
|
|
Can one of the admins verify this patch? |
kv2019i
left a comment
There was a problem hiding this comment.
Thank you for the patch! A few minor notes on style raised by the checkpatch check (see inline). Otherwise this looks good.
There was a problem hiding this comment.
Some style and other minor issues, can you address the checkpatch findings in https://github.com/thesofproject/sof/actions/runs/4112079634/jobs/7099324790
There was a problem hiding this comment.
There are two pops caused by SOF Firmware.
@LongWang100 thanks for the patch, are you saying this bug is present in general SOF FW code or just specific to the smart AMP logic which you have fixed ?
There was a problem hiding this comment.
@lgirdwood that's a good question.
It's difficult to tell. However during previous investigation we used to adopt smart_amp_test (SAMPLE_SMART_AMP=y) to run on ADL-P max98373 device, the pop noise was still able to be reproduced. Nevertheless, we had never met the pop noise issue on TGL max98373 devices.
Another thing which had confused me for a long time is that smart_amp.c sounds like to play as the role of common adapter code implementation while there exists smart_amp_maxim_dsm.c and smart_amp_generic.c for Maxim DSM and generic solution respectively. However, I then realized that smart_amp.c basically serves Maxim DSM only according that UUID is directly defined as Maxim DSM. Also, the initial author of smart_amp.c is from Maxim.
I wonder if we would expect smart_amp to be a generic component which may have various solution implementations (somewhat similar to module_adapter). If so, it will need additional (future) commits to partition the current codes into common and solution-specific parts.
There was a problem hiding this comment.
Good point @johnylin76 - we have named this in a generic matter, and some of the logic will probably be generic and the other logic will be specific for Maxim only. I think it would make sense in the future to split out and partition smart amp into generic and vendor files ? @cujomalainey @mwasko any thoughts ?
There was a problem hiding this comment.
I guess there is no performance impact to doing this every time.
lgirdwood
left a comment
There was a problem hiding this comment.
@sathya-nujella fyi - we will need to backport this fix when merged ?
There was a problem hiding this comment.
There are two pops caused by SOF Firmware.
@LongWang100 thanks for the patch, are you saying this bug is present in general SOF FW code or just specific to the smart AMP logic which you have fixed ?
|
test this please |
|
SOFCI TEST |
c70f1f2 to
11e9a5d
Compare
@sathya-nujella , @lgirdwood , yes, we need to backport this for all SoCs with max98373 smart amp. |
|
Two checks failed. I checked the details, I found that they were not related with my submit. Anyone can help share the reason of failure checks?
|
re @lgirdwood I had verified the patches on "Acer Chromebook Spin 714" (project name: kano), which is ADL-P with codec:max98373 & nau8825 |
|
@LongWang100 wrote:
Thanks, these are known issues with the Zephyr build and not related to your PR. I think the CI is now ok. |
kv2019i
left a comment
There was a problem hiding this comment.
Thanks, looks good now.
A few style issues in the git commit, but these are not blocking:
- the title should have a prefix for the component, e.g. in this case "smart-amp: eliminate pops when switching between speaker and headphone" would have match the expected style
- the git description body does not need to be indented (see earlier git commits in the tree for reference)
But minor things, looks good for my part.
…hone. There are two pops caused by SOF Firmware. Pop occurs when switch from headphone to speaker: When switch to headphone, audio playback data still remains in DSM internal processing buffer and not consumed by DMA. So when switch back to speaker, the DSM processing buffer is not clean, then pop noise occurs. We can clean and reset the point for DSM internal processing buffer by called this function 'smart_amp_init' in function 'smart_amp_prepare'. Pop occurs when switch from speaker to headphone: The feedback and feed-forward buffer processing should be independent. But the number of frames processed by DSM feedforward is corrupted by feedback buffer calculation. When capture pipeline exists, the number of frames for feedforward is always same as feedback. And the number of frames for feedback is zero at the first time when the capture pipeline setup. Then the number of frames processed by DSM feed forward is also zero though there are many frames in playback buffer. So the available frames will become larger. It is easy to exceed the limit size of DSM input. Then it will cause the buffer overflow and we could hear obvious pop noise from speaker. We fix it by calculating the number of frames for feedforward and feedback respectively. Signed-off-by: Long Wang <long.wang@analog.com>
11e9a5d to
d7a79be
Compare
|
SOFCI TEST |
Signed-off-by: Long Wang long.wang@analog.com