[pulseaudio-discuss] [PATCH] alsa-ucm: Drop support for PlaybackPCM on devices

arun at accosted.net arun at accosted.net
Tue May 3 12:57:10 UTC 2016


From: Arun Raghavan <git at arunraghavan.net>

Thie code was incorrect as it stood, but more importantly, we don't
support a separate PCM for devices conceptually (since devices are
mapped to ports).
---
 src/modules/alsa/alsa-ucm.c | 30 ++++++++++++------------------
 src/modules/alsa/alsa-ucm.h |  4 ++--
 2 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
index 458fe36..538a1ab 100644
--- a/src/modules/alsa/alsa-ucm.c
+++ b/src/modules/alsa/alsa-ucm.c
@@ -233,15 +233,12 @@ static int ucm_get_device_property(
             pa_log("UCM playback channels %s for device %s out of range", value, device_name);
 
         /* get pcm */
-        value = pa_proplist_gets(device->proplist, PA_ALSA_PROP_UCM_SINK);
-        if (!value) { /* take pcm from verb playback default */
-            value = pa_proplist_gets(verb->proplist, PA_ALSA_PROP_UCM_SINK);
-            if (value) {
-                pa_log_debug("UCM playback device %s fetch pcm from verb default %s", device_name, value);
-                pa_proplist_sets(device->proplist, PA_ALSA_PROP_UCM_SINK, value);
-            } else
-                pa_log("UCM playback device %s fetch pcm failed", device_name);
-        }
+        value = pa_proplist_gets(verb->proplist, PA_ALSA_PROP_UCM_SINK);
+        if (value) {
+            pa_log_debug("UCM playback device %s fetch pcm from verb default %s", device_name, value);
+            pa_proplist_sets(device->proplist, PA_ALSA_PROP_UCM_SINK, value);
+        } else
+            pa_log("UCM playback device %s fetch pcm failed", device_name);
     }
 
     value = pa_proplist_gets(device->proplist, PA_ALSA_PROP_UCM_CAPTURE_CHANNELS);
@@ -253,15 +250,12 @@ static int ucm_get_device_property(
             pa_log("UCM capture channels %s for device %s out of range", value, device_name);
 
         /* get pcm */
-        value = pa_proplist_gets(device->proplist, PA_ALSA_PROP_UCM_SOURCE);
-        if (!value) { /* take pcm from verb capture default */
-            value = pa_proplist_gets(verb->proplist, PA_ALSA_PROP_UCM_SOURCE);
-            if (value) {
-                pa_log_debug("UCM capture device %s fetch pcm from verb default %s", device_name, value);
-                pa_proplist_sets(device->proplist, PA_ALSA_PROP_UCM_SOURCE, value);
-            } else
-                pa_log("UCM capture device %s fetch pcm failed", device_name);
-        }
+        value = pa_proplist_gets(verb->proplist, PA_ALSA_PROP_UCM_SOURCE);
+        if (value) {
+            pa_log_debug("UCM capture device %s fetch pcm from verb default %s", device_name, value);
+            pa_proplist_sets(device->proplist, PA_ALSA_PROP_UCM_SOURCE, value);
+        } else
+            pa_log("UCM capture device %s fetch pcm failed", device_name);
     }
 
     if (device->playback_channels == 0 && device->capture_channels == 0) {
diff --git a/src/modules/alsa/alsa-ucm.h b/src/modules/alsa/alsa-ucm.h
index 165c68f..0c82ad4 100644
--- a/src/modules/alsa/alsa-ucm.h
+++ b/src/modules/alsa/alsa-ucm.h
@@ -36,10 +36,10 @@ typedef void snd_use_case_mgr_t;
 /** For devices: List of supported devices per verb*/
 #define PA_ALSA_PROP_UCM_DESCRIPTION                "alsa.ucm.description"
 
-/** For devices: Playback device name e.g PlaybackPCM */
+/** For verbs/modifiers: Playback device name e.g PlaybackPCM */
 #define PA_ALSA_PROP_UCM_SINK                       "alsa.ucm.sink"
 
-/** For devices: Capture device name e.g CapturePCM*/
+/** For verbs/modifiers: Capture device name e.g CapturePCM */
 #define PA_ALSA_PROP_UCM_SOURCE                     "alsa.ucm.source"
 
 /** For devices: Playback roles */
-- 
2.5.5



More information about the pulseaudio-discuss mailing list