Skip to content

Tools: Topology2: Add SRC component to cavs-nocodec.conf topologies - #7547

Merged
kv2019i merged 3 commits into
thesofproject:mainfrom
singalsu:nocodec_tplg2_add_src
Sep 5, 2023
Merged

Tools: Topology2: Add SRC component to cavs-nocodec.conf topologies#7547
kv2019i merged 3 commits into
thesofproject:mainfrom
singalsu:nocodec_tplg2_add_src

Conversation

@singalsu

Copy link
Copy Markdown
Collaborator

This patch adds 8 - 192 kHz playback and capture SRC to nocodec topologies such sof-tgl-nocodec.tplg. It enables testing of SRC component with IPC4.

@singalsu

singalsu commented May 2, 2023

Copy link
Copy Markdown
CollaboratorAuthor

The topology sof-tgl-nocodec.tplg after change, see pipelines for copier.host.5.1 and copier.host.11.1:

sof-tgl-nocodec

Updated picture after rebase & conflict fix:

sof-tgl-nocodec

@plbossartplbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea to add SRC @singalsu, see a couple of comments below.

Comment threadtools/topology/topology2/include/components/src.conf Outdated
Comment threadtools/topology/topology2/include/components/src_format_host_capture.conf Outdated
Comment threadtools/topology/topology2/include/components/src_format_host_capture.conf Outdated
Comment threadtools/topology/topology2/include/pipelines/cavs/host-src-capture.conf Outdated
@ranj063

Copy link
Copy Markdown
Collaborator

@singalsu you need the kernel patches first before this tplg change right?

@singalsu
singalsuforce-pushed the nocodec_tplg2_add_src branch from 4639ad6 to 71a1a68CompareMay 5, 2023 16:22
@singalsusingalsu mentioned this pull request May 8, 2023
@singalsu
singalsuforce-pushed the nocodec_tplg2_add_src branch from 71a1a68 to 6af9726CompareMay 9, 2023 11:02
@singalsu

singalsu commented May 9, 2023

Copy link
Copy Markdown
CollaboratorAuthor

@singalsu you need the kernel patches first before this tplg change right?

Yep, it can't work without your PR

Comment threadtools/topology/topology2/cavs-nocodec.conf Outdated
@singalsu
singalsuforce-pushed the nocodec_tplg2_add_src branch 2 times, most recently from d7ed044 to 457b0d3CompareMay 24, 2023 10:20
@singalsu
singalsuforce-pushed the nocodec_tplg2_add_src branch from 457b0d3 to fa682bfCompareJune 1, 2023 09:30
@singalsu
singalsu requested review from plbossart and ranj063June 1, 2023 09:31
@ranj063

Copy link
Copy Markdown
Collaborator

SOFCI TEST

@singalsu
singalsuforce-pushed the nocodec_tplg2_add_src branch from fa682bf to 355c979CompareJune 13, 2023 09:37
@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

