[pulseaudio-discuss] Example using async API
lennart at poettering.net
Tue Sep 29 14:59:28 PDT 2009
On Tue, 29.09.09 22:08, Peter Onion (Peter.Onion at btinternet.com) wrote:
> On Tue, 2009-09-29 at 22:44 +0200, Lennart Poettering wrote:
> > If you write output applications it is not recommended to use the glib
> > glue coe because you don't want to run the audio IO stuff in the same
> > event loop as the slow X stuff. The glib glue code is only useful for
> > control applications and for applications where dropouts don't matter
> > (such as pavumeter).
> > If you want to use the PA for audio IO in a gtk app it is recommended
> > to use the trheaded mainloop api to spawn a seperate event loop thread.
> Oh ! :-( I think that's going to mean a major rewrite of my code
> because it is currently uses the glib event loop and adds an event
> source that checks the alsa device and then creates the required number
> of samples.
> I've not written any threaded code before so that's another learning
> curve !
> So my next question is .... Can you point me to a gtk app example
> (preferably in C rather than C++) that woks in this threaded way ?
Only indirectly. Gst uses the trheaded loop. not sure of a gtk app
that doesn't use gst. In most cases using gst is probably a good idea anyway.
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
More information about the pulseaudio-discuss