-
Notifications
You must be signed in to change notification settings - Fork 349
volume: merge volume (ipc3) and peakvol (ipc4) component #5196
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
Conversation
f9dd098 to
cdd8b6d
Compare
src/include/ipc4/peak_volume.h
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.
bit-pick: can we use kernel stype comments for struct fields like this:
/** struct ipc4_peak_volume_config
* @channel_id: ID of channel. If set to ALL_CHANNELS_MASK then
* configuration is identical and will be set for all all channels
* @target_volume: Target channel volume. Takes values from 0 to 0x7fffffff.
* @curve_type : Fade curve type
* @curve_duration: Curve duration in number of hundreds nanoseconds for format specified during
* initialization.
*/
struct ipc4_peak_volume_config {
uint32_t channel_id;
uint32_t target_volume;
uint32_t curve_type;
uint32_t reserved;
uint64_t curve_duration;
} __attribute__((packed, aligned(8)));
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.
Looks like it is not used for other files in include/ipc4?
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.
A good feature to add, just minor stuff.
src/audio/volume/volume_hifi3.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.
@singalsu @marcinszkudlinski can we pass the shift value as a non constant variable ? I'm guessing we cant as this would simplify. If not we could define this value as a macro and set it via the CONFIG.
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.
Sorry I missed the context in the above question.
out_sample = AE_ROUND32F48SSYM(AE_SRAI64(mult, 1));
#else /* CONFIG_IPC_MAJOR_4 */
out_sample = AE_ROUND32F48SSYM(AE_SRAI64(mult, 8));I assume the 1 and 8 above must be const.
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.
The shift parameter is legacy from time when volume did format conversion. The function should be renamed to vol_s24() and hard code and optimize all shifts to minimum. Shifts by immediate instructions may be better for parallel execute than parametric shift instructions.
singalsu
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 this could be improved, some proposals added:
0c8167d to
8980b5c
Compare
|
@abonislawski can you close any resolved comments. I think most are resolved now right ? |
42fd57b to
f372c79
Compare
f372c79 to
892a85a
Compare
src/audio/Kconfig
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.
it somehow feels like all of the above should be simple macros instead of config options.
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 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.
@abonislawski how about hiding this as ops or fields in the volume specific data. struct vol_data? You can have fields such as q_notation that are set to Q1.23 and Q1.31 depending on the value and ops for doing IPC specific operations that will be set only where relevant
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.
Not sure if this will be optimal solution to use AE_SRAI64 with shifts stored in variables.
@singalsu already mentioned to hard code and optimize all shifts to minimum.
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.
@abonislawski not following what you mean by not optimal? You can still hardcode whatever you want based on the IPC version. Just wont be part of the config and also it will reduce al the #if/#else;s
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.
@abonislawski fwiw, we had a recent bug with a similar Kconfig dependency. If the volume type is only used in 1 module then we could just do a
#if CONFIG_IPC3
#define COMP_VOLUME_Q8_16
#endif
and so on. This keeps some simplicity in the Kconfig and the format localized to volume.
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, moved to volume.h
892a85a to
fb8269c
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.
Cant add any other comments so it looks like you have pushed whilst I was reviewing.
src/audio/volume/volume_generic.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.
@singalsu can you followup with a fix for the frag API usage here. Thanks !
fb8269c to
975e1f6
Compare
|
CI unrelated on Jenkins. |
|
@abonislawski I think we are good to go, can you rebase. Thanks ! |
src/audio/volume/volume.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.
is this needed because the config can be used on different cores?
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.
oh, I think this has been updated at the IPC layer (so that IPC layer does all the cache mgmt) instead of here so the cache inv is not needed 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.
yeap, it was updated for creating comp but this case is still affected.
Anyway removed dcache_() and ipc4 handler needs to be updated in another PR.
For now it doesnt matter because looks like volume_cmd() is never used for IPC4 because commit 6a297b4 added set large config but also removed cmd translation:
module set_large_config <-------> component cmd
All of this should be fixed in another PR
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.
Need to check cache handling is done by IPC layer.
|
@abonislawski fyi - here is the efficient copy() PR update that canbe copied here. #5300 |
26bdf31 to
58bea8f
Compare
|
@lgirdwood rebase ready |
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.
Only open on the Kconfig, otherwise good.
58bea8f to
463df4e
Compare
Merge peakvol component into already existing volume component. The main differences: - curve duration format is in hundred of ns (ipc4) and ms (ip3); - volume format sent by driver: Q1.31 (ipc4) and Q8.16 (ipc3); In ipc4 case volume format is converted into Q1.23 inside firmware. Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Merge peakvol component into already existing volume component.
The main differences:
In ipc4 case volume format is converted into Q1.23 inside firmware.