PJSIP with JACK Audio Connection Kit?

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

 



Hello Benny!

Thank you very much for your quick response.

Apparently noone on this list uses JACK, right?
So I'm kind of on my own ...

I tried your suggestions - sadly without much luck. See below.

On Tue, Feb 26, 2008 at 12:01 PM, Benny Prijono <bennylp at pjsip.org> wrote:
> On 2/25/08, Matthias Geier <matthias.geier at gmail.com> wrote:

>  [snip]

> >  The thing is: Portaudio originally supports JACK which can be activated with
>  >  ./configure --with-jack
>  >  It is even switched on by default (I think).
>  >
>  >  Sadly, PJSIP uses its own build-process and this feature was somehow lost.
>
>  Yeah sorry about that, but there are some benefits of having our own
>  build system (such as having consistent setting).

I'm sure there are good reasons for that.
I didn't want to criticize that.

>  >  I tried to re-activate it with the following changes:
>  >
>  >  1) I created a user.mak with following contents:
>  >  export AC_PA_USE_ALSA = 0
>  >  export AC_PA_USE_OSS = 0
>  >  export CFLAGS += -DPA_USE_JACK=1
>  >  export APP_LDLIBS += -ljack
>  >  export LDFLAGS += -ljack
>  >  export PORTAUDIO_OBJS += pa_jack.o pa_ringbuffer.o
>  >
>  >  2) I created a third_party/build/portaudio/src/pa_jack.c with
>  >  following contents:
>  >  #include "../../../portaudio/src/hostapi/jack/pa_jack.c"
>  >
>  >  3) I temporarily disabled the file /usr/include/alsa/version.h by
>  >  renaming it. Without that, the configure script tries to build the
>  >  ALSA driver and the JACK driver doesn't work
>  >
>  >  After these 3 steps it worked.
>
>  Okay.
>
>  >  Then, when I tried it again several days (maybe some weeks?) later, I
>  >  got the following error from the linker:
>  >
>  >  [...]/pjproject-0.8.0/third_party/lib/libportaudio-i686-pc-linux-gnu.a(pa_jack.o):
>  >  In function `RealStop':
>  >  pa_jack.c:(.text+0x1b7f): undefined reference to `jack_port_unlock'
>  >  pa_jack.c:(.text+0x1bb4): undefined reference to `jack_port_lock'
>  >  pa_jack.c:(.text+0x1c4f): undefined reference to `jack_port_unlock'
>  >  pa_jack.c:(.text+0x1c88): undefined reference to `jack_port_lock'
>  >  collect2: ld returned 1 exit status
>  >  make[2]: *** [../bin/pjsua-i686-pc-linux-gnu] Error 1
>  >  make[2]: Leaving directory `[...]/pjproject-0.8.0/pjsip-apps/build'
>  >
>  >  I did a web-search and found the explanation that those two functions
>  >  jack_port_lock and jack_port_unlock are deprecated and were removed
>  >  from JACK.
>  >  So I guess in a recent system update (btw: I'm using Debian) JACK was
>  >  updated and these functions got deactivated.
>  >  I don't know if that's true, but at least it's an explanation ;-)
>
>  That is quite strange, since we have our own copy of PortAudio in our
>  SVN (pulled directly from PA SVN), and this copy is locked to a
>  specific revision (do "svn pget svn:externals" in third_party
>  directory). So unless you removed this specific revision number in
>  your SVN flag, system update should not affect the build.

The update didn't affect PortAudio itself but the JACK libraries which
are used by PortAudio.
And those sources are not in the source tree!

>  >  So now I'm kind of stuck.
>  >  It would be great if someone could help me out.
>  >
>  >  Is there another (better) way to activate JACK?
>  >
>  >  Would it work if libportaudio were linked dynamically? There is a
>  >  Debian packet "libportaudio19-dev" which I could probably use.
>
>  You can probably do that, by:
>   1) copying libportaudio.a from your /usr/lib to third_party/lib, and
>  renaming the filename to libportaudio-${TARGET}.a
>   2) modify third_party/build/portaudio to do nothing
>   3) Add "CFLAGS += -I/portaudio/inc/dir" in user.mak to let pasound.c
>  find the new PortAudio

I did that.
I had also to add -lasound and -ljack and then it compiled without errors.

However, pjsua doesn't work!

When I start it, I get following error:

>>> pjsua-i686-pc-linux-gnu: ../src/pjmedia/conference.c:1925:
put_frame: Assertion `frame->size == conf->samples_per_frame *
conf->bits_per_sample / 8' failed.

I think the hostapi used by PortAudio is in this case ALSA.

On the other hand, when I start the JACK audio daemon and then start
pjsua, I get the following:

 17:50:41.607  pjsua_media.c pjsua_set_snd_dev(): attempting to open
devices @16000 Hz
 17:50:41.615  pjsua_media.c ..failed: Invalid sample rate

... and the same message with several sample rates including 44100, which I use.

... and then:

 17:50:41.759  pjsua_media.c Unable to open sound device: Invalid
sample rate [status=259003]
 17:50:41.759  pjsua_media.c Error opening sound device: Invalid
sample rate [status=259003]
 17:50:41.784   pjsua_core.c Shutting down...
 17:50:42.787  pjsua_media.c Closing (null) sound playback device and
(null) sound capture device
 17:50:43.115      pasound.c PortAudio sound library shutting down..

In this case, the hostapi should be JACK, I guess.

Do those error messages look familiar?

What else could I try?

Thanks again,
Matthias



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux