[pulseaudio-discuss] PA and OS X

Lennart Poettering lennart at poettering.net
Wed Jul 22 11:16:14 PDT 2009


On Sat, 18.07.09 14:05, Daniel Mack (daniel at caiaq.de) wrote:

> 1. When PA is build using the instructions I posted, the executables are
> linked fine, but they won't run. The error I'm getting is
> 
> $ ./pulseaudio 
> dyld: Symbol not found: _g_get_application_name
>   Referenced from: /Users/daniel/src/pa/pulseaudio/src/.libs/libpulsecommon-0.9.16.dylib
>   Expected in: dynamic lookup

This looks as if weakref support in gcc or in pa is incompatible with
MacOSX. Here's what happens:

glib has a function g_get_application_name() that returns a human
readable application name of the application currently running. Since
PA is interested in automatically discovering as much meta information
about the client as possible we'd like to call that function. However,
we don't want to unconditionally link against libglib, we don't want
to be the one pulling in that library just for this little
function. So, what we do instead is using gcc's weakref feature which
allows us to check if a specific symbol is already defined in the
current process and only make use of it if it is. Which is really neat
since this allows the PA client libs to automatically discover the
Gtk application and icon name when used from Gtk application, but not
depend on Gtk/GLib itself. 

Weak refs are are relatively new feature in gcc, and they might be ELF
specific. 

A simple fix is probably to check for the definition __ELF__ in
src/pulse/gccmacro.h at the definition of PA_GCC_WEAKREF or so.

> 2. The CoreAudio backend needs a clock for the internal ring buffer
> motor. There are two different possible aproaches. Either the audio
> driver clocks itself using a timer and then is the clock master to the
> user space. Or the user space appliction obtains the clock from PA and
> clocks the kernel module. I'm sure there is a clearly preferred way to
> go for PA, but I'm uncertain which one that is. And how is that handled
> for both directions?

If you write a PA backend you are supposed to supply the clock.

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4



More information about the pulseaudio-discuss mailing list