Skip to content

Commit b5b772d

Browse files
committed
Merge remote-tracking branch 'sof/master' into sof_update
2 parents 9e75cce + 385cf89 commit b5b772d

File tree

48 files changed

+743
-194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+743
-194
lines changed

.github/workflows/pull-request.yml

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
---
2+
# Tools that can save round-trips to github and a lot of time:
3+
#
4+
# yamllint -f parsable pull_request.yml
5+
# pip3 install ruamel.yaml.cmd
6+
# yaml merge-expand pull_request.yml exp.yml &&
7+
# diff -w -u pull_request.yml exp.yml
8+
#
9+
# github.com also has a powerful web editor that can be used without
10+
# committing.
11+
12+
name: Pull Requests
13+
14+
# yamllint disable-line rule:truthy
15+
on:
16+
push:
17+
branches: [master]
18+
pull_request:
19+
branches: [master]
20+
21+
# Allows you to run this workflow manually from the Actions tab
22+
workflow_dispatch:
23+
24+
# Some jobs may not need submodules but for now our CMakeLists.txt
25+
# systemically downloads them anyway when missing at build time. Easier
26+
# and cleaner to clone everything at once.
27+
28+
jobs:
29+
30+
doxygen:
31+
runs-on: ubuntu-20.04
32+
33+
steps:
34+
- uses: actions/checkout@v2
35+
36+
- name: apt get doxygen graphviz
37+
run: sudo apt-get -y install ninja-build doxygen graphviz
38+
39+
- name: list all warnings, warnings are not failures
40+
run: cmake -GNinja -S doc -B docbuild && ninja -C docbuild -v doc
41+
42+
# Build again (it's very quick) so warnings don't go unnoticed
43+
- name: fail and stop on first warning
44+
run: printf 'WARN_AS_ERROR = YES\n' >> doc/sof.doxygen.in &&
45+
ninja -C docbuild -v doc
46+
47+
48+
testbench:
49+
runs-on: ubuntu-20.04
50+
51+
steps:
52+
- uses: actions/checkout@v2
53+
with: {fetch-depth: 0, submodules: recursive}
54+
55+
- name: docker
56+
run: docker pull thesofproject/sof && docker tag thesofproject/sof sof
57+
58+
# testbench needs some topologies
59+
- name: build topologies
60+
run: ./scripts/docker-run.sh ./scripts/build-tools.sh -t
61+
- name: build testbench
62+
run: ./scripts/docker-run.sh ./scripts/rebuild-testbench.sh
63+
- name: test
64+
run: ./scripts/host-testbench.sh
65+
66+
67+
SOF-build-only:
68+
runs-on: ubuntu-20.04
69+
70+
strategy:
71+
matrix:
72+
platform: [sue jsl tgl]
73+
74+
steps:
75+
76+
- uses: actions/checkout@v2
77+
with: {fetch-depth: 0, submodules: recursive}
78+
79+
- name: docker
80+
run: docker pull thesofproject/sof && docker tag thesofproject/sof sof
81+
82+
- name: xtensa-build-all
83+
env:
84+
PLATFORM: ${{ matrix.platform }}
85+
run: ./scripts/docker-run.sh
86+
./scripts/xtensa-build-all.sh -r ${PLATFORM}
87+
88+
# Warning: there is a fair amount of duplication between 'build-only'
89+
# and 'qemu-boot' because github does not support YAML anchors as of Jan
90+
# 2021. Defining our new actions would be overkill. Another popular
91+
# option is to generate this file from a source with YAML anchors
92+
# before committing it; also deemed overkill for the current amount of
93+
# duplication.
94+
95+
SOF-qemu-boot:
96+
runs-on: ubuntu-20.04
97+
98+
strategy:
99+
matrix:
100+
# Compiler-based grouping, see HOST= in xtensa-build-all.sh The
101+
# only reason for grouping is to avoid the matrix swarming the
102+
# user interface and burying other checks.
103+
platform: [imx8 imx8x imx8m,
104+
byt cht, bdw hsw, apl skl kbl, cnl icl]
105+
106+
steps:
107+
108+
- uses: actions/checkout@v2
109+
with: {fetch-depth: 0, submodules: recursive}
110+
111+
# FIXME: could/should probably use ./scripts/xtensa-build-all.sh
112+
# -o agent.config instead of hiding this here.
113+
- name: turn off HAVE_AGENT
114+
run: sed -i $(($(grep "config HAVE_AGENT" -n src/platform/Kconfig |
115+
cut -f1 -d:)+2))"s/default y/default n/" src/platform/Kconfig
116+
117+
- name: docker SOF
118+
run: docker pull thesofproject/sof && docker tag thesofproject/sof sof
119+
120+
- name: xtensa-build-all
121+
env:
122+
PLATFORM: ${{ matrix.platform }}
123+
run: ./scripts/docker-run.sh
124+
./scripts/xtensa-build-all.sh -r ${PLATFORM}
125+
126+
- name: docker QEMU
127+
run: docker pull thesofproject/sofqemu &&
128+
docker tag thesofproject/sofqemu sofqemu
129+
130+
- name: qemu-check
131+
env:
132+
PLATFORM: ${{ matrix.platform }}
133+
run: ./scripts/docker-qemu.sh
134+
../sof.git/scripts/qemu-check.sh ${PLATFORM}
135+
136+
yamllint-actions:
137+
runs-on: ubuntu-20.04
138+
139+
steps:
140+
- uses: actions/checkout@v2
141+
142+
- name: apt install yamllint
143+
run: sudo apt-get -y install yamllint
144+
145+
- name: yamllint github actions
146+
run: yamllint .github/workflows/pull-request.yml

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ jobs:
3939
./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -r $PLATFORM
4040
env: PLATFORM='jsl'
4141

