Skip to content

Commit 2ed30b5

Browse files
authored
Merge pull request #213 from singalsu/eq_fir_blob_handling_fix_proposal
EQ FIR: Improve robustness with configuration blobs
2 parents 20752b7 + 51233fe commit 2ed30b5

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/audio/eq_fir.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,17 @@ static int eq_fir_setup(struct fir_state_32x16 fir[],
175175
/* Initialize 1st phase */
176176
trace_eq("asr");
177177
for (i = 0; i < nch; i++) {
178-
resp = assign_response[i];
178+
/* If the configuration blob contains less channels for
179+
* response assign to channels than the current channels count
180+
* use the first channel response to remaining channels. E.g.
181+
* a blob that contains just a mono EQ can be used for stereo
182+
* stream by using the same response for all channels.
183+
*/
184+
if (i < config->channels_in_config)
185+
resp = assign_response[i];
186+
else
187+
resp = assign_response[0];
188+
179189
trace_value(resp);
180190
if (resp >= config->number_of_responses || resp < 0) {
181191
trace_eq_error("eas");

0 commit comments

Comments
 (0)