From 4976ac7ef9189cf0cb33b81767426f33484051d4 Mon Sep 17 00:00:00 2001 From: Martin Geier Date: Wed, 27 Nov 2024 16:23:24 +0100 Subject: [PATCH] alsa-pcm: add dsd bit order parameter Signed-off-by: Martin Geier --- spa/plugins/alsa/alsa-pcm.c | 4 +++- spa/plugins/alsa/alsa-pcm.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index 9bcf56053..15ced4466 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -208,6 +208,8 @@ static int alsa_set_param(struct state *state, const char *k, const char *s) state->htimestamp_max_errors = atoi(s); } else if (spa_streq(k, "api.alsa.auto-link")) { state->auto_link = spa_atob(s); + } else if (spa_streq(k, "api.alsa.dsd-lsb")) { + state->dsd_lsb = spa_atob(s); } else if (spa_streq(k, "latency.internal.rate")) { state->process_latency.rate = atoi(s); } else if (spa_streq(k, "latency.internal.ns")) { @@ -1918,7 +1920,7 @@ static int enum_dsd_formats(struct state *state, uint32_t index, uint32_t *next, 0); spa_pod_builder_prop(b, SPA_FORMAT_AUDIO_bitorder, 0); - spa_pod_builder_id(b, SPA_PARAM_BITORDER_msb); + spa_pod_builder_id(b, state->dsd_lsb ? SPA_PARAM_BITORDER_lsb : SPA_PARAM_BITORDER_msb); spa_pod_builder_prop(b, SPA_FORMAT_AUDIO_interleave, 0); spa_pod_builder_int(b, interleave); diff --git a/spa/plugins/alsa/alsa-pcm.h b/spa/plugins/alsa/alsa-pcm.h index cc0b107e4..6fb4a3403 100644 --- a/spa/plugins/alsa/alsa-pcm.h +++ b/spa/plugins/alsa/alsa-pcm.h @@ -228,6 +228,7 @@ struct state { unsigned int is_pro:1; unsigned int sources_added:1; unsigned int auto_link:1; + unsigned int dsd_lsb:1; unsigned int linked:1; unsigned int is_batch:1; unsigned int force_rate:1;