42+
- <<: *build-platform
43+
env: PLATFORM='sue'
44+
4245
- <<: *build-platform
4346
env: PLATFORM='tgl'
4447

CODEOWNERS

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Each line is a file pattern followed by one or more owners.
33

44
# These owners will be the default owners for everything in the repo.
5-
* @lgirdwood @plbossart @mmaka1 @lbetlej @dbaluta @jajanusz
5+
* @lgirdwood @plbossart @mmaka1 @lbetlej @dbaluta
66

77
# Order is important. The last matching pattern has the most precedence.
88
# So if a pull request only touches javascript files, only these owners
@@ -54,11 +54,10 @@ src/debug/gdb/* @mrajwa
5454
src/schedule @mrajwa
5555

5656
# other helpers
57-
test/** @jajanusz
5857
# Mostly overridden by *.(ba)sh below
5958
scripts/* @xiulipan @marc-hb
6059

61-
# tools(old soft)
60+
# tools(old 'soft' repo)
6261
tools/logger/* @xiulipan @bkokoszx @akloniex
6362
tools/topology/* @ranj063 @xiulipan
6463
tools/testbench/* @ranj063
@@ -72,13 +71,13 @@ tools/tune/drc/* @cujomalainey @johnylin76 @dgreid
7271
tools/oss-fuzz/* @cujomalainey
7372

7473
# build system
75-
**/CMakeLists.txt @jajanusz
76-
**/Kconfig @jajanusz
77-
scripts/cmake/** @jajanusz
78-
scripts/kconfig/** @jajanusz
74+
# **/CMakeLists.txt
75+
# **/Kconfig
76+
# scripts/cmake/**
77+
# scripts/kconfig/**
7978

80-
*.sh @jajanusz @marc-hb
81-
*.bash @jajanusz @marc-hb
79+
*.sh @marc-hb
80+
*.bash @marc-hb
8281
*trace.* @xiulipan @akloniex
8382

8483
# You can also use email addresses if you prefer.

scripts/build-tools.sh

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,14 @@ make_tool()
4040
# okay.
4141
tool=$1
4242

