[pulseaudio-discuss] PulseAudio with Motif?
Lennart Poettering
lennart at poettering.net
Mon May 5 15:49:01 PDT 2008
On Mon, 14.04.08 14:17, Michel Bardiaux (mbardiaux at mediaxim.be) wrote:
> > See the point? There's no connection between Pulseaudio (specifically
> > its client library) and a given widget set.
>
> Actually, there is. I had done some amount of research, and had looked
> at the sample clients on pulseaudio.org, and it was clear (eg from
> paplay.c) that for pulseaudio one has pa_mainloop_run exactly where an
> Xt application has XtAppMainLoop. In single-thread I can't run both at
> the same time, which means I have to merge the 2 loops somehow. Your
> mention of "input loop of my widget" below makes me believe you mean
> exactly that.
PA provides an abstraction system for event loops. It comes with one
simple implementation (the pa_mainloop) and one that works on top of
GLib. Just implement the structure you find in mainloop-api.h on top of
your specific event loop and you should be fine.
But please remember: driving audio streams from the same thread as the
UI is usually a bad idea. It's Ok to use it for writing control apps
like pavucontrol or suchlike since latency doesn't matter for
them. But for streaming audio, doing the event loop for PA in a thread
that is seperate from the UI event loop is a good idea. (But it all
depends, if you don't care for audio latency at all it could be fine
to drive an audio stream from the UI stream.)
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net ICQ# 11060553
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
More information about the pulseaudio-discuss
mailing list