Skip to content

Commit 7e6618b

Browse files
lrgirdwoclaude
andcommitted
topology2: add ffmpeg_dec benchmark test topology
Add the ffmpeg_dec component to the host->component->host benchmark harness so a topology instantiating the module can be built and driven (testbench or target). Adds the per-format bench configs (generated with bench_comp_generate.sh), registers the widget include and the ffmpeg_dec32 BENCH_CONFIG in cavs-benchmark-hda.conf, and adds ffmpeg_dec to the s32 component list in tplg-targets-bench.cmake (the filter effect path processes S32). Also drop the codec-setup bytes control from the ffmpeg_dec widget class so it is a plain 1-in/1-out effect; the decoder's STREAMINFO control is added at the instance level in a decoder topology instead. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 06ac7bc commit 7e6618b

9 files changed

Lines changed: 103 additions & 17 deletions

File tree

tools/topology/topology2/cavs-benchmark-hda.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<drc.conf>
3838
<eqiir.conf>
3939
<eqfir.conf>
40+
<ffmpeg_dec.conf>
4041
<gain.conf>
4142
<igo_nr.conf>
4243
<level_multiplier.conf>
@@ -1026,4 +1027,8 @@ IncludeByKey.BENCH_CONFIG {
10261027
"template_comp32" {
10271028
<include/bench/template_comp_s32.conf>
10281029
}
1030+
1031+
"ffmpeg_dec32" {
1032+
<include/bench/ffmpeg_dec_s32.conf>
1033+
}
10291034
}

