[jitsi-dev] Help needed for compiling the native libraries (linux, portaudio)


#1

Hi,

so I'm trying to setup a build environment for jitsy including the native parts (portaudio) because I want to try fix some problems I have in conjunction with pulseadio.

First I did a clean checkout

> svn co https://svn.java.net/svn/jitsi~svn/trunk jitsi-trunk
> cd jitsi-trunk
jitsi-trunk> ant clean rebuild deploy-os-specific-bundles

Build is successfull and I can run the latest build with

jitsi-trunk> ant run

So far so good :slight_smile: Next was trying to recompile the portaudio stuff and that is where I ran into problems:

1. the README in src/native/portaudio seems to be out of date, for example the URL to the hotplug branch (https://www.portaudio.com/repos/portaudio/branches/hotplug) is not up to date. But I found the correct location on the DEV list. So let's try:

I can't do a checkout into the current folder because it already belongs to the jitsi-repository:

jitsi-trunk/src/native/portaudio>svn co https://subversion.assembla.com/svn/portaudio/portaudio/branches/hotplug .

=> svn: '.' is already a working copy for a different URL

If I checkout into a subfolder instead I can't apply the patch portaudio-hotplug-os.patch since it expects the portaudio files in the current folder.

jitsi-trunk/src/native/portaudio>svn co https://subversion.assembla.com/svn/portaudio/portaudio/branches/hotplug hotplug-upstream

jitsi-trunk/src/native/portaudio>patch -p0 < portaudio-hotplug-os.patch
=> can't find file to patch at input line 5

So let's copy manually:

jitsi-trunk/src/native/portaudio>cp -r hotplug-upstream/* .
jitsi-trunk/src/native/portaudio>patch -p0 < portaudio-hotplug-os.patch

Patch has been successfully applied, so compile now:

jitsi-trunk/src/native/portaudio>autoreconf -i
jitsi-trunk/src/native/portaudio>./configure --disable-shared --enable-static --with-pic --with-jack=no && make

looks good, so build the whole native stuff:

jitsi-trunk/src/native>ant portaudio -Dportaudio=portaudio -Dspeex=speex

This fails because of missing speex header.

[cc] In file included from jitsi-trunk/src/native/portaudio/AudioQualityImprovement.c:9:0:
[cc] jitsi-trunk/src/native/portaudio/AudioQualityImprovement.h:24:30: fatal error: speex/speex_echo.h: No such file or directory
[cc] compilation terminated.

Unfortunately there are no docs related to this. I cloned the current version from http://git.xiph.org/speex.git but I couldn't figure out where I should put the folder.

Could some of you please provide some insight how to compile the native portaudio stuff? Am I on the right path or do I miss something? I also wonder why you don't use SVN:external for the hotplug upstream repository to keep it up to date? That would avoid the manual copy and makes the whole process easier.
Maybe a similar functionality is also available to automatically link to the git repository for the speex stuff?

Any help is more then welcome! I'm more then willing to provide some more complete build instructions once I have it running :slight_smile:

My machine details:
3.0.0-17-generic #30-Ubuntu SMP Thu Mar 8 20:45:39 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
pulseaudio 1.0
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)

Thanks,
Raphael


#2

Hi,

Hi,

so I'm trying to setup a build environment for jitsy including the native
parts (portaudio) because I want to try fix some problems I have in
conjunction with pulseadio.

First I did a clean checkout

svn co https://svn.java.net/svn/jitsi~svn/trunk jitsi-trunk
cd jitsi-trunk

jitsi-trunk> ant clean rebuild deploy-os-specific-bundles

Build is successfull and I can run the latest build with

jitsi-trunk> ant run

So far so good :slight_smile: Next was trying to recompile the portaudio stuff and that
is where I ran into problems:

1. the README in src/native/portaudio seems to be out of date, for example
the URL to the hotplug branch
(https://www.portaudio.com/repos/portaudio/branches/hotplug) is not up to
date. But I found the correct location on the DEV list. So let's try:

I can't do a checkout into the current folder because it already belongs to
the jitsi-repository:

jitsi-trunk/src/native/portaudio>svn co
https://subversion.assembla.com/svn/portaudio/portaudio/branches/hotplug .

=> svn: '.' is already a working copy for a different URL

If I checkout into a subfolder instead I can't apply the patch
portaudio-hotplug-os.patch since it expects the portaudio files in the
current folder.

There is no need to checkout portuaudio in jitsi tree, do it in other
folder, later you will have to specify that folder.

jitsi-trunk/src/native/portaudio>svn co
https://subversion.assembla.com/svn/portaudio/portaudio/branches/hotplug
hotplug-upstream

jitsi-trunk/src/native/portaudio>patch -p0 < portaudio-hotplug-os.patch
=> can't find file to patch at input line 5

The patch must be applied to the portaudio folder not to jitsi
portaudio native sources.

So let's copy manually:

jitsi-trunk/src/native/portaudio>cp -r hotplug-upstream/* .
jitsi-trunk/src/native/portaudio>patch -p0 < portaudio-hotplug-os.patch

Patch has been successfully applied, so compile now:

jitsi-trunk/src/native/portaudio>autoreconf -i
jitsi-trunk/src/native/portaudio>./configure --disable-shared
--enable-static --with-pic --with-jack=no && make

looks good, so build the whole native stuff:

jitsi-trunk/src/native>ant portaudio -Dportaudio=portaudio -Dspeex=speex

This fails because of missing speex header.

[cc] In file included from
jitsi-trunk/src/native/portaudio/AudioQualityImprovement.c:9:0:
[cc] jitsi-trunk/src/native/portaudio/AudioQualityImprovement.h:24:30: fatal
error: speex/speex_echo.h: No such file or directory
[cc] compilation terminated.

Unfortunately there are no docs related to this. I cloned the current
version from http://git.xiph.org/speex.git but I couldn't figure out where I
should put the folder.

You should use the distribution packages for easy compiling (use speex
1.2rc1 source distribution).
Again speex can be compiled on any folder you like.

Could some of you please provide some insight how to compile the native
portaudio stuff? Am I on the right path or do I miss something? I also
wonder why you don't use SVN:external for the hotplug upstream repository to
keep it up to date? That would avoid the manual copy and makes the whole
process easier.
Maybe a similar functionality is also available to automatically link to the
git repository for the speex stuff?

Any help is more then welcome! I'm more then willing to provide some more
complete build instructions once I have it running :slight_smile:

Now after you have compiled speex and portaudio when calling ant you
specify the folders for example:
ant portaudio -Dportaudio=/home/damencho/projects/portaudio
-Dspeex=/home/damencho/projects/speex

Hope this will clear things.
Regards
damencho

P.S. you can get portaudio patched from
https://svn.java.net/svn/jitsi~svn/libsrc/, I will add and speex there
shortly.

路路路

On Wed, Apr 11, 2012 at 12:19 PM, Raphael Vullriede <lists.raphael@vullriede.de> wrote:

My machine details:
3.0.0-17-generic #30-Ubuntu SMP Thu Mar 8 20:45:39 UTC 2012 x86_64 x86_64
x86_64 GNU/Linux
pulseaudio 1.0
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)

Thanks,
Raphael


#3

Hi,

thanks for the quick answer!

<snip />

Now after you have compiled speex and portaudio when calling ant you
specify the folders for example:
ant portaudio -Dportaudio=/home/damencho/projects/portaudio
-Dspeex=/home/damencho/projects/speex

Both portaudio (branch hotplug patched with portaudio-hotplug-os.patch from jitsi-trunk and compiled with autoreconf -i, ./configure --disable-shared --enable-static --with-pic --with-jack=no && make) and speex (master, compiled with autogen.sh, configure && make) have been compiled successfully.

Now when I call ant portaudio -Dportaudio=/home/rv/repositories/portaudio-hotplug-upstrean -Dspeex=/home/rv/repositories/speex-upstream

I get the following error:

portaudio:
聽聽聽聽聽聽聽聽[cc] Starting dependency analysis for 2 files.
聽聽聽聽聽聽聽聽[cc] 2 files are up to date.
聽聽聽聽聽聽聽聽[cc] 0 files to be recompiled from dependency analysis.
聽聽聽聽聽聽聽聽[cc] 0 total files to be compiled.
聽聽聽聽聽聽聽聽[cc] Starting link
聽聽聽聽聽聽聽聽[cc] /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libportaudio.a(pa_front.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
聽聽聽聽聽聽聽聽[cc] /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libportaudio.a: could not read symbols: Bad value
聽聽聽聽聽聽聽聽[cc] collect2: ld returned 1 exit status

Any ideas? gcc is version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3).

P.S. you can get portaudio patched from
https://svn.java.net/svn/jitsi~svn/libsrc/, I will add and speex there
shortly.

I have currently troubles accessing this repository. I'll try when it is available again.

Thanks,
Raphael

路路路

On 04/11/2012 05:22 PM, Damian Minkov wrote:


#4

I used the following configure parameters:

./configure --disable-shared --with-pic --without-jack --without-oss

for portaudio. Maybe --enable-static invalidates the --with-pic ?

Just check the output of make (libtool: compile: gcc -c ... output)
to check if -fPIC is set.

Regards,
Werner

路路路

Am 11.04.2012 17:18, schrieb Raphael Vullriede:

Hi,

thanks for the quick answer!

On 04/11/2012 05:22 PM, Damian Minkov wrote:

<snip />

Now after you have compiled speex and portaudio when calling ant you
specify the folders for example:
ant portaudio -Dportaudio=/home/damencho/projects/portaudio
-Dspeex=/home/damencho/projects/speex

Both portaudio (branch hotplug patched with portaudio-hotplug-os.patch from jitsi-trunk and compiled with autoreconf -i, ./configure --disable-shared
--enable-static --with-pic --with-jack=no && make) and speex (master, compiled with autogen.sh, configure && make) have been compiled successfully.

Now when I call ant portaudio -Dportaudio=/home/rv/repositories/portaudio-hotplug-upstrean -Dspeex=/home/rv/repositories/speex-upstream

I get the following error:

portaudio:
聽聽聽聽聽聽聽[cc] Starting dependency analysis for 2 files.
聽聽聽聽聽聽聽[cc] 2 files are up to date.
聽聽聽聽聽聽聽[cc] 0 files to be recompiled from dependency analysis.
聽聽聽聽聽聽聽[cc] 0 total files to be compiled.
聽聽聽聽聽聽聽[cc] Starting link
聽聽聽聽聽聽聽[cc] /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libportaudio.a(pa_front.o): relocation R_X86_64_32 against `.rodata.str1.8' can not
be used when making a shared object; recompile with -fPIC
聽聽聽聽聽聽聽[cc] /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libportaudio.a: could not read symbols: Bad value
聽聽聽聽聽聽聽[cc] collect2: ld returned 1 exit status

Any ideas? gcc is version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3).

P.S. you can get portaudio patched from
https://svn.java.net/svn/jitsi~svn/libsrc/, I will add and speex there
shortly.

I have currently troubles accessing this repository. I'll try when it is available again.

Thanks,
Raphael


#5

Hi,

I used the following configure parameters:

./configure --disable-shared --with-pic --without-jack --without-oss

for portaudio. Maybe --enable-static invalidates the --with-pic ?

almost :slight_smile: It was just a typo in the -Dportaudio parameter and therefore the system libraries got picked up. My mistake.

After that I got the same problems with speex which I solved with CFLAGS="-fPIC" ./configure since I dind't find a corresponding option for the autogen script.

Now it works and I can finally get to work :slight_smile:

Thanks again,
Raphael

路路路

On 04/12/2012 02:55 AM, Werner Dittmann wrote:

Just check the output of make (libtool: compile: gcc -c ... output)
to check if -fPIC is set.

Regards,
Werner

Am 11.04.2012 17:18, schrieb Raphael Vullriede:

Hi,

thanks for the quick answer!

On 04/11/2012 05:22 PM, Damian Minkov wrote:

<snip />

Now after you have compiled speex and portaudio when calling ant you
specify the folders for example:
ant portaudio -Dportaudio=/home/damencho/projects/portaudio
-Dspeex=/home/damencho/projects/speex

Both portaudio (branch hotplug patched with portaudio-hotplug-os.patch from jitsi-trunk and compiled with autoreconf -i, ./configure --disable-shared
--enable-static --with-pic --with-jack=no&& make) and speex (master, compiled with autogen.sh, configure&& make) have been compiled successfully.

Now when I call ant portaudio -Dportaudio=/home/rv/repositories/portaudio-hotplug-upstrean -Dspeex=/home/rv/repositories/speex-upstream

I get the following error:

portaudio:
聽聽聽聽聽聽聽聽[cc] Starting dependency analysis for 2 files.
聽聽聽聽聽聽聽聽[cc] 2 files are up to date.
聽聽聽聽聽聽聽聽[cc] 0 files to be recompiled from dependency analysis.
聽聽聽聽聽聽聽聽[cc] 0 total files to be compiled.
聽聽聽聽聽聽聽聽[cc] Starting link
聽聽聽聽聽聽聽聽[cc] /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libportaudio.a(pa_front.o): relocation R_X86_64_32 against `.rodata.str1.8' can not
be used when making a shared object; recompile with -fPIC
聽聽聽聽聽聽聽聽[cc] /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libportaudio.a: could not read symbols: Bad value
聽聽聽聽聽聽聽聽[cc] collect2: ld returned 1 exit status

Any ideas? gcc is version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3).

P.S. you can get portaudio patched from
https://svn.java.net/svn/jitsi~svn/libsrc/, I will add and speex there
shortly.

I have currently troubles accessing this repository. I'll try when it is available again.

Thanks,
Raphael