Skip to content

host: fix testbench and components - #1227

Merged
lgirdwood merged 7 commits into
thesofproject:masterfrom
jajanusz:testbench-fix
Apr 5, 2019
Merged

lgirdwood merged 7 commits into
thesofproject:masterfrom
jajanusz:testbench-fix

Conversation

@jajanusz

@jajanusz jajanusz commented Apr 4, 2019

Copy link
Copy Markdown
Contributor

For #1198 #1199 + some more things described in commit messages.

Looks like it has not been working for some time.
I guess that since switching to cmake we were just checking if it builds and if we want to support testbench we cannot continue like this. Aligning to changes introduced over months of development at once is a bit painful (CI builds it anyway, so it can run at least 1 test also, it takes microseconds).

jajanusz added 7 commits April 4, 2019 11:26
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Component should register itself when built as shared lib.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
All components should be added after sys_comp_init,
to be able to register themselves.
Dai and host are not used so it's better to just
remove them.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Component is registered in function added to shared lib's constructors.
We no longer call init found with dlsym, instead we delay delay
dlopen until we want to register comp.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
@jajanusz

jajanusz commented Apr 4, 2019

Copy link
Copy Markdown
Contributor Author

@singalsu
Please check if parse_topology still makes sense.

For command:

../../../build_host/install//bin/testbench -d -r 8000 -R 8000 -i chirp_test_in.raw -o chirp_test_out.raw -t ../../build_tools/test/topology/test-playback-ssp2-mclk-0-I2S-src-s16le-s16le-48k-24576k-nocodec.tplg -a src=libsof_src.so -b S16_LE

I was getting:

debug: topology parsing start
debug: type: 8, size: 0x70 count: 1 index: 0
debug: type: 5, size: 0x838 count: 9 index: 1
debug: number of DAPM widgets 9
debug: loading widget codec_out0 id 0
info: Widget type not supported 1
debug: loading widget PCM0P id 1
debug: registered file comp driver
debug: loading widget SRC1.0 id 2
debug: registered comp driver for src
debug: opening shared lib libsof_src.so
SRC src_new()debug: loading widget PGA1.0 id 3
debug: registered comp driver for vol
debug: opening shared lib libsof_volume.so
VOLUME volume_new()debug: loading widget BUF1.0 id 4
BUFFER buffer_new()debug: loading widget BUF1.1 id 5
BUFFER buffer_new()debug: loading widget BUF1.2 id 6
BUFFER buffer_new()debug: loading widget SSP2.OUT id 7
debug: loading widget PIPELINE.1.SSP2.OUT id 8
PIPE pipeline_new()debug: type: 5, size: 0x84 count: 1 index: 2
debug: number of DAPM widgets 1
debug: loading widget codec_out1 id 9
info: Widget type not supported 1
debug: type: 5, size: 0x84 count: 1 index: 3
debug: number of DAPM widgets 1
debug: loading widget codec_in0 id 10
info: Widget type not supported 0
debug: type: 5, size: 0x84 count: 1 index: 4
debug: number of DAPM widgets 1
debug: loading widget codec_in1 id 11
info: Widget type not supported 0
debug: type: 7, size: 0x390 count: 1 index: 0
debug: type: a, size: 0x6f0 count: 1 index: 0
debug: type: 4, size: 0x318 count: 6 index: 1

[...]

So final graph were trying to create pipeline just for last DAPM widgets group that had only 1 widget. Now I made it to aggregate all comps (+ removed leak btw), but I'm not sure that it's correct approach, cos I'm not expert in terms of tplg files.

@singalsu singalsu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This works for me, good work. Thanks @jajanusz !

@singalsu

singalsu commented Apr 5, 2019 •

Copy link
Copy Markdown
Collaborator

I was able to run sof-apl-src-pcm512x.tplg with this version. The actual test cases failed because volume component after SRC was not set up properly by testbench. So the volume loader & control needs further work.

The test topologies fail but they have been not maintained for a while (I tested with my SRC PR, it might also cause something). It would be better to create new ones, e.g. from sof-apl-pcm512x.m4 for volume test case and then other processing components by replacing volume. The test topologies were for DAI parameter variants initially anyway.

@lgirdwood

Copy link
Copy Markdown
Member

I was able to run sof-apl-src-pcm512x.tplg with this version. The actual test cases failed because volume component after SRC was not set up properly by testbench. So the volume loader & control needs further work.

ok, can you add that as an issue and work with @jajanusz on this for the testbench. If it's a quick fix we can include in v1.3.

The test topologies fail but they have been not maintained for a while (I tested with my SRC PR, it might also cause something). It would be better to create new ones, e.g. from sof-apl-pcm512x.m4 for volume test case and then other processing components by replacing volume. The test topologies were for DAI parameter variants initially anyway.

OK, we will need new one(s) for v1.3. Can you add this as a bug with milestone 1.3

@lgirdwood
lgirdwood merged commit 1795e4a into thesofproject:master Apr 5, 2019
Comment thread src/host/topology.c
num_comps = hdr->count;

for (i = 0; i < hdr->count; i++)
num_comps += hdr->count;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@jajanusz sorry for the delayed response. although harmless, this step is unnecessary because there will only ever be one DAPM_WIDGET header in topology containing all the widgets, if I am not mistaken. So the num_comps should just be equal to the hdr->count.

Sign up for free to 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.

4 participants