[pulseaudio-discuss] [PATCH 3/3] alsa-ucm: Support Playback/CaptureVolume

Arun Raghavan arun.raghavan at collabora.co.uk
Fri Oct 4 19:14:40 CEST 2013


On Mon, 2013-09-30 at 14:06 +0200, David Henningsson wrote:
[...]
> > +static void ucm_port_data_free(pa_device_port *port) {
> > +    pa_alsa_ucm_port_data *data = PA_DEVICE_PORT_DATA(port);
> > +
> > +    if (data->paths) {
> > +        pa_hashmap_free(data->paths);
> > +    }
> > +
> > +    data->path = NULL;
> 
> Any reason why you set data->path to null but not data->paths?

I think that was to make sure there wasn't a stray reference to a path
that was freed.

> > +}
> > +
> > +static void probe_volumes(pa_hashmap *hash, snd_pcm_t *pcm_handle, bool ignore_dB) {
> > +    pa_device_port *port;
> > +    pa_alsa_path *path;
> > +    pa_alsa_ucm_port_data *data;
> > +    snd_mixer_t *mixer_handle;
> > +    snd_hctl_t *hctl;
> > +    const char *profile;
> > +    void *state, *state2;
> > +
> > +    if (!(mixer_handle = pa_alsa_open_mixer_for_pcm(pcm_handle, NULL, &hctl))) {
> > +        pa_log_error("Failed to find a working mixer device.");
> > +        goto fail;
> > +    }
> 
> 
> You probably want to not do "pa_alsa_open_mixer_for_pcm" here, but
> instead try to use whatever the ucm file specifies in "cset" - in most
> cases there wouldn't be a difference, but who knows...
> 
> (This might also apply to more places)

We don't have access to what 'cset' specifies, actually. That part is
parsed by alsa-lib, not us. There /is/ a PlaybackCTL value defined in
use-case.h, but we could implement support for that separately and
fallback to what I have currently done. Makes sense?

-- Arun



More information about the pulseaudio-discuss mailing list