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

David Henningsson david.henningsson at canonical.com
Tue Nov 12 06:28:46 PST 2013


On 10/07/2013 05:39 PM, Arun Raghavan wrote:
> 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).

Well, one could imagine that changing port/device would require all PCMs
to be closed, at least in an ASoC world. As such, switching ports could
very well affect PCMs too, I suspect.

And, you still insert the sink into the device's proplist, which is
inconsistent with your reasoning that devices map to ports/mixer
settings, rather than PCMs?

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



-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic


More information about the pulseaudio-discuss mailing list