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

Arun Raghavan arun.raghavan at collabora.co.uk
Mon Oct 7 17:39:24 CEST 2013


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 822f760..a451c88 100644
--- a/src/modules/alsa/alsa-ucm.c
+++ b/src/modules/alsa/alsa-ucm.c
@@ -220,15 +220,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);
@@ -240,15 +237,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 36a491f..bae6b72 100644
--- a/src/modules/alsa/alsa-ucm.h
+++ b/src/modules/alsa/alsa-ucm.h
@@ -38,10 +38,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 */
-- 
1.8.3.1



More information about the pulseaudio-discuss mailing list