No changes, rebase and push in hope to get all green result. Previous run had 43 successful, 1 failing (unrelated looking sof-ci/jenkins/per-device-test/main-ace fail.

@singalsu
singalsuforce-pushed the nocodec_tplg2_add_src branch from 355c979 to 795000bCompareJune 19, 2023 08:16
@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

No changes, pushed again to see better success with CI.

@kv2019i

Copy link
Copy Markdown
Collaborator

Test speaker test is still failing https://sof-ci.01.org/sofpr/PR7547/build9796/devicetest/index.html?model=TGLU_RVP_NOCODEC_IPC4ZPH&testcase=test-speaker

@kv2019i

Copy link
Copy Markdown
Collaborator

@singalsu Let's file a but to https://github.com/thesofproject/sof-test/issues . I think we need a test case fix first to merge this as otherwise every PR test will fail to this and this can mask other bugs.

@marc-hb

Copy link
Copy Markdown
Collaborator

@singalsu Let's file a but to https://github.com/thesofproject/sof-test/issues .

Because it's the same organization, we can transfer issues from sof to sof-test in just one click, check the right side of this page.

@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

@lgirdwood@kv2019i Please prioritize since we have a testing gap for SRC component. This PR has been available since May.

@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

@lgirdwood@kv2019i Please prioritize since we have a testing gap for SRC component. This PR has been available since May.

Seems we have still the bug in alsabat speaker test CI script. For non-48 kHz rates it should not use -t wav but -t pink because the "left", "right" utterances wav files are for 48 kHz tests only. The pink noise test supports any rate. So need to put priority to fix CI to get green result for this PR.

@lgirdwood

Copy link
Copy Markdown
Member

@singalsu pls ping when ready with test updates.

@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

@kv2019i Previous run, 45 successful and 2 unrelated failing checks, trying to get all green with new push. No changes.

@singalsu
singalsuforce-pushed the nocodec_tplg2_add_src branch 2 times, most recently from 7ce166a to 0e83c1cCompareAugust 15, 2023 09:23
@lgirdwood

Copy link
Copy Markdown
Member

SOFCI TEST

@lgirdwood

Copy link
Copy Markdown
Member

@singalsu rerunning CI, as a lot of red in the results so possibly a regression.

@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

@singalsu rerunning CI, as a lot of red in the results so possibly a regression.

Yes there seems to be a regression. FW crashes to exception with capture direction SRC.

@lgirdwood

Copy link
Copy Markdown
Member

@singalsu rerunning CI, as a lot of red in the results so possibly a regression.

Yes there seems to be a regression. FW crashes to exception with capture direction SRC.

Can you merge @marcinszkudlinski SRC rate fix PR locally and retry, may be a dependecy.

@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

@singalsu rerunning CI, as a lot of red in the results so possibly a regression.

Yes there seems to be a regression. FW crashes to exception with capture direction SRC.

Can you merge @marcinszkudlinski SRC rate fix PR locally and retry, may be a dependecy.

It doesn't help. There's something else wrong too.

@@ -0,0 +1,346 @@
#src format array

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I know the SRC module real capability? I mean does it really support all input format --> output format sample rate converter?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can see the conversions matrix in https://github.com/thesofproject/sof/blob/main/tools/tune/src/src_ipc4_int32.m. There are not many unsupported in/out rates, those zeros.

#
# PCM1 ---> gain ---> Mixin ---> Mixout ---> gain ---> SSP1
# PCM2 ---> gain ---> Mixin ---> Mixout ---> gain ---> SSP2
# PCM2 ---> SRC ---> Mixin ---> Mixout ---> gain ---> SSP2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in your tplg, PCM2-->gain-->SRC?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, I need to fix the comment.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

This patch removes rule to require fixed rate_out for SRC
widget. A capture SRC in host pipeline or near it has typically
variable output rate.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch replaces src_format.conf and src_passthrough_format.conf
with more specific formats definitions for host copiers,
pass-through components, playback src, and capture src.
The DSP internal pipelines are 32 bits, so src_s32_passthrough.conf
is used for components like gain those pass the 8 - 192 kHz
rates with s32 format.
The formats in src_format_sxx_to_s32_convert.conf is for use for
for playback host copier. Input formats are s16/24/32 and the only
output format is s32. Similarly the src_format_s32_to_sxx_convert.conf
is for capture host copier.
The formats for playback SRC are in src_format_s32_convert_to_48k.conf,
and the formats for capture are in src_format_s32_convert_from_48k.conf.
The new formats definitions use the input_audio_format and
output_audio_format objects instead of audio_format. The unnecessary
word lengths are removed to minimize the formats count in every
component.
The pipelines host-copier-gain-src-mixin-playback.conf and
src-gain-mixin-playback.conf those used the previous format definitions
are updated with these changes.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@singalsu
singalsuforce-pushed the nocodec_tplg2_add_src branch from 0e83c1c to 2fdf3e9CompareSeptember 1, 2023 14:59
@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

CI result "46 successful and 1 failing checks". Failed is sparse and this is all topology so not related.

I'll fix next the comment issue found by @btian1 .

This patch adds 8 - 192 kHz playback and capture SRC to nocodec
topologies such sof-tgl-nocodec.tplg. It enables testing of SRC
component with IPC4 via the SSP loopback in the nocodec topologies
E.g. Play random noise at 44.1 kHz and capture it as 32 kHz. The
SSP loopback runs internally at 48 kHz.
aplay -Dhw:0,2 -f S32_LE -c 2 -r 44100 -d 10 -t raw /dev/random
arecord -Dhw:0,2 -f S16_LE -c 2 -r 32000 -d 10 /tmp/recording.wav
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@singalsu
singalsuforce-pushed the nocodec_tplg2_add_src branch from 2fdf3e9 to d97a963CompareSeptember 1, 2023 18:40
@singalsu
singalsu requested a review from btian1September 1, 2023 18:41
@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

Nice, "46 successful and 1 failing checks", the failing sparse is not related.

@kv2019i
kv2019i merged commit 2a7a94d into thesofproject:mainSep 5, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@singalsu@ranj063@kv2019i@marc-hb@lgirdwood@plbossart@btian1@andrula-song