Re: [spice-gtk PATCH v2 7/7] channel: playback and record sync volume/mute

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

 



Hi,

On Mon, Mar 23, 2015 at 09:47:07AM -0400, Marc-André Lureau wrote:
> Hi
> 
> ----- Original Message -----
> > As soon as playback-start and record-start are handled, sync volume/mute
> > with guest.
> 
> It sounds like this may make a glitch whenever audio start (especially because the volume units are not specified and differ between client, guest and hw). Why not sync only when the agent is started?

The main problem for that is when the channel is not created yet which
will fail getting the volume/mute values.

> 
> > ---
> >  gtk/channel-playback.c | 4 ++++
> >  gtk/channel-record.c   | 4 ++++
> >  2 files changed, 8 insertions(+)
> > 
> > diff --git a/gtk/channel-playback.c b/gtk/channel-playback.c
> > index ae8a75d..550346e 100644
> > --- a/gtk/channel-playback.c
> > +++ b/gtk/channel-playback.c
> > @@ -21,6 +21,7 @@
> >  #include "spice-common.h"
> >  #include "spice-channel-priv.h"
> >  #include "spice-session-priv.h"
> > +#include "spice-audio-priv.h"
> >  
> >  #include "spice-marshal.h"
> >  
> > @@ -364,6 +365,8 @@ static void playback_handle_start(SpiceChannel *channel,
> > SpiceMsgIn *in)
> >  {
> >      SpicePlaybackChannelPrivate *c = SPICE_PLAYBACK_CHANNEL(channel)->priv;
> >      SpiceMsgPlaybackStart *start = spice_msg_in_parsed(in);
> > +    SpiceSession *session = spice_channel_get_session(channel);
> > +    SpiceChannel *main_channel = spice_session_get_main_channel(session);
> >  
> >      CHANNEL_DEBUG(channel, "%s: fmt %d channels %d freq %d time %d",
> >      __FUNCTION__,
> >                    start->format, start->channels, start->frequency,
> >                    start->time);
> > @@ -382,6 +385,7 @@ static void playback_handle_start(SpiceChannel *channel,
> > SpiceMsgIn *in)
> >      }
> >      g_coroutine_signal_emit(channel, signals[SPICE_PLAYBACK_START], 0,
> >                              start->format, start->channels,
> >                              start->frequency);
> > +    agent_sync_audio_playback(main_channel);
> >  }
> >  
> >  /* coroutine context */
> > diff --git a/gtk/channel-record.c b/gtk/channel-record.c
> > index ac71999..efd9526 100644
> > --- a/gtk/channel-record.c
> > +++ b/gtk/channel-record.c
> > @@ -23,6 +23,7 @@
> >  
> >  #include "spice-marshal.h"
> >  #include "spice-session-priv.h"
> > +#include "spice-audio-priv.h"
> >  
> >  #include "common/snd_codec.h"
> >  
> > @@ -397,6 +398,8 @@ static void record_handle_start(SpiceChannel *channel,
> > SpiceMsgIn *in)
> >  {
> >      SpiceRecordChannelPrivate *c = SPICE_RECORD_CHANNEL(channel)->priv;
> >      SpiceMsgRecordStart *start = spice_msg_in_parsed(in);
> > +    SpiceSession *session = spice_channel_get_session(channel);
> > +    SpiceChannel *main_channel = spice_session_get_main_channel(session);
> >      int frame_size = SND_CODEC_MAX_FRAME_SIZE;
> >  
> >      c->mode = spice_record_desired_mode(channel, start->frequency);
> > @@ -423,6 +426,7 @@ static void record_handle_start(SpiceChannel *channel,
> > SpiceMsgIn *in)
> >  
> >      g_coroutine_signal_emit(channel, signals[SPICE_RECORD_START], 0,
> >                              start->format, start->channels,
> >                              start->frequency);
> > +    agent_sync_audio_record(main_channel);
> >  }
> >  
> >  /* coroutine context */
> > --
> > 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





[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]