[Spice-devel] [spice-gtk PATCH 2/5] audio: use stream functions for pulse source

Marc-André Lureau mlureau at redhat.com
Wed Mar 18 10:50:08 PDT 2015


Hi,

----- Original Message -----
> The functions pa_context_set_source_output_mute/volume are specifically
> to change source stream volume/mute.
> I changed the warnings to be compatible to sink_input ones;

Iirc, the problem is that source_output used to not implement flat volume logic. Maybe they do nowadays?

So if they still don't, the guest won't have full volume range. We should rather keep the current code in this case, because the main reason why we added volume control in the first place is to have full hw volume control from the guest.

> ---
>  gtk/spice-pulse.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/gtk/spice-pulse.c b/gtk/spice-pulse.c
> index fc1662e..dd7f309 100644
> --- a/gtk/spice-pulse.c
> +++ b/gtk/spice-pulse.c
> @@ -672,11 +672,11 @@ static void record_mute_changed(GObject *object,
> GParamSpec *pspec, gpointer dat
>          pa_stream_get_device_index(p->record.stream) == PA_INVALID_INDEX)
>          return;
>  
> -    op = pa_context_set_source_mute_by_index(p->context,
> -        pa_stream_get_device_index(p->record.stream),
> +    op = pa_context_set_source_output_mute(p->context,
> +        pa_stream_get_index(p->record.stream),
>          mute, NULL, NULL);
>      if (!op)
> -        g_warning("set_source_mute() failed: %s",
> +        g_warning("set_source_output_mute() failed: %s",
>                    pa_strerror(pa_context_errno(p->context)));
>      else
>          pa_operation_unref(op);
> @@ -708,12 +708,11 @@ static void record_volume_changed(GObject *object,
> GParamSpec *pspec, gpointer d
>          pa_stream_get_device_index(p->record.stream) == PA_INVALID_INDEX)
>          return;
>  
> -    /* FIXME: use the upcoming "set_source_output_volume" */
> -    op = pa_context_set_source_volume_by_index(p->context,
> -        pa_stream_get_device_index(p->record.stream),
> +    op = pa_context_set_source_output_volume(p->context,
> +        pa_stream_get_index(p->record.stream),
>          &v, NULL, NULL);
>      if (!op)
> -        g_warning("set_source_volume() failed: %s",
> +        g_warning("set_source_output_volume() failed: %s",
>                    pa_strerror(pa_context_errno(p->context)));
>      else
>          pa_operation_unref(op);
> --
> 2.1.0
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 


More information about the Spice-devel mailing list