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

Submitted by Arun Raghavan on May 3, 2016, 12:57 p.m.

Details

Message ID 1462280230-19899-1-git-send-email-arun@accosted.net
State New
Headers show
Series "alsa-ucm: Drop support for PlaybackPCM on devices" ( rev: 1 ) in PulseAudio

Not browsing as part of any series.

Commit Message

Arun Raghavan May 3, 2016, 12:57 p.m.
From: Arun Raghavan <git@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(-)

Patch hide | download patch | download mbox

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 */

Comments

On Tue, 2016-05-03 at 18:27 +0530, arun@accosted.net wrote:
> From: Arun Raghavan <git@arunraghavan.net>
> 
> Thie code was incorrect as it stood,

Incorrect in what way?

> but more importantly, we don't
> support a separate PCM for devices conceptually (since devices are
> mapped to ports).

Sure, they are mapped to ports, but the PCM device determines which
mapping the port is associated with. Your change means that there can
be only one mapping per verb per direction.

-- 
Tanu