tools/topology/topology2/development/tplg-targets-bench.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ set(component_parameters_s24
7373

7474
set(components_s32
7575
"micsel_multich"
76+
"ffmpeg_dec"
7677
)
7778

7879
set(component_parameters_s32
7980
"BENCH_MICSEL_PARAMS=default"
81+
"BENCH_FFMPEG_DEC_PARAMS=default"
8082
)
8183

8284
set (plat "mtl")
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Created initially with script "bench_comp_generate.sh ffmpeg_dec"
2+
# may need edits to modify controls
3+
Object.Control {
4+
# Un-comment the supported controls in FFMPEG_DEC
5+
#bytes."1" {
6+
# name '$ANALOG_CAPTURE_PCM FFMPEG_DEC bytes'
7+
# IncludeByKey.BENCH_FFMPEG_DEC_PARAMS {
8+
# "default" "include/components/ffmpeg_dec/default.conf"
9+
# }
10+
#}
11+
#mixer."1" {
12+
# name '$ANALOG_CAPTURE_PCM FFMPEG_DEC switch or volume'
13+
#}
14+
#enum."1" {
15+
# name '$ANALOG_CAPTURE_PCM FFMPEG_DEC enum'
16+
#}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Created initially with script "bench_comp_generate.sh ffmpeg_dec"
2+
# may need edits to modify controls
3+
Object.Control {
4+
# Un-comment the supported controls in FFMPEG_DEC
5+
#bytes."1" {
6+
# name '$ANALOG_PLAYBACK_PCM FFMPEG_DEC bytes'
7+
# IncludeByKey.BENCH_FFMPEG_DEC_PARAMS {
8+
# "default" "include/components/ffmpeg_dec/default.conf"
9+
# }
10+
#}
11+
#mixer."1" {
12+
# name '$ANALOG_PLAYBACK_PCM FFMPEG_DEC switch or volume'
13+
#}
14+
#enum."1" {
15+
# name '$ANALOG_PLAYBACK_PCM FFMPEG_DEC enum'
16+
#}
17+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Created with script "bench_comp_generate.sh ffmpeg_dec"
2+
Object.Base.route [
3+
{
4+
sink '$BENCH_PLAYBACK_DAI_COPIER'
5+
source 'ffmpeg_dec.$BENCH_PLAYBACK_HOST_PIPELINE.1'
6+
}
7+
{
8+
sink 'ffmpeg_dec.$BENCH_PLAYBACK_HOST_PIPELINE.1'
9+
source 'host-copier.0.playback'
10+
}
11+
{
12+
source '$BENCH_CAPTURE_DAI_COPIER'
13+
sink 'ffmpeg_dec.$BENCH_CAPTURE_HOST_PIPELINE.2'
14+
}
15+
{
16+
source 'ffmpeg_dec.$BENCH_CAPTURE_HOST_PIPELINE.2'
17+
sink 'host-copier.0.capture'
18+
}
19+
]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Created with script "bench_comp_generate.sh ffmpeg_dec"
2+
Object.Widget.ffmpeg_dec.1 {
3+
index $BENCH_PLAYBACK_HOST_PIPELINE
4+
<include/bench/one_input_output_format_s16.conf>
5+
<include/bench/ffmpeg_dec_controls_playback.conf>
6+
}
7+
Object.Widget.ffmpeg_dec.2 {
8+
index $BENCH_CAPTURE_HOST_PIPELINE
9+
<include/bench/one_input_output_format_s16.conf>
10+
<include/bench/ffmpeg_dec_controls_capture.conf>
11+
}
12+
<include/bench/host_gateway_pipelines_s16.conf>
13+
<include/bench/ffmpeg_dec_route.conf>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Created with script "bench_comp_generate.sh ffmpeg_dec"
2+
Object.Widget.ffmpeg_dec.1 {
3+
index $BENCH_PLAYBACK_HOST_PIPELINE
4+
<include/bench/one_input_output_format_s24.conf>
5+
<include/bench/ffmpeg_dec_controls_playback.conf>
6+
}
7+
Object.Widget.ffmpeg_dec.2 {
8+
index $BENCH_CAPTURE_HOST_PIPELINE
9+
<include/bench/one_input_output_format_s24.conf>
10+
<include/bench/ffmpeg_dec_controls_capture.conf>
11+
}
12+
<include/bench/host_gateway_pipelines_s24.conf>
13+
<include/bench/ffmpeg_dec_route.conf>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Created with script "bench_comp_generate.sh ffmpeg_dec"
2+
Object.Widget.ffmpeg_dec.1 {
3+
index $BENCH_PLAYBACK_HOST_PIPELINE
4+
<include/bench/one_input_output_format_s32.conf>
5+
<include/bench/ffmpeg_dec_controls_playback.conf>
6+
}
7+
Object.Widget.ffmpeg_dec.2 {
8+
index $BENCH_CAPTURE_HOST_PIPELINE
9+
<include/bench/one_input_output_format_s32.conf>
10+
<include/bench/ffmpeg_dec_controls_capture.conf>
11+
}
12+
<include/bench/host_gateway_pipelines_s32.conf>
13+
<include/bench/ffmpeg_dec_route.conf>

tools/topology/topology2/include/components/ffmpeg_dec.conf

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,10 @@ Class.Widget."ffmpeg_dec" {
4141
token_ref "comp.word"
4242
}
4343

44-
#
45-
# Bytes control carrying the codec setup header (e.g. FLAC STREAMINFO).
46-
# get/put op 258 is the standard bytes control handler.
47-
#
48-
Object.Control.bytes."1" {
49-
!access [
50-
tlv_read
51-
tlv_write
52-
tlv_callback
53-
]
54-
Object.Base.extops.1 {
55-
name "extctl"
56-
get 258
57-
put 258
58-
}
59-
max 2048
60-
}
44+
# NOTE: this widget class is a plain 1-in/1-out effect. The decoder's
45+
# codec-setup (FLAC STREAMINFO) bytes control is added at the instance level
46+
# in the decoder topology (an instance may add its own Object.Control), so
47+
# the filter/effect use of this widget needs no control.
6148

6249
# Attribute categories
6350
attributes {

0 commit comments

Comments
 (0)