From f7d756460e5cdb585752a44cfb673b9e63c483be Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 25 Feb 2021 21:16:16 +0100 Subject: [PATCH] alsa: add option to use device channel map instead of default See #461 --- spa/plugins/alsa/alsa-pcm-sink.c | 2 ++ spa/plugins/alsa/alsa-pcm-source.c | 2 ++ src/daemon/media-session.d/alsa-monitor.conf | 1 + 3 files changed, 5 insertions(+) diff --git a/spa/plugins/alsa/alsa-pcm-sink.c b/spa/plugins/alsa/alsa-pcm-sink.c index 9626c38c2..0a706223b 100644 --- a/spa/plugins/alsa/alsa-pcm-sink.c +++ b/spa/plugins/alsa/alsa-pcm-sink.c @@ -801,6 +801,8 @@ impl_init(const struct spa_handle_factory *factory, this->disable_mmap = (strcmp(s, "true") == 0 || atoi(s) == 1); } else if (!strcmp(info->items[i].key, "api.alsa.disable-batch")) { this->disable_batch = (strcmp(s, "true") == 0 || atoi(s) == 1); + } else if (!strcmp(info->items[i].key, "api.alsa.use-chmap")) { + this->props.use_chmap = (strcmp(s, "true") == 0 || atoi(s) == 1); } } return 0; diff --git a/spa/plugins/alsa/alsa-pcm-source.c b/spa/plugins/alsa/alsa-pcm-source.c index 3ed2fb0f4..7c768eea9 100644 --- a/spa/plugins/alsa/alsa-pcm-source.c +++ b/spa/plugins/alsa/alsa-pcm-source.c @@ -822,6 +822,8 @@ impl_init(const struct spa_handle_factory *factory, this->disable_mmap = (strcmp(s, "true") == 0 || atoi(s) == 1); } else if (!strcmp(info->items[i].key, "api.alsa.disable-batch")) { this->disable_batch = (strcmp(s, "true") == 0 || atoi(s) == 1); + } else if (!strcmp(info->items[i].key, "api.alsa.use-chmap")) { + this->props.use_chmap = (strcmp(s, "true") == 0 || atoi(s) == 1); } } return 0; diff --git a/src/daemon/media-session.d/alsa-monitor.conf b/src/daemon/media-session.d/alsa-monitor.conf index 0c48ae550..dd4ebaf42 100644 --- a/src/daemon/media-session.d/alsa-monitor.conf +++ b/src/daemon/media-session.d/alsa-monitor.conf @@ -99,6 +99,7 @@ rules = [ #api.alsa.headroom = 0 #api.alsa.disable-mmap = false #api.alsa.disable-batch = false + #api.alsa.use-chmap = false #session.suspend-timeout-seconds = 5 # 0 disables suspend } }