Repository navigation
EQ IIR: Add support for response reconfigure during streaming - #2065
Conversation
|
I get checkpatch warnings from trace functions usage. What's the recommended practice. Should all traces be trace_x_with_ids() type instead of trace_x()? Also should the trace print multiple line split strings be in single line now? |
002c43c to
13c13f3
Compare
|
@singalsu Indeed with the recent Checkpatch changes it is recommended to not split long strings. However some splits are legitimate. Please do not split individual phrases which one may grep for, like "request for non-defined filter" or "Illegal number of biquads". You may split and safely ignore the warning if you split at some ":", "." or format specifier though. The one with "%s..." should be completely ignored, the current trace system doesn't support %s at all. Do focus on the alignment with open parenthesis too. |
|
@paulstelian97 Thanks for help! I'll re-format this PR. |
13c13f3 to
e1ba05c
Compare
|
@paulstelian97 @singalsu Which splits are legitmiate? |
|
@jajanusz I'd argue all of the ones present now are good enough because I doubt someone will try to grep for the whole message in order to debug. But if you argue otherwise and there should be no splitting at all then fair enough. Also... I thought your recent Checkpatch updates helped remove those "line too long" warnings with traces? @singalsu Is there anything that can be done about the line too long in eq_iir.c:883? Or would that break an alignment for no real gain? |
a new pointer "cn" could store "cd->config_new" and the arguments could be "cn" and "cn->size". I've sometimes done such to get all green check marks. Now that we get warning for every trace I don't now if aiming for all green is feasible. I tried to split size into third argument line but then checkpatch warns about xx->yy->zz pointers usage. It's strange that keeping it in single line doesn't give such warning. What would you prefer? |
|
Also I don't like myself the longer than earlier trace macro name that triggered these many issues with long or split strings lines. Why could not the trace_eq() be converted to do the same as trace_eq_with_ids(). Why was the old no-ids trace preserved? |
|
@singalsu @paulstelian97 I think it doesn't matter what we think in that regard. One of the project goals is to be compatible with kernel coding style and it clearly states: |
So we should only be allowed to split at format specifiers (because you can't grep for the value anyway). So only at %d or something. Got it. |
e1ba05c to
d139649
Compare
|
The push that I just did addresses the trace strings split and long lines recommendation. I shortened the local trace macro names to keep sufficient verbosity. Hope it's OK now. |
There was a problem hiding this comment.
Why do we rename these? (also, if there's a good reason please split this rename into a separate commit)
There was a problem hiding this comment.
The obvious reason is avoiding long lines. Yes, I'll place them to separate commit.
There was a problem hiding this comment.
I honestly believe that this actually makes code less clear, so NAK on this one. Long lines are fine in certain circumstances (greppability). I'd rather sacrifice alignment than readability or allow lines of 81-82 characters on a case-by-case basis.
paulstelian97
left a comment
There was a problem hiding this comment.
I don't know that much about the added functionality, however I don't like that you rename the trace macros to something that is essentially harder to understand at a glance just so you can fit within the 80-character limit.
Do split pass-by refactoring into a separate commit.
There was a problem hiding this comment.
"er"? Too vague, is this ONLY to prevent lines too long? Then not OK in my view.
There was a problem hiding this comment.
Would tr_error() be better? Also when tracing an error could we omit string "error:" from them since we already have trace class for errors? All of these tricks help a lot to keep the lines <= 80 chars.
There was a problem hiding this comment.
I'd say leave it as "trace_eq_error". You can omit the "error: " prefix if you wish. And then format strings are not subject to the <=80 chars restriction anyway.
There was a problem hiding this comment.
OK, I'll revert and the long lines will be back. I hope the checkpatch.pl script can be in future updated to contain these rules relaxations. It would be nice to see again the column of all green check marks from CI.
There was a problem hiding this comment.
Yeah, @jajanusz attempted to update certain things already (please rebase to latest master, I'm not sure you are using that update) so some "line too long" warnings shouldn't exist.
Some long lines are fine. Not all but some are. And really when the only issue is Checkpatch just have a second opinion, a discussion and then let it work.
There was a problem hiding this comment.
Same with "ei", I believe you should just leave it as-is.
There was a problem hiding this comment.
I think "_with_ids" is an ugly bloat. It should be the default trace type and use the original trace macro name. Another macro could be defined for functions without access to "dev" handle.
There was a problem hiding this comment.
I do agree that it should be the default but i'd take this into a different, more involved discussion rather than a "pass-by refactor". So you should instead make a separate PR where you would do such proposed changes to the traces so we can discuss them rather than blocking this PR with such issues.
There was a problem hiding this comment.
Because this one with the original trace_eq_error shouldn't make Checkpatch complain, and if it does you may safely ignore it.
There was a problem hiding this comment.
Rewords of traces should be in a separate commit from the actual new functionality.
d139649 to
01a2132
Compare
paulstelian97
left a comment
There was a problem hiding this comment.
I won't block this one even though the fact that there are still changes in the trace messages bothers me. At least there isn't anything that becomes significantly less clear now.
While a cleanup of the changed messages from there would be best I can leave it as such.
01a2132 to
0619b52
Compare
I left into first commit trace prints changes those were due to function name change. The setup() function was split to init_coef() and init_delay() functions to be able to do those separately. The trace texts in init_coef() function those held the old function name were included to first commit. Thanks for reviewing this @paulstelian97 ! Others please review too. |
0619b52 to
b236a3b
Compare
This patch adds capability to equalizer to switch response during audio playback or capture. The glitches are minimized by check and apply of the filter configuration before each copy() operation. The existing only halfway implemented SOF_CTRL_CMD_ENUM for quick stored presets switching during streaming is removed for now since there is no driver support. The internal code cleanup includes extract of two functions from eq_iir_setup() for check and initialize of coefficients and initialize of filter delay lines. It helps to better understand the setup flow. The extrapolation of channels to response assign map is changed to use previous channel response instead of first if the stream contains more channels than the response definition. The procedure was changed to avoid a code static analysis issue. The behavior is not specified so this simpler way was chosen. To minimize number of duplicated functions in generic and HiFi3 version a new module iir_generic.c is created for the filter core. After the change iir.c contains only the common code for both implementations. Signed-off-by: Seppo Ingalsuo <[email protected]>
This patch contains maintenance for module traces. Some redundant traces are removed and some new traces with useful information are added, especially if they are related to an error with configuration request. The long trace strings are shortened to and split to several lines at numbers print when possible. Signed-off-by: Seppo Ingalsuo <[email protected]>
b236a3b to
278c8d4
Compare
|
File iir_generic.c was missing from first commit after a git reset. Hope it's now OK in this just pushed version. |
|
CI issues not relevant to this PR. |
|
@lgirdwood I think this PR is not recalculating coefficients, they are already calculated in user space way before... so I guess this is just switching them and clearing delay lines. @singalsu correct if I'm wrong. |
Yep, all calculation is done in Octave EQ tool SOF/tools/tune/eq. However if need for realtime parameteric EQ the computation is not complicated, especially on some host side audio server for realtime updates. On FW it would be possible too but maybe with some simplifications into scaling and poles & zeros into biquads assign code. |
This patch adds capability to equalizer to switch response during
audio playback or capture. The glitches are minimized by check and
apply of the filter configuration before each copy() operation.
The existing only halfway implemented SOF_CTRL_CMD_ENUM for quick
stored presets switching during streaming is removed for now since
there is no driver support.
The internal code cleanup includes extracting two functions from
eq_iir_setup() for check and initialize of coefficients and
initialize of filter delay lines.
To minimize number of duplicated functions in generic and HiFi3 version
a new module iir_generic.c is created for the filter core. After the
change iir.c contains only the common code for both implementations.
Finally, some trace messages are cleaned up to easier to understand
text.
Signed-off-by: Seppo Ingalsuo [email protected]