Merge branch 'topic/sof-hdmi-chmap' into 'master'

alsa: Disable use-chmap for HDMI PCMs on SOF cards

See merge request pipewire/pipewire!2647
This commit is contained in:
Péter Ujfalusi 2025-12-19 13:00:00 +02:00
commit 1818edfd09

View file

@ -973,13 +973,6 @@ int spa_alsa_init(struct state *state, const struct spa_dict *info)
if (info && (str = spa_dict_lookup(info, "device.profile.pro")) != NULL)
state->is_pro = spa_atob(str);
if (info && spa_strstartswith(spa_dict_lookup(info, SPA_KEY_API_ALSA_CARD_NAME), "sof-") &&
state->stream == SND_PCM_STREAM_PLAYBACK) {
state->use_period_size_min_as_headroom = true;
spa_log_info(state->log,
"ALSA SOF driver detected: default api.alsa.use-period-size-min-as-headroom=true");
}
state->multi_rate = true;
state->htimestamp = false;
state->htimestamp_max_errors = MAX_HTIMESTAMP_ERROR;
@ -1045,6 +1038,19 @@ int spa_alsa_init(struct state *state, const struct spa_dict *info)
state->iec958_codecs |= 1ULL << SPA_AUDIO_IEC958_CODEC_PCM;
}
if (info && spa_strstartswith(spa_dict_lookup(info, SPA_KEY_API_ALSA_CARD_NAME), "sof-") &&
state->stream == SND_PCM_STREAM_PLAYBACK) {
state->use_period_size_min_as_headroom = true;
spa_log_info(state->log,
"ALSA SOF driver detected: default api.alsa.use-period-size-min-as-headroom=true");
if (info && spa_strstartswith(spa_dict_lookup(info, "alsa.id"), "HDMI")) {
state->props.use_chmap = false;
spa_log_info(state->log, "Disable use-chmap by default for SOF %s",
spa_dict_lookup(info, "alsa.id"));
}
}
state->card = ensure_card(state->card_index, state->open_ucm, state->is_split_parent);
state->log_file = fopencookie(state, "w", io_funcs);