sof icon indicating copy to clipboard operation
sof copied to clipboard

Tools: Topology: Add to nocodec port2 24 kHz rate capability

Open singalsu opened this issue 3 months ago • 2 comments

This patch adds the 24 kHz rate to PCM capabilities. The 24 kHz rate is defined in the MPEG-2 standard. This also needs a patch to alsa-lib to build the topology without error.

The added rate_min/rate_max is not mandatory but it narrows down the range of rates evaluated in alsa-lib in snd_pcm_hw_refine().

singalsu avatar Sep 11 '25 13:09 singalsu

From Jenkins build log here, need the alsa-lib patch:

[9/372] Generating sof-tgl-nocodec.tplg
ALSA lib pcm.c:366:(split_rate) unsupported stream rate 24000
ALSA lib parser.c:211:(tplg_load_config) failed to parse topology
Unable to load configuration: Invalid argument

singalsu avatar Sep 11 '25 16:09 singalsu

LGTM, I guess you will make non draft when ALSA part is resolved.

Yep, this simple add only enables tplg build, the aplay - alsa-lib - kernel runtime issue still remains:

diff --git a/src/topology/pcm.c b/src/topology/pcm.c
index acec27f9..670f5efe 100644
--- a/src/topology/pcm.c
+++ b/src/topology/pcm.c
@@ -27,6 +27,7 @@ static const char *const snd_pcm_rate_names[] = {
        RATE(11025),
        RATE(16000),
        RATE(22050),
+       RATE(24000),
        RATE(32000),
        RATE(44100),
        RATE(48000),
diff --git a/src/topology/tplg_local.h b/src/topology/tplg_local.h
index 63639274..8f8ddece 100644
--- a/src/topology/tplg_local.h
+++ b/src/topology/tplg_local.h
@@ -47,6 +47,7 @@ typedef enum _snd_pcm_rates {
        SND_PCM_RATE_11025,
        SND_PCM_RATE_16000,
        SND_PCM_RATE_22050,
+       SND_PCM_RATE_24000,
        SND_PCM_RATE_32000,
        SND_PCM_RATE_44100,
        SND_PCM_RATE_48000,

singalsu avatar Sep 16 '25 10:09 singalsu