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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

----- Original Message -----
> 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.

I just did some test with pulseaudio 5.0, and it seems to apply some flat-volume logic on source stream nowadays. So ACK!

>  
> > ---
> >  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@xxxxxxxxxxxxxxxxxxxxx
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel
> > 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]