Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
bobcripps
Posts: 16
Registered: ‎12-14-2011
My Device: Simulator

PJSIP Build

I'm currently putting together a VoIP proof of concept and to that end I'll need a SIP stack. PJSIP together with its associated PJMEDIA, is the the most commonly used and adaptable implementation (iphone clients use it too). I posted a question on the PJSIP mailing list with as yet no response asking if anyone had attempted to build for the blackberry tablet. I'm not a toolchain expert so if someone could take a look at PJSIP to fathom out if it's doable that would be appreciated.

 

This is the link to my PJSIP posting

http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2012-January/013961.html

 

Since writing this I've looked at the IDE output and see that qcc is used as opposed to raw gcc.

All help greatly appreciated

Bob

 

Please use plain text.
Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.634 Dev OS, Z30 (STA100-5)-10.3.1.634 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: PJSIP Build

I have not done anything with PJSIP, but I took a quick look at some of the source code and what I can say is this:

  • You want to use the Unix version of the compile (as QNX is not linux, so all linux specific stuff won't work) as that "should" compile just fine (base don the files I looked at).
  • Be sure that PJLIB compiles first before you try anything else as PJSIP, the codecs, etc. all rely on PJLIB.
  • There already is a *.mk for ARM. BUT it seems to simply define a name for ARMv4. The PlayBook (and newer) run Cortex which is ARMv7. So you want to see where ARMv4 is used and see if there is anything (such as NEON [SIMD for ARMv7]) that can be used over ARMv4.

That's really all I have noticed, you would have to do a more in depth look at the source to see if there are any other components that you need to change.

 

Also note, I looked at the 1.x branch, not 2.x. So some things like the ARMv4 vs. ARMv7 might be fixed/changed in that one.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.
Contributor
bobcripps
Posts: 16
Registered: ‎12-14-2011
My Device: Simulator

Re: PJSIP Build

I eventually had to go to Linux to get a cross compile working and I've also used PSIP Beta 2.

"./configure --host=arm-elf-qnx --disable-sound" "make dep & make" has generated the PJSIP library's .a files

xxx-arm-elf-nto-qnx.a .

I've not tried any refined processor flags but it looks like I may be on the right track. I've not checked to see if we build .a files into the application. Will work more on this and keep you posted.

Golden rule with PJSIP - If you're cross compiling use Linux. I wasted loads of time trying to fathom out why MSYS mingw32 failed to cross compile. MAC, same story by the way.

I'll keep you posted

Bob

 

Please use plain text.
BlackBerry Development Advisor
anhu
Posts: 54
Registered: ‎10-26-2011
My Device: Playbook

Re: PJSIP Build

Hi, 

 

I thought it might be useful to mention that we cross-compile SDL using the configure and the autoconf tools. 

If you'd like to see what kind of configure flags and environment variables need to be defined, you can have a look at the source repo by searching for BlackBerry on Github.  

Also, you will eventually need to deploy your applications so there is also a script for deploying the SDL test apps onto a playbook.  

 

 

Please use plain text.
Contributor
bobcripps
Posts: 16
Registered: ‎12-14-2011
My Device: Simulator

Re: PJSIP Build

Anhu

I could do with some more detail if you can.

I've had a look at this link and I see you're ./configure is slightly different to mine

https://github.com/blackberry/SDL/blob/emulate/build_for_playbook.sh

 

Also, I notice you are using qcc so am I going to be able to build using just gcc? I can build the .a files ok so I was assuming I'd be able to somehow include the .a files in my IDE project and download as normal from my PC to my playbook. Can you point me at the download scripts you refer to please?

 

What I did was download the 2.x beta then based on the aforementioned .sh the last thing I tried was

 

./configure --build=i686-pc-linux --host=arm-unknown-nto-qnx6.5.0eabi --disable-audio

make dep

make

This generates the .a's so if you think that should do it then advice on how to deploy

 

Finally. If you can take a look at the PJSIP project and make some build recommendations that would be appreciated.

 

Cheers

Bob


Please use plain text.
BlackBerry Development Advisor
anhu
Posts: 54
Registered: ‎10-26-2011
My Device: Playbook

Re: PJSIP Build

Hi, 

 

Regarding your question about using gcc, I'm afraid I cannot say either way since I've never used gcc with the playbook.  We always use qcc.  I would suggest using qcc because that way you'll be less prone to run into strange situations that no one else has encountered.

 

You should be able to include the .a files in an IDE project without any problem.  If you are using a Makefile project, you need to manually edit the makefiles.  If you are using a managed build, you can right click your project, click Properties, expand C/C++ Build, click Settings, Click Libraries, look for Additional Object Files and add it there.  

 

You asked about deployment.  you can find my deployment shell script in the test directory of the SDL code repo.  Its called deploy_to_playbook.sh.  So it deploys the library as part of an application.  This might or might not be what you want to do.  If you are using .a files in an IDE-managed application, your libraries will be statically linked into your binary executable file.  That can be deployed using the ide without any need for scripts.   However, if you are building your final application without the ide, then the deploy_to_playbook.sh will be helpful. 

 

You asked me to have a look at your project, however in the posts above I cannot find a link to it.  Please forward a link to it and I will have a look . 

 

Hope this helped. 

 

Please use plain text.
Contributor
bobcripps
Posts: 16
Registered: ‎12-14-2011
My Device: Simulator

Re: PJSIP Build

Ok cheers

That being the case, providing I've correctly compiled PJSIP's .a files then I should be able to include them statically as you say.

PJSIP project is:

http://www.pjsip.org/release/2.0-beta/pjproject-2.0-beta.tar.bz2

I'll have to do some reading on qcc  and it's availability/integration into the PJSIP build

 

Please use plain text.
BlackBerry Development Advisor
anhu
Posts: 54
Registered: ‎10-26-2011
My Device: Playbook

Re: PJSIP Build

I've looked at the project and tried to build it. If you do choose to go with qcc, you'll have to take some care in defining the AR environment variable. I had problems in the "make dep" step, but that could be due to some quirks of my individual system.
Please use plain text.
Contributor
bobcripps
Posts: 16
Registered: ‎12-14-2011
My Device: Simulator

Re: PJSIP Build

Having looked in more detail I'd say it's going to be very difficult to build PJSIP using qcc. I'd say the quickest way to do this is to cross compile using PJSIP's autoconf and make sure the file .a format is compatible with QNX

From what I've read QNX uses ELF format so I'd expect to be on the right lines with:

./configure --build=i686-pc-linux --host=armv7-elf-nto-qnx6.5.0eabi --disable-audio

I'll try to install the .a's this produces via my test app on the target.

Any other notes/suggestions would be appreciated.

PJSIP will only cross compile on Linux is what we've found. If you think it would be possible to adapt qcc then I'll have a go

Cheers

Bob

 

Please use plain text.
Contributor
bobcripps
Posts: 16
Registered: ‎12-14-2011
My Device: Simulator

Re: PJSIP Build

[ Edited ]

Anhu

I've moved the problem along after revisiting it today.

If you run the shell script below in the pjproject-2xx top level folder then

>make dep

>make

 

The PJLIB portion of the library compiles but fails the link because it can't find the "crypto" library that PJLIB would find for a linux build. Are there QNX crypto libraries available that would satisfy the link?

It would take someone in the know 10 minutes to reproduce the error

All help greatly appreciated

Bob

 

 

{code}

RANLIB="${QNX_HOST}/usr/bin/ntoarmv7-ranlib " \
CPP="${QNX_HOST}/usr/bin/qcc -V4.4.2,gcc_ntoarmv7le_cpp -E "\
CC="${QNX_HOST}/usr/bin/qcc -V4.4.2,gcc_ntoarmv7le_cpp " \
LD="${QNX_HOST}/usr/bin/ntoarmv7-ld " \
LDFLAGS=" -L${QNX_TARGET}/armle-v7/lib " \
CFLAGS=" -g " \
./configure --build=i686-pc-linux \
--host=arm-unknown-nto-qnx6.5.0eabi \
--disable-audio \
--disable-oss \
--disable-speex-aec \
--disable-g711-codec \
--disable-l16-codec \
--disable-gsm-codec \
--disable-g722-codec \
--disable-g7221-codec \
--disable-speex-codec \
--disable-sdl \
--disable-ffmpeg \
--disable-v4l2 \
--disable-ilbc-codec \
--disable-oss \
--disable-speex-aec \
--disable-g711-codec \
--disable-l16-codec \
--disable-gsm-codec \
--disable-g722-codec \
--disable-g7221-codec \
--disable-speex-codec \
--disable-sdl \
--disable-ffmpeg \
--disable-v4l2 \
--disable-ilbc-codec

 {code}

 

Please use plain text.