[Spice-devel] RFC - Make sound receiving and deconding independent from the gtk widget

Marc-André Lureau mlureau at redhat.com
Sun Jun 29 15:23:39 PDT 2014


Hi

----- Original Message -----
> Hi Marc-André,
> 
> thank you for your response. Please see my comments inline...
> 
> Am 2014-06-24 17:06, schrieb Marc-André Lureau:
> > ----- Original Message -----
> >> Hi,
> >> 
> >> I just trying to implement sound into my SDL client. This client uses
> >> the spice glib but it does not use the gtk library (as gtk is horrible
> >> slow on OSX).
> > 
> > Yeah, it would be nice if somebody could make the drawing updates
> > faster.
> I guess there is no other way than moving away from gtk :( My Profiling
> shows me up that the strange kind how gtk is implementet in OSX does not
> allow a faster drawing. That is the reason why I had to write my own SDL
> client. If this client is out of the PoC state I guess I will publish it
> in the App Store of Apple for OSX.

Afaik, it's not Gtk+ fault, but rather the cairo path, each update is
somehow uploaded as GL texture and needs conversion. There used to be
profiles posted on this ML. However, I have no experience with MacOS.

> > Because spice-glib is everything except gtk integration atm.
> That is exact the answer I´d expected. But the implementation of the
> sound decoding itself is not part of the glib (which makes sense to me)
> - only the "branded" object for sound deconding. It would be nice if the
> glib would work even if I do not want to use pulse/gstreamer.

I don't follow you. Spice audio channels (playback&record) are interfaces
to the Spice protocol, and provide enc/decoder. On top of those channels,
you can implement audio with different backends. To make it easier for most
users, the GStreamer and PulseAudio backend are _optionnaly_ compiled in and
provided with SpiceAudio "helper/manager". 

> > Well, SpiceAudio is just a helper, it connects the audio channels to
> > an audio backend. You can use the spice-glib API to implement the same
> > functions, it doesn't have to be implemented in spice-glib.
> > 
> Does this mean it is safe to call
> 
> - spice_g_signal_connect_object(session, "notify::enable-audio",
> G_CALLBACK(session_enable_audio), self, 0);
> - spice_g_signal_connect_object(session, "channel-new",
> G_CALLBACK(channel_new), self, 0);
> 
> Even without such an object? Before I created an emtpy fake-object I had
> no sound at all. After implementing that fake-object for sound it worked
> like a charm.

yes, you can pretty much copy-paste SpiceAudio in your application and
implement your own audio manager.

> session_enable_audio and channel_new are static, aren´t them? Do I have
> to implement those callbacks myself?

"enable-audio" is a simple property: it is used by the audio helper to follow
session settings, it's up to you if you want your backend to follow this 
property.


More information about the Spice-devel mailing list