~canonical-hwe-team/hwe-next/+git/sof:drc_incremental

Last commit made on 2020-11-06
Get this branch:
git clone -b drc_incremental https://git.launchpad.net/~canonical-hwe-team/hwe-next/+git/sof

Branch merges

Branch information

Name:
drc_incremental
Repository:
lp:~canonical-hwe-team/hwe-next/+git/sof

Recent commits

b7c6e0b... by Pin-chih Lin <email address hidden> on 2020-10-27

sof: drc: Implement s24 and s32 sample format cases

Implemented s24 and s32 sample format cases of both pass and default
functions.

Because both s24 and s32 cases use 32-bit samples for source/sink stream
while s16 case uses 16-bit, for pre_delay_buffers, it followed as well
(32-bit for s24/s32, 16-bit for s16). One special note is that we <<8 when
storing samples from source to pre_delay_buffers, and >>8 when loading from
pre_delay_buffers. It makes 32-bit samples in pre_delay_buffers are always
Q1.31 in both s24 and s32 cases.

In common functions (e.g. drc_compress_output), sample byte information is
required to pass if the function has the operation of pre_delay_buffers, to
distinguish 16-bit and 32-bit sample cases.

Signed-off-by: Pin-chih Lin <email address hidden>

97ffcf9... by Pin-chih Lin <email address hidden> on 2020-10-22

sof: drc: component implemented by fixed-point calculations

In drc_generic.c and drc_math_generic.c, all floating-point math functions
are removed, and all float vaiables are replaced by fixed-point (int32_t)
variables with the appropriate precisions. It is verified that the
fixed-point replacement only lead to quite insignificant MSE errors among
all test patterns.

 - Multiplications are replaced by Q_MULTSR_32X32 with the appropriate
   precisions.

 - Divisions (x/y) are replaced by Q_MULTSR_32X32(x, inv(y)), where inv(y)
   is approximated 1/y by polynomial functions generated by fpminimax of
   Sollya with rexp optimization.

Signed-off-by: Pin-chih Lin <email address hidden>

c9f5d71... by Pin-chih Lin <email address hidden> on 2020-10-19

sof: drc: Use one_over_attack_frames in replace of attack_frames

Replaced the config coefficient "attack_frames" by "one_over_attack_frames"
(=1/attack_frames). It is because only "one_over_attack_frames" is used by
firmware and it could save a division operand by the replacement.

Signed-off-by: Pin-chih Lin <email address hidden>

260d269... by Pin-chih Lin <email address hidden> on 2020-10-15

sof: drc: More fixed-point approximative functions

Implemented the following fixed-point functions for the approximation of
math calculations in drc_math_generic.c. fpminimax of Sollya is used for
generating a good polynomial approximation of wanted functions.

logf(x)
 - Input is Q6.26: max 32.0
 - Output range ~ (-inf, 3.4657); regulated to Q6.26: (-32.0, 32.0)

linear_to_decibels(x)
 - Input is Q6.26: max 32.0
 - Output range ~ (-inf, 30.1030); regulated to Q11.21: (-1024.0, 1024.0)

asinf(x)
 - Use two-step polynomial approximation among [0, 1] whose pivot point is
   1/sqrt(2)
 - Input is Q2.30: (-2.0, 2.0)
 - Output range: [-1.0, 1.0]; regulated to Q2.30: (-2.0, 2.0)

powf(x, y)
 - Input x is Q6.26: (-32.0, 32.0); y is Q2.30: (-2.0, 2.0)
 - Output is Q12.20: max 2048.0

Signed-off-by: Pin-chih Lin <email address hidden>

3de29da... by Marc Herbert <email address hidden> on 2020-11-02

testbench: make lib_table actually global and stop passing it around

This fixes compilation with:

  CFLAGS=-fno-common ./scripts/rebuild-testbench.sh

  sof/tools/testbench/topology.c:24: multiple definition of `lib_table';
  sof/tools/testbench/testbench.c:39: first defined here

This was detected by Gentoo 10 which uses -fno-common by default, thanks
Guennadi for the report and investigation.

Commit 03067c6c7709 ("host: set up shared library table") introduced a
strange "lib_table" symbol that was apparently meant to be global but
was not really because of some confusion between arrays and pointers and
needed to be passed around and "initialized to itself" (!) at run time
as seen in the sample trace below:

topology.c

struct shared_lib_table *lib_table;

parse_topology(..., library_table,...)
{

        printf("DEBUG1 ----- %p, %p, %p\n",
                  &lib_table, lib_table, library_table);

        lib_table = library_table;

        printf("DEBUG2 ----- %p, %p, %p\n",
                 &lib_table, lib_table, library_table);

}

Log:

    DEBUG1 ----- 0x56298c954040, 0x56298c951183, 0x56298c954040

    DEBUG2 ----- 0x56298c954040, 0x56298c954040, 0x56298c954040

Signed-off-by: Marc Herbert <email address hidden>

51c034c... by Pin-chih Lin <email address hidden> on 2020-11-04

tools: tune: Generate ctrl bytes from params for DRC

Used the similar parameter set as the DRC kernel in CRAS to generate ctrl
bytes for DRC component.

Plotted input-output dB response curve with the specific parameter set.

Signed-off-by: Pin-chih Lin <email address hidden>

9b5f48b... by Karol Trzcinski <email address hidden> on 2020-10-13

pipeline: Fix spelling error

Changed `coomponents` to `components`

Signed-off-by: Karol Trzcinski <email address hidden>

2aa62e1... by Marc Herbert <email address hidden> on 2020-10-30

rebuild-testbench.sh: don't build twice with combined "make install"

"make + make install" duplicates many steps, probably because of the
fatal combination of build timestamps + source hash, see PR #3353 for a
similar example.

A single, combined "make install" generates the exact same binary
outputs 30% faster and prints 30% shorter build logs.

Signed-off-by: Marc Herbert <email address hidden>

137c90b... by Karol Trzcinski <email address hidden> on 2020-10-29

buffer: Move functions using trace system to buffer.c

Then trace location in output trace file is correct.

Signed-off-by: Karol Trzcinski <email address hidden>

fb838de... by Karol Trzcinski <email address hidden> on 2020-10-16

buffer: Move buffer_params_match() implementation to buffer.c file

Assertions don't show proper location for functions implemented
in header file.
Before changes, example location of this assert was:
   Location: src/audio/pipeline.c:303

Signed-off-by: Karol Trzcinski <email address hidden>