43-
# 'cd' is unfortunately much less verbose than 'make -C'.
44-
# 'MAKEFLAGS=--no-print-directory' works too but let's not
45-
# interfere with the user's environment.
46-
( cd "$BUILD_TOOLS_DIR"
47-
# shellcheck disable=SC2086
48-
make -j "$NO_PROCESSORS" $tool
49-
)
43+
# shellcheck disable=SC2086
44+
cmake --build $BUILD_TOOLS_DIR -- -j "$NO_PROCESSORS" $tool
45+
5046
}
5147

5248
make_fuzzer()
5349
{
54-
( cd "$BUILD_TOOLS_DIR"/fuzzer
55-
make -j "$NO_PROCESSORS"
56-
)
50+
cmake --build "$BUILD_TOOLS_DIR"/fuzzer -- -j "$NO_PROCESSORS"
5751
}
5852

5953
print_build_info()

scripts/docker-run.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@
1010
# To build topology:
1111
# ./scripts/docker-run.sh ./scripts/build-tools.sh
1212

13-
docker run -i -t -v "$(pwd)":/home/sof/work/sof.git \
13+
# set -x
14+
15+
if tty --quiet; then
16+
SOF_DOCKER_RUN="$SOF_DOCKER_RUN --tty"
17+
fi
18+
19+
docker run -i -v "$(pwd)":/home/sof/work/sof.git \
1420
--env CMAKE_BUILD_TYPE \
1521
--env PRIVATE_KEY_OPTION \
16-
--user "$(id -u)" sof "$@"
22+
--user "$(id -u)" \
23+
$SOF_DOCKER_RUN \
24+
sof "$@"

scripts/rebuild-testbench.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ rebuild_testbench()
2525

2626
cmake -DCMAKE_INSTALL_PREFIX=install ..
2727

28-
make -j"$(nproc)" install
28+
cmake --build . -- -j"$(nproc)" install
2929
}
3030

3131
export_CC_with_afl()

scripts/xtensa-build-all.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ do
355355
"${PRIVATE_KEY_OPTION}" \
356356
..
357357

358-
make ${PLATFORM}${DEFCONFIG_PATCH}_defconfig
358+
cmake --build . -- ${PLATFORM}${DEFCONFIG_PATCH}_defconfig
359359
)
360360

361361
if [ -n "$OVERRIDE_CONFIG" ]
@@ -365,7 +365,7 @@ do
365365

366366
if [[ "x$MAKE_MENUCONFIG" == "xyes" ]]
367367
then
368-
make menuconfig
368+
cmake --build . -- menuconfig
369369
fi
370370

371371
if [[ "x$BUILD_DEBUG" == "xyes" ]]
@@ -387,10 +387,10 @@ do
387387

388388
if [ -e override.config ]
389389
then
390-
make overrideconfig
390+
cmake --build . -- overrideconfig
391391
fi
392392

393-
make bin -j "${BUILD_JOBS}" ${BUILD_VERBOSE}
393+
cmake --build . -- bin -j "${BUILD_JOBS}" ${BUILD_VERBOSE}
394394

395395
cd "$WORKDIR"
396396
done # for platform in ...

src/arch/xtensa/configs/baytrail_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CONFIG_COMP_DCBLOCK=n
99
CONFIG_COMP_SRC=n
1010
CONFIG_COMP_ASRC=n
1111
CONFIG_COMP_TDFB=n
12+
CONFIG_COMP_TONE=n
1213
CONFIG_OPTIMIZE_FOR_SIZE=y
1314
CONFIG_HAVE_AGENT=n
1415
CONFIG_DEBUG_MEMORY_USAGE_SCAN=n

src/audio/Kconfig

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -328,23 +328,8 @@ config COMP_CODEC_ADAPTER
328328
"src\include\sof\audio\codec_adapter\interfaces.h". It is possible to link several
329329
different codecs and use them in parallel.
330330

331-
if COMP_CODEC_ADAPTER
332-
config CADENCE_CODEC
333-
bool "Cadence codec"
334-
default n
335-
help
336-
Select for codecs which conforms to the Cadence API.
337-
This will cause codec adapter component to include header
338-
files specific to CADENCE base codecs.
331+
rsource "codec_adapter/Kconfig"
339332

