summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/alsa/alsa-sink.c9
-rw-r--r--src/modules/alsa/alsa-source.c9
-rw-r--r--src/modules/alsa/module-alsa-card.c8
3 files changed, 26 insertions, 0 deletions
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 2fdebe08b..63674e28f 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -2146,6 +2146,15 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
b = use_mmap;
d = use_tsched;
+ /* Force ALSA to reread its configuration if module-alsa-card didn't
+ * do it for us. This matters if our device was hot-plugged after ALSA
+ * has already read its configuration - see
+ * https://bugs.freedesktop.org/show_bug.cgi?id=54029
+ */
+
+ if (!card)
+ snd_config_update_free_global();
+
if (mapping) {
if (!(dev_id = pa_modargs_get_value(ma, "device_id", NULL))) {
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 4683dfe61..0820b48f1 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -1854,6 +1854,15 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
b = use_mmap;
d = use_tsched;
+ /* Force ALSA to reread its configuration if module-alsa-card didn't
+ * do it for us. This matters if our device was hot-plugged after ALSA
+ * has already read its configuration - see
+ * https://bugs.freedesktop.org/show_bug.cgi?id=54029
+ */
+
+ if (!card)
+ snd_config_update_free_global();
+
if (mapping) {
if (!(dev_id = pa_modargs_get_value(ma, "device_id", NULL))) {
diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
index e5cc4aea5..adb942b4a 100644
--- a/src/modules/alsa/module-alsa-card.c
+++ b/src/modules/alsa/module-alsa-card.c
@@ -715,6 +715,14 @@ int pa__init(pa_module *m) {
}
pa_modargs_get_value_boolean(u->modargs, "use_ucm", &u->use_ucm);
+
+ /* Force ALSA to reread its configuration. This matters if our device
+ * was hot-plugged after ALSA has already read its configuration - see
+ * https://bugs.freedesktop.org/show_bug.cgi?id=54029
+ */
+
+ snd_config_update_free_global();
+
if (u->use_ucm && !pa_alsa_ucm_query_profiles(&u->ucm, u->alsa_card_index)) {
pa_log_info("Found UCM profiles");