From b5b40d845caa9f115f1f7c66cec94ba0b2a821b4 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Fri, 6 Nov 2026 17:15:22 +0200 Subject: [PATCH] topology2: alh: pass DAI direction as a string tuple The ALH DAI class defines "direction" as a string attribute with token_ref "dai.word", but without a tuple_values mapping. As a result the string values "playback"/"capture" end up verbatim in a word tuple. Older alsa-lib converted such strings with strtoul() and silently encoded them as 0 (so capture links were also encoded as 0). Since alsa-lib commit c41be26af2d9 ("topology: use snd_config_get_llong() in tplg_get_integer/unsigned()"), non-numeric strings are rejected and the build of e.g. cavs-sdw.tplg fails with: ALSA lib data.c:866:(parse_tuple_set) [error.topology] tuple direction: Invalid argument The direction tuple ends up in the BE link private data. The Linux SOF driver has never parsed SOF_TKN_DAI_DIRECTION from link data (only from DAI widget data), in neither the pre-5.19 sof_parse_token_sets() nor the current sof_copy_tuples() based code, and both silently skip unknown tokens. Changing the tuple type is thus safe for old and new kernels. Switch the token_ref to "dai.string" so the direction is passed as a string tuple. Link: https://github.com/alsa-project/alsa-lib/commit/c41be26af2d9be9c32e215b151ea073347694e62 Signed-off-by: Kai Vehmanen --- tools/topology/topology2/include/dais/alh.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/topology/topology2/include/dais/alh.conf b/tools/topology/topology2/include/dais/alh.conf index 4f4908455cb6..4f9f5d2ef6cb 100644 --- a/tools/topology/topology2/include/dais/alh.conf +++ b/tools/topology/topology2/include/dais/alh.conf @@ -31,7 +31,7 @@ Class.Dai."ALH" { DefineAttribute."direction" { type "string" - token_ref "dai.word" + token_ref "dai.string" constraints { !valid_values [ "playback"