340-
config DUMMY_CODEC
341-
bool "Dummy codec"
342-
default n
343-
help
344-
Select for a dummy API codec implementation.
345-
This will cause codec adapter component to include header
346-
files specific to DUMMY base codecs.
347-
endif
348333
endmenu # "Audio components"
349334

350335
menu "Data formats"

src/audio/codec_adapter/Kconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
3+
menu "Codec Adapter codecs"
4+
visible if COMP_CODEC_ADAPTER
5+
6+
config CADENCE_CODEC
7+
bool "Cadence codec"
8+
default n
9+
help
10+
Select for codecs which conforms to the Cadence API.
11+
This will cause codec adapter component to include header
12+
files specific to CADENCE base codecs.
13+
14+
config DUMMY_CODEC
15+
bool "Dummy codec"
16+
default n
17+
help
18+
Select for a dummy API codec implementation.
19+
This will cause codec adapter component to include header
20+
files specific to DUMMY base codecs.
21+
endmenu

src/audio/drc/drc_math_generic.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ inline int32_t drc_sin_fixed(int32_t x)
112112
{
113113
const int32_t PI_OVER_TWO = Q_CONVERT_FLOAT(1.57079632679489661923f, 30);
114114

115-
return sin_fixed(q_mult(x, PI_OVER_TWO, 30, 30, 28));
115+
/* input range of sin_fixed() is non-negative */
116+
int32_t abs_sin_val = sin_fixed(q_mult(ABS(x), PI_OVER_TWO, 30, 30, 28));
117+
return SGN(x) < 0 ? -abs_sin_val : abs_sin_val;
116118
}
117119

118120
/*

src/audio/mixer.c

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -243,16 +243,13 @@ static int mixer_trigger(struct comp_dev *dev, int cmd)
243243
if (dir == SOF_IPC_STREAM_CAPTURE)
244244
return ret;
245245

246-
/* don't stop mixer if at least one source is active */
247-
if (mixer_source_status_count(dev, COMP_STATE_ACTIVE) &&
248-
(cmd == COMP_TRIGGER_PAUSE || cmd == COMP_TRIGGER_STOP)) {
246+
/* don't stop mixer on pause or if at least one source is active/paused */
247+
if (cmd == COMP_TRIGGER_PAUSE ||
248+
(cmd == COMP_TRIGGER_STOP &&
249+
(mixer_source_status_count(dev, COMP_STATE_ACTIVE) ||
250+
mixer_source_status_count(dev, COMP_STATE_PAUSED)))) {
249251
dev->state = COMP_STATE_ACTIVE;
250252
ret = PPL_STATUS_PATH_STOP;
251-
/* don't stop mixer if at least one source is paused */
252-
} else if (mixer_source_status_count(dev, COMP_STATE_PAUSED) &&
253-
cmd == COMP_TRIGGER_STOP) {
254-
dev->state = COMP_STATE_PAUSED;
255-
ret = PPL_STATUS_PATH_STOP;
256253
}
257254

258255
return ret;
@@ -299,9 +296,20 @@ static int mixer_copy(struct comp_dev *dev)
299296
return 0;
300297
}
301298

302-
/* don't have any work if all sources are inactive */
303-
if (num_mix_sources == 0)
299+
/* write zeros if all sources are inactive */
300+
if (num_mix_sources == 0) {
301+
buffer_lock(sink, &flags);
302+
frames = MIN(frames, audio_stream_get_free_frames(&sink->stream));
303+
sink_bytes = frames * audio_stream_frame_bytes(&sink->stream);
304+
buffer_unlock(sink, flags);
305+
306+
if (!audio_stream_set_zero(&sink->stream, sink_bytes)) {
307+
buffer_writeback(sink, sink_bytes);
308+
comp_update_buffer_produce(sink, sink_bytes);
309+
}
310+
304311
return 0;
312+
}
305313

306314
buffer_lock(sink, &flags);
307315

0 commit comments

Comments
 (0)