iPhone build for WebRTC

13,647 views
Skip to first unread message

arik

unread,
Mar 19, 2012, 1:23:59 PM3/19/12
to discuss...@googlegroups.com
Hello,

Has anyone tried to build WebRTC for iPhone? I will be happy to share some thoughts about this.

Thanks,
Arik

Tony Weber

unread,
Mar 24, 2012, 2:35:07 AM3/24/12
to discuss-webrtc
Apparently Ericsson has done it.

https://labs.ericsson.com/developer-community/blog/experimenting-webrtc-ios

Do you have something working? Would you share?

Best regards,
Tony

J Alex Antony Vijay

unread,
Mar 24, 2012, 12:19:42 PM3/24/12
to discuss...@googlegroups.com
Hi Arik,

    I was trying to integrate WebRTC VoiceEngine in PJSIP (just to replace PJMEDIA). It is working fine.
If you have any doubts, let me know. If possible, i will share my knowledge.


--

Regards,
J Alex Antony Vijay.

arik

unread,
Apr 2, 2012, 9:36:24 AM4/2/12
to discuss...@googlegroups.com
Alex, Hello, 

I started building for MAC according to: http://www.webrtc.org/reference/getting-started

I am hoping to build for MAC first and then use the makefiles to convert the build to iPhone.

My problem is that running gclient runhooks --force does not create webrtc.xcodeproj

Any idea how I should proceed? Is this the correct path, or do you recommend a different approach?

Thanks,
Arik Halperin


On Saturday, March 24, 2012 12:19:42 PM UTC-4, Alex wrote:
Hi Arik,

    I was trying to integrate WebRTC VoiceEngine in PJSIP (just to replace PJMEDIA). It is working fine.
If you have any doubts, let me know. If possible, i will share my knowledge.


--

Regards,
J Alex Antony Vijay.


arik

unread,
Apr 2, 2012, 11:06:36 AM4/2/12
to discuss...@googlegroups.com
Ok, fixed it. Some issue with my configuration.

Now working on converting the xcode project to iPhone instead of MAC.

Arik

Nick Foster

unread,
Apr 2, 2012, 12:13:58 PM4/2/12
to discuss...@googlegroups.com
Good luck Arik,

I am interested in the work you do down this path. I do not know enough about the CoreAudio libraries on the iOS to know how to hook everything up. But excited for what you can get done.

- Nick

arik

unread,
Apr 5, 2012, 7:43:58 AM4/5/12
to discuss...@googlegroups.com
Nick, Hello,

I have up to now moved all the platform independent audio libraries to iPhone library projects. I'm starting to work on audio_device and system_wrappers.

This is the hard part I believe :( I will keep you updated on how I progress.

Arik


On Monday, April 2, 2012 12:13:58 PM UTC-4, Nick Foster wrote:
Good luck Arik,

I am interested in the work you do down this path. I do not know enough about the CoreAudio libraries on the iOS to know how to hook everything up. But excited for what you can get done.

- Nick

arik

unread,
Apr 5, 2012, 7:44:54 AM4/5/12
to discuss...@googlegroups.com
Alex, How did you port system wrappers to iPhone?

Arik


On Saturday, March 24, 2012 12:19:42 PM UTC-4, Alex wrote:

Zack Coder

unread,
Apr 5, 2012, 8:04:39 AM4/5/12
to discuss...@googlegroups.com
Hi Arik,

I came across this library and think it may be useful for some of the audio work.

Nick Foster

unread,
Apr 5, 2012, 11:45:40 AM4/5/12
to discuss...@googlegroups.com
Take a look at what Gustav has already posted to the webrtc group.


- Nick

arik

unread,
Apr 11, 2012, 11:12:47 AM4/11/12
to discuss...@googlegroups.com
Thanks a lot. It's a great help.

I'm currently porting all projects to work with XCODE. 

My last issue is how to solve the STL map references in the code.

Is there a way to link with STL support for iPhone native code?

Arik

TJ Grant

unread,
Apr 11, 2012, 5:44:48 PM4/11/12
to discuss...@googlegroups.com
Arik…

I've not had any issues with STL and iPhone dev…

What kind of errors are you getting?

Also curious, what revision # of WebRTC are you starting with… current?

Best,

arik

unread,
Apr 16, 2012, 8:34:10 AM4/16/12
to discuss...@googlegroups.com, tjg...@tatewake.com
Thanks for the response. I'm working with a version from a few weeks ago.

The STL issue was a compilation bug I had.

Currently I have WebRTC on iPhone working peer to peer and in loopback. The problem is that there is a lot of noise on the line and 
the delay is terrible.

I will be happy if someone can give me tips on how to debug these issues.

For a driver I'm using the one Nick Foster pointed to me, the one Gustav wrote.

Arik

Gustavo García

unread,
Apr 16, 2012, 8:43:28 AM4/16/12
to discuss...@googlegroups.com
Hi Arik,

Delay is pretty low for me and don't have any noise problem.

Perhaps the noise is because a mistmatch between sampling frequencies
in the "driver" and audio processing in mistmatch. What are the values
of N_REC_SAMPLES_PER_SEC and N_PLAY_SAMPLES_PERSEC macros in
audio_device_iphone.h?

Regards,

G.

arik

unread,
Apr 16, 2012, 8:55:47 AM4/16/12
to discuss...@googlegroups.com
It's 48000.

BTW, If I only enable receive it works perfect.
If only transmit then there is delay but no noise.
Receive+Transmit: Delay & Noise.

Arik


On Monday, April 16, 2012 8:43:28 AM UTC-4, Gustavo wrote:
Hi Arik,

Delay is pretty low for me and don't have any noise problem.

Perhaps the noise is because a mistmatch between sampling frequencies
in the "driver" and audio processing in mistmatch. What are the values
of N_REC_SAMPLES_PER_SEC and N_PLAY_SAMPLES_PERSEC macros in
audio_device_iphone.h?

Regards,

G.

arik

unread,
Apr 16, 2012, 9:03:04 AM4/16/12
to discuss...@googlegroups.com
Found the problem. The code was compiled for debug.

Recompiled with release and everything is working fine.

BTW - Do you have experience with Video & WebRTC on iPhone?

This is my next project...

Arik

Gustavo García

unread,
Apr 16, 2012, 9:12:01 AM4/16/12
to discuss...@googlegroups.com
Does it happen with simulator or only with the real devices? Have you
tried different codecs?

I remembered 2 additional tweaks I made to reduce the computational
complexity, but it shouldn't be needed if you are using the simulator
or using G.711.

In case you want to use iSAC you have to enable iSACfix.

engine_configuration.h
//#define WEBRTC_CODEC_ISAC // floating-point iSAC
implementation (default)
#define WEBRTC_CODEC_ISACFX // fix-point iSAC implementation

Probably not mandatory but I also changed the sampling rate from 48K
to 16K to remove the necessity of resampling:
voice_engine_defines.h
enum { kVoiceEngineAudioProcessingDeviceSampleRateHz = 16000 };
audio_device_iphone.h
const WebRtc_UWord32 N_REC_SAMPLES_PER_SEC = 16000;
const WebRtc_UWord32 N_PLAY_SAMPLES_PER_SEC = 16000;

Some day I will make a script to apply all these changes, I promise :-)

G.

arik

unread,
Apr 16, 2012, 9:51:07 AM4/16/12
to discuss...@googlegroups.com
Gustavo,

 Thanks a lot for all these tips. I will put them into the code. BTW, You did a really nice work on the audio driver and it saved me days of work.

My next task is to enable the video, which seems to be quite a challenge, I already have it working on Android
but there the code was already written and I only faced compile issues.

Did you try it already? 

Regards,
Arik

Zack Coder

unread,
Apr 16, 2012, 5:56:44 PM4/16/12
to discuss...@googlegroups.com
Were there any changes to Gustav's audio driver code required to get things running? I have everything building but when I go to instantiate the audio device I get:

AURemoteIO::Initialize failed: -308 (enable 3, outf< 1 ch,   1600 Hz, Int16> inf< 1 ch,   1600 Hz, Int16>)

Gustavo García

unread,
Apr 16, 2012, 7:08:43 PM4/16/12
to discuss...@googlegroups.com
Your log says 1600 Hz and should be 16000 Hz. That's probably your problem.

>>> >> On Mon, Apr 16, 2012 at 2:34 PM, mismatch <arik.h...@gmail.com>

Zack Coder

unread,
Apr 16, 2012, 8:14:59 PM4/16/12
to discuss...@googlegroups.com
Nice catch. I fixed that but am still getting an error on initialization; this time with code 66635

>>> >> On Mon, Apr 16, 2012 at 2:34 PM, mismatch <arik.halperin@gmail.com>

Zack Coder

unread,
Apr 16, 2012, 8:30:17 PM4/16/12
to discuss...@googlegroups.com
I'm rather new to working with iOS/Audio Units and my assumption right now is that my app is missing some necessary setup/teardown code which compliments this driver. Is this true? Could someone point me to a good reference if so?

arik

unread,
Apr 17, 2012, 3:16:42 AM4/17/12
to discuss...@googlegroups.com
Zack, 

The best reference is Apple. But I'm not sure you need it.

What I did was to look at the Audio sample used in Android and simply implemented the same steps in my IOS application.

I hope this helps.

Arik

Zack Coder

unread,
Apr 17, 2012, 10:05:13 AM4/17/12
to discuss...@googlegroups.com
I'll check it out, thanks Arik. FWIW I flipped the setup to using RemoteIO instead of VoiceProcessingIO and now it initializes successfully. I will certainly go back an analyze this, but for now it's enough to let me work on the rest of my stack for a bit. Thanks for all the pointers.

Zack Coder

unread,
Apr 18, 2012, 10:15:23 AM4/18/12
to discuss...@googlegroups.com
Has anyone had success using this over the 3G/4G connection (network interface pdp_ip0 on the iPhone)? It doesn't appear to receive my STUN binding requests when I send to this IP

loks

unread,
May 6, 2012, 10:03:11 AM5/6/12
to discuss-webrtc
Hi Arik,

I am interested in building a Iphone WebRTC client to perform voice/
video chat.
I am new to libjingle and webRTC, please let me know how i can go
about developing the client on Iphone.
I would really appreciate if you can help me out here.

Regards
Lokesh

arik

unread,
May 9, 2012, 4:37:49 AM5/9/12
to discuss...@googlegroups.com
For audio - it's easy, threre is an audio driver for iphone posted at one of the issues of WebRTC project.

Video is a different story, you need to provide two drivers:

1) Capture driver : To capture camera frames and transfer them as buffers to WebRTC send frame callback
2) Render driver: To do video rendering on iPhone

I'm currently working on the first...

Arik

jay-k

unread,
May 10, 2012, 4:15:34 PM5/10/12
to discuss...@googlegroups.com
Hello Arik, i have the same problem, gclient sync --force doesn't create webrtc.xcodeproj, how did you solve it?
Message has been deleted
Message has been deleted

arik

unread,
May 14, 2012, 9:35:22 AM5/14/12
to discuss...@googlegroups.com
I built it by hand for iPhone. Project by project.

As a reference I used the MAC xcode project which I got from gclient.

Arik

Shaun

unread,
May 18, 2012, 11:23:07 AM5/18/12
to discuss...@googlegroups.com
Are we to the point where the iLBC library can be used from webRTC on IOS? Any idea how to get this done? Thanks!

Punyabrata Ray

unread,
May 18, 2012, 5:51:57 PM5/18/12
to discuss...@googlegroups.com
Officially, WebRTC is not yet supported on iOS. 
-pr

Zack Coder

unread,
Jun 4, 2012, 8:14:22 PM6/4/12
to discuss...@googlegroups.com
Hello all,

I have had WebRTC running of iOS for some time now, but have been hitting an issue with voice quality for a majority of that period. I have been using iLBC and have found that there is a rather high degree of choppiness, both on Debug and Release builds. I have re-implemented iLBC to use Apple's built-in implementation of the codec, which did not mitigate the problem. Wireshark does not indicate that there is any packet loss, so I don't think that is causing the issue. 

Today, I ran a quick test against my server with PCMU (aka G711u) and discovered a similar choppiness. So, my gut instinct is that it is in the code itself. Has anyone on this thread experienced this/have you re-implemented any major or fundamental portions of the stack in an iOS-specific manner?

Thanks,
Zack

Emanuele Bizzarri

unread,
Jun 5, 2012, 8:42:29 AM6/5/12
to discuss...@googlegroups.com
Have you try to disable VAD?

Zack Coder

unread,
Jun 5, 2012, 3:56:36 PM6/5/12
to discuss...@googlegroups.com
Thanks a lot, good idea. Just tried, didn't make a whole lot of difference unfortunately though.

Gustavo García

unread,
Jun 5, 2012, 7:04:49 PM6/5/12
to discuss...@googlegroups.com
What audio device implementation are you using? Your own
implementation or the one I published in google code some months ago?

We are not having that choppiness and we tested it with most of the
codecs available in webrtc.

G.

Zack Coder

unread,
Jun 5, 2012, 7:26:44 PM6/5/12
to discuss...@googlegroups.com
Hi Gustavo,

I am using the one you provided a few months ago, with my own implementation of iLBC to use the Apple-provided version. However, I have seen the choppiness using the built-in version as well. When I play a WAV file into the connection @ a constant frequency, I hear a very regular clicking sound. It is present regardless of codec.

Have you made any updates to it? Also, are you using libjingle for the comms stack or just WebRTC and your own implementation? Perhaps my problem is there.

Thanks,
Zack

Gustavo García

unread,
Jun 6, 2012, 4:09:46 AM6/6/12
to discuss...@googlegroups.com
I have just uploaded the exact version that we have today, perhaps
there is some change from the version I published on february:
http://code.google.com/p/webrtc/issues/detail?id=284

I would stay with PCMU until you solve the problem to discard any
issue related to the codec or CPU load.

G.

Zack Coder

unread,
Jun 6, 2012, 8:26:06 AM6/6/12
to discuss...@googlegroups.com
Hi Gustavo,

I have successfully removed the clicking by increasing the render buffer's size. Hoping to figure out more on this today.

Richard

kadam

unread,
Jun 21, 2012, 7:35:51 PM6/21/12
to discuss...@googlegroups.com
The warning disappeared after AudioSessionInitialize().

==Adam

On Tuesday, June 19, 2012 5:17:35 PM UTC-4, kadam wrote:
Hi,

I've applied Gustavo's tweaks, but I get a lot of warnings during calls like:

Warning(webrtcvoiceengine.cc:890): WebRtc:too long delay (play:4294966 rec:4294967)

It doesn't seem to cause any problems as the call quality is excellent running on an iPhone (WiFi or 3G), just curious. The code spits out this warning if the sum of play and rec delays is greater than 300. This hints me that the two delays I get: 4294966 + 4294967 = 8589933 are way too big.

==Adam

Harold

unread,
Jul 9, 2012, 3:01:09 AM7/9/12
to discuss...@googlegroups.com
Hi,

I managed to get the WebRTC voice-engine building+running on iOS based on the patch from here - https://webrtc-codereview.appspot.com/479004/ . It took some work, as regardless of what webrtc revision I started with (latest trunk/last-known-good-revision/stable, latest trunk/last-known-good-revision/stable at around the time the patch was released), there were various issues in applying the patch and then compiling with the patch's makefile setup. I also did some work to adjust the makefile setup it comes with to build fat binaries . However, having got it building+running, running it in loopback in the simulator+iphone it sounds fine so far.

I'm wondering if anyone has compared or has comments on the audio device implementation in this patch vs Gustavo's, and why people have chosen to use the one or the other?

Also, I'm not particularly happy with the makefile setup that this patch comes with and which I'm using, for example, for developing+debugging in xcode its less than ideal. Ideally it would be cool if the gyp files could be adjusted to create the xcode projects for iOS - anybody tried/managed that? But even just manually modifying the xcode projects to work for iOS would be useful. Thus, I would love to hear from anyone who has successfully done that as to how they managed to manually adjust the projects so that they work as libs to create iOS fat binaries (i386, armv7, armv6) usable in both the simulator and on device by their iOS executable project?

arik

unread,
Aug 15, 2012, 6:57:25 AM8/15/12
to discuss...@googlegroups.com
Hello,

Does anyone know if there is already gyp support for iPhone somewhere? I'm starting to work on my own now and was hoping to save the work :)

I will be basing my work on the MAC configuration and generate an  X project for iPhone.

Arik
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

PhistucK

unread,
Aug 15, 2012, 7:08:13 AM8/15/12
to discuss...@googlegroups.com
Even if there is no port right now, I am sure there will be something soon, since Chrome has been (partially) ported to the iPhone and the changes for this port are currently being merged into the code base. I believe it will also use GYP, but I am not positive. Perhaps https://groups.google.com/forum/?fromgroups#!forum/gyp-developer is more appropriate for this question.

PhistucK
 
--
 
 
 





Nick

unread,
Sep 19, 2012, 12:35:18 PM9/19/12
to discuss...@googlegroups.com
Did you ever get a version posted on GitHub. I'm new this this and I'm looking for a good starting point. Maybe a project that is setup for use in iOS that I can build on.

On Wednesday, July 18, 2012 7:15:34 PM UTC-4, Steve Mcfarlin wrote:
I did start playing with that patch but quickly gave up. I ended up downloading trunk and peerconnection, and building them separately. For core WebRTC I did a mix of changing the Xcode project files and make. libvpx and libjpeg are build using make (never got libjpeg_turbo building). The rest is built using Xcode. Additionally I had to modify a handful of files mainly to #if defined(MAC_IPHONE or IOS) etc. For peerconnection I took the route of modifying the gyp file for libjingle to generate an iOS based Xcode build. Where I am at now is the core WebRTC trunk builds all the core media API static libraries (Including a AVFoundation based video capture class). I link to these in the peerconnection project. I then ported the linux peerconnection client to iOS. Right now I have limited the codec support to iSAC/16000/1 and VP8. I have also limited the capture to 352x288 or 192x144 (added to the supported formats). The iPad 2/3 performs really really well, but the iPhone 4S struggles on the VP8 encode at 352x288. All this is debug based code. I still have not modified the release build projects (not looking forward to that).

I also disabled secure RTP as SRTP was blowing up when encrypting. There are also many other hacks that I had to do. For the most it was a painless process but tedious. My todo list includes starting from scratch and editing all the gyp files to produce iOS Xcode builds, and also running diff to create a patch set for the source. Should I ever get a 'turn key' patch set I will post to github.

btw..  Right now I am armv7 build only.

Nick

unread,
Sep 19, 2012, 12:44:19 PM9/19/12
to discuss...@googlegroups.com
@Arik, would you be willing to share the iOS project?

Steve McFarlin

unread,
Sep 19, 2012, 12:46:54 PM9/19/12
to discuss...@googlegroups.com
I ran into some issues with doing that. I have heard there are people working on getting iOS into the gyp files. Once this occurs it will be easy to grab the source and generate the Xcode iOS projects. What I did end up doing was grabbing peerconnection with gclient. I then generated all the third_party Xcode projects using gyp. I believe I generated libjingle first as it has a lot of dependencies (e.g. webrtc). I then switched all the projects to iOS from Mac OS. At this point it may be worth waiting for the port to complete. It should be close, and may be in some experimental branch. Someone else on this list may be able to address that, and I do believe I did see a webrtc for iOS on github. Not sure if it is new or old.

--
 
 
 

arik

unread,
Sep 20, 2012, 11:12:59 AM9/20/12
to discuss...@googlegroups.com
I would, but the best way to do it is to generate your own project.

1) Download the source and sync(As in getting started section)
2) From command line: ./build/gyp_chromium --depth=.  -DOS=ios -Dtarget_arch=arm -Dinclude_tests=0 -Denable_protobuf=0 -Denable_video=0 webrtc.gyp

As a result you will have a working project but without ARM optimizations. They are still work in progress for IOS.

Arik

Nick F Benedict

unread,
Sep 20, 2012, 11:26:03 AM9/20/12
to discuss...@googlegroups.com
That's great, from the way the post read, it seemed like much more work than that.  Thanks for your help.

--
 
 
 

Zack Coder

unread,
Oct 4, 2012, 10:32:37 AM10/4/12
to discuss...@googlegroups.com
Hi Ari,

Does this assume you pulled just WebRTC trunk? or the trunk/peerconnection extension which includes libjingle?

arik

unread,
Oct 11, 2012, 11:52:59 AM10/11/12
to discuss...@googlegroups.com
It's Arik :) 

In any case, I am using the trunk with some changes to assembly files and I had to change the compiler for inline assembly on iPhone(From default to GCC 4.2). I am not using libjingle.
Message has been deleted
Message has been deleted

Steve Mcfarlin

unread,
Mar 4, 2013, 2:09:33 PM3/4/13
to discuss...@googlegroups.com
Hello Oleg - 

The code I wrote to wrap PeerConnection is application specific. It is not something I can really share. It is really straight forward. Check out the linux client in the examples folder in libjingle. At a high level what you will end up doing is creating a C++ class that extends PeerConnectionObserver. I have this observer forward on messages to my PeerConnection wrapper class (Objective-C). The Objective-C class simply controls the PeerConnection (Just like a JS class/functions would). I do believe WebRTC trunk now includes the iOS audio code. There is also a patch set with video code here (A little dated, but should still work): https://webrtc-codereview.appspot.com/524001/.

steve

On Saturday, March 2, 2013 10:54:30 PM UTC-8, Oleg Degtyarenko wrote:

Hi Steve!

You did PeerConnection client port for iOS platform, as I understood you right. So, could you please share your code? May be you  have this code in GitHub?

BR,
Oleg

четверг, 19 июля 2012 г., 3:15:34 UTC+4 пользователь Steve Mcfarlin написал:
I did start playing with that patch but quickly gave up. I ended up downloading trunk and peerconnection, and building them separately. For core WebRTC I did a mix of changing the Xcode project files and make. libvpx and libjpeg are build using make (never got libjpeg_turbo building). The rest is built using Xcode. Additionally I had to modify a handful of files mainly to #if defined(MAC_IPHONE or IOS) etc. For peerconnection I took the route of modifying the gyp file for libjingle to generate an iOS based Xcode build. Where I am at now is the core WebRTC trunk builds all the core media API static libraries (Including a AVFoundation based video capture class). I link to these in the peerconnection project. I then ported the linux peerconnection client to iOS. Right now I have limited the codec support to iSAC/16000/1 and VP8. I have also limited the capture to 352x288 or 192x144 (added to the supported formats). The iPad 2/3 performs really really well, but the iPhone 4S struggles on the VP8 encode at 352x288. All this is debug based code. I still have not modified the release build projects (not looking forward to that).

I also disabled secure RTP as SRTP was blowing up when encrypting. There are also many other hacks that I had to do. For the most it was a painless process but tedious. My todo list includes starting from scratch and editing all the gyp files to produce iOS Xcode builds, and also running diff to create a patch set for the source. Should I ever get a 'turn key' patch set I will post to github.

btw..  Right now I am armv7 build only.

On Monday, July 9, 2012 12:01:09 AM UTC-7, Harold wrote:

Oleg Degtyarenko

unread,
Mar 5, 2013, 1:48:30 AM3/5/13
to discuss...@googlegroups.com
Steve, thanks for advices!

I already did initial PeerConnection port and I can sent messages from my iPhone to web client (server_test.html) and do audio call to the linux peerconnection client. I did the same things as you did while peerconnection porting. So, the only thing is left - video calls. I hope (https://webrtc-codereview.appspot.com/524001/) this patch will help me.

BR,
Oleg

medusade

unread,
Mar 8, 2013, 5:04:19 PM3/8/13
to discuss...@googlegroups.com
Oleg, 

I've put a bunch of experimental "peerconnection_client" code on https://github.com/medusade/XosWebRTC. This code may help you figure out the threading a messaging model to use for an iOS Cocoa application.

medusade

Oleg Degtyarenko

unread,
Mar 9, 2013, 9:53:56 AM3/9/13
to discuss...@googlegroups.com
Medusade,

Thank you! I will check it out as soon.

BR,
Oleg

Oleg Degtyarenko

unread,
Mar 14, 2013, 8:04:09 AM3/14/13
to discuss...@googlegroups.com
Medusade,

I didn't find any project file in your code, how should I build it?

Thank you!


On Saturday, March 9, 2013 2:04:19 AM UTC+4, medusade wrote:

medusade

unread,
Mar 14, 2013, 9:02:05 PM3/14/13
to discuss...@googlegroups.com
Oleg, 

I've put up as sample the MacOSX makefile projects to illustrate how I built the code. Note XosWebRTC/xos depends on mxde/xos for its base classes. The make files build the xos/webrtc/client sources which use GoCast's r1080 mac build webrtc libraries. The evolution of the code is as follows:

Xoslib --  Older experimental code that use r1125/r1080
xos/webrtc/client --  Newer experimental code that still uses r1125/r1080
xos/webrtc/peerconnection/client -- Newer experimental code that uses the newer r3323

This code is experimental, and it is not intended to be a complete solution. This code is intended to help other developers to see how porting issues were addressed. I would like to eventually put up a cleaner and more complete code base as an application framework for webrtc.

medusade

Dennis Mårtensson

unread,
Jun 29, 2013, 1:22:45 PM6/29/13
to discuss...@googlegroups.com
Hi,

I am trying to build the /trunk/talk/examples/ios/ following the instruktions found here:

I get it to build for mac osx whit no problems, And then when I open libjingle.xcproj I cant select iPhone or iPad simulator whit out changing the the project architectures to base sdk Lates iOS. Is this wrong to do? 

And when I have changing the the project architectures I get coreaudio/coreaudio.h file not found.

What am I doing wrong here? I am using xcode 4.6.3 and Latest iOS(ios 6.1)

Can any one helt out and point me down the right road?

Thanks

Dennis Mårtensson

hero yin

unread,
Jul 1, 2013, 2:18:53 AM7/1/13
to discuss...@googlegroups.com
I am interesting about your code about WebRTC VoiceEngine in PJSIP , if you can share it , please send me a copy(her...@gmail.com)

在 2012年3月25日星期日UTC+8上午12时19分42秒,Alex写道:
Hi Arik,

    I was trying to integrate WebRTC VoiceEngine in PJSIP (just to replace PJMEDIA). It is working fine.
If you have any doubts, let me know. If possible, i will share my knowledge.


--

Regards,
J Alex Antony Vijay.

J Alex Antony Vijay

unread,
Jul 5, 2013, 1:21:21 AM7/5/13
to discuss...@googlegroups.com
Hi Dennis,

    Do you want to use WebRTC for iOS native application ?



--
 
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

ravi vora

unread,
Jul 16, 2013, 5:48:57 AM7/16/13
to discuss...@googlegroups.com
hello Alex, Dennis , arik
                           Can u plz provide sample code of webRTC for ios? my email id is vora...@gmail.com


ravi vora

unread,
Jul 16, 2013, 5:51:43 AM7/16/13
to discuss...@googlegroups.com
Hi Dennis, arik and ALex  can u plz provide sample code of webRTC for ios ? my email id is vora...@gmail.com

ravi vora

unread,
Jul 16, 2013, 5:53:54 AM7/16/13
to discuss...@googlegroups.com
Hello Alex , erik can u plz provide smaple code of webRTC for ios ?

shweta dodiya

unread,
Jul 17, 2013, 8:25:48 AM7/17/13
to discuss...@googlegroups.com

Hello Alex & Dennis,

I wanted to develop and webRTC in IOS as native application.
I tried to integrate the .h and .m files in the xcode project.But it gives me error in socket and Networking files.
Is there any way to resolve this?
How did you able to resolve this issues?
Is there any library available for webrtc?
Please share some work with me so that i can create the IOS native application properly.

Thanks in Advance.

J Alex Antony Vijay

unread,
Jul 18, 2013, 7:46:05 AM7/18/13
to discuss...@googlegroups.com
Hi Shweta,

    I have an question; Do you want to compile WebRTC source code by xcode or you have the library and trying to add it to xcode with header files ?

    If you are trying to compile using xcode, then make sure that you have configured all the dependencies with xcode.

I will recommend you to create a library by cross compilation and add it to xcode project.

I have integrated WebRTC Voice Engine with PJSIP (to replace PJMEDIA) on last year February. There was no code for iOS hardware integration (callback, playback). I think WebRTC has the code now. But I am not sure whether it will work for iOS native application.

pe...@perch.co

unread,
Jul 18, 2013, 12:46:43 PM7/18/13
to discuss...@googlegroups.com
WebRTC project is quite broken for iOS at the moment.
There is support for audio but not video; there is someone who about 6 months ago wrote support for audio and video for the iPhone but only the audio was merged - I'm working on patching the video at the moment.  I do have the full project compiling without errors but the example AppRTCDemo is massively broken with missing files [the majority of the errors are just case sensitive changes and a few incorrect directory paths].

@ridolph was close but you will need to adjust the steps to build a xcode proj 

Here is how I was able to compile for iOS:
  1. Set up depot_tools, set your PATH for depot_tools install ( http://dev.chromium.org/developers/how-tos/install-depot-tools )
  3. gclient sync --force
  4. build/gyp_chromium --depth=.  -DOS=ios -Dtarget_arch=c -Dinclude_tests=0 -Denable_protobuf=0 -Denable_video=1 webrtc.gyp
         NB: Setting the target_arch=arm will result in a lot of ARM assembly, which a few of the instructions were not compiling.  Clearly you will want to eventually use ARM assembly.  You will normally also add a -Darmv7 to that command as well.
  5. open ./trunk/webrtc.xcodeproj
  
  A. Update include paths (VPX) 
          vp8.xcodeproj>Build Settings>Search Paths>Add:"../../../../../third_party/libvpx/source/libvpx/"
  B.  modules.xcodeproj>Source>video_renderer>video_renderer_impl.cc ->  "iPhone/video_render_iphone_impl.h" missing
          I'm working on that at the moment - the naming convention should be ios/video_render_ios_impl.h
          There is a patch at: https://webrtc-codereview.appspot.com/524001/
          But according to:  https://webrtc-codereview.appspot.com/1829004  it looks like it is getting nuked.

If you have tips on compiling the ARM7 ASM code would be greatly appreciated.

Ami Fischman

unread,
Jul 18, 2013, 3:31:18 PM7/18/13
to discuss...@googlegroups.com
On Thu, Jul 18, 2013 at 9:46 AM, <pe...@perch.co> wrote:
WebRTC project is quite broken for iOS at the moment.

The good news is that I've been working on fixing the OS=ios libjingle build and have it working on my dev machine.  I'm now sending out patches for review and landing fixes to libjingle dependencies to enable the iOS build.  I'll send out the libjingle CL as soon as those land; this is being tracked in https://code.google.com/p/webrtc/issues/detail?id=2106 and I hope to be able to close that soonish.
Adding video support to iOS is being tracked in https://code.google.com/p/webrtc/issues/detail?id=2105 and as noted in the bug there is a CL under review.

Cheers,
-a

Rahul Pathak

unread,
Jul 23, 2013, 9:29:14 AM7/23/13
to discuss...@googlegroups.com
Hi all,
        i done with webrtc porting on ios last 3 months ago. and its working good if you are from Indian then can you please add me on gtalk and we can discuss there in hindi coz my English is not so good my email id is rrpth...@gmail.com

BR,
Rahul Pathak

Khang Le

unread,
Jul 30, 2013, 10:04:58 AM7/30/13
to discuss...@googlegroups.com
Hi arik,
I've been building AppRTCDemo for iOS simulator but not get success . These errors :

Undefined symbols for architecture i386:

  "std::string::push_back(char)", referenced from:

      cricket::GetFourccName(unsigned int) in libjingle_media.a(videocapturer.o)

      talk_base::CreateRandomString(unsigned long, char const*, int, std::string*) in libjingle.a(helpers.o)

      bool talk_base::Base64::DecodeFromArrayTemplate<std::string>(char const*, unsigned long, int, std::string*, unsigned long*) in libjingle.a(base64.o)

      talk_base::quote(std::string const&) in libjingle.a(httpcommon.o)

  "std::ostream::operator<<(unsigned long)", referenced from:

Do you know those errors ?

I built iOS device without those errors .

Khang Le

unread,
Jul 30, 2013, 10:08:11 AM7/30/13
to discuss...@googlegroups.com
Hi arik,
I've built AppRTCDemo for iOS simulator with errors as below :

Undefined symbols for architecture i386:

  "std::string::push_back(char)", referenced from:

      cricket::GetFourccName(unsigned int) in libjingle_media.a(videocapturer.o)

      talk_base::CreateRandomString(unsigned long, char const*, int, std::string*) in libjingle.a(helpers.o)

      bool talk_base::Base64::DecodeFromArrayTemplate<std::string>(char const*, unsigned long, int, std::string*, unsigned long*) in libjingle.a(base64.o)

      talk_base::quote(std::string const&) in libjingle.a(httpcommon.o)

  "std::ostream::operator<<(unsigned long)", referenced from:

I used static libraries built from steps that you gave .

Can you tell me how to fix the above errors ? (i got 144 errors Mach-O linker ) .

Steve Mcfarlin

unread,
Aug 1, 2013, 7:00:01 PM8/1/13
to discuss...@googlegroups.com
Make sure you link to a C++ standard library when building your application: libstdc++.dylib

andy424

unread,
Aug 2, 2013, 7:25:10 AM8/2/13
to discuss...@googlegroups.com

Hi Ami,
I managed to compile with your recent svn commit 4466 by following the objective-c README (svn 4467) and load the AppRTCDemo on my iOS device

While it appears to negotiate the SDP successfuly with the desktop browser listening for connections in the same room, I see no video screen -- just the text screen that is displaying the SDP and ICE and GAE negotiation and status

Is this expected or am I missing a step? I am entering the room number in the demo app itself and not attempting the safari URL apprtc://apprtc.appspot.com/?r=<room_number>

Thanks

andy424

unread,
Aug 2, 2013, 9:10:30 AM8/2/13
to discuss...@googlegroups.com
Here is what appears on the iOS apprtcdemo app

onICEServers - add local stream.
GAE onOpen - create offer.
PC - createOffer.
SDP onSuccess(SDP) - set local description.
PC setLocalDescription.
SDP onSuccess() - possibly drain candidates
GAE onMessage type - candidate
GAE onMessage type - answer
PC - setRemoteDescription.
SDP onSuccess() - possibly drain candidates
SDP onSuccess - drain candidates
GAE onMessage type - candidate
GAE onMessage type - candidate
GAE onMessage type - candidate

No video

Ami Fischman

unread,
Aug 2, 2013, 1:58:01 PM8/2/13
to discuss...@googlegroups.com
Video engine doesn't build on iOS yet; bug 2105 is tracking that.  I just filed bug 2168 to take advantage of video-engine support on iOS once that lands.

Cheers,
-a

--

umer farooque M

unread,
Aug 6, 2013, 2:01:10 AM8/6/13
to discuss...@googlegroups.com


hello Alex, Dennis , arik and all,
                           Can u plz provide sample code of webRTC for ios? my email id is umerf...@gmail.com




regards 
Ummer farooque

umer farooque M

unread,
Aug 6, 2013, 4:36:04 AM8/6/13
to discuss...@googlegroups.com
 Ya..I want to implement WebRTC for IOs native application...
will you please share code 

sergey...@movial.com

unread,
Aug 6, 2013, 9:28:19 AM8/6/13
to discuss...@googlegroups.com
Hi Ami,

I have a bit different result than andy424 above. The app crashes in iOS sim as soon as I enter room id. I'm trying to join the room running in Chrome on different machine with Ubuntu.

$ ./out_sim/Debug/iossim out_sim/Debug/AppRTCDemo.app
2013-08-06 16:19:33.155 AppRTCDemo[76181:12607] *** Assertion failure in -[APPRTCAppClient updateICEServers:withTurnServer:], ../../talk/examples/ios/AppRTCDemo/APPRTCAppClient.m:200
2013-08-06 16:19:33.155 AppRTCDemo[76181:12607] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unable to parse.  The operation couldn’t be completed. (Cocoa error 3840.)'
*** First throw call stack:
(0x2af0012 0x2d25e7e 0x2aefe78 0x161e665 0x5957 0x368353f 0x3695014 0x3685418 0x36852a6 0x3686280 0x3685fcb 0x91f08b24 0x91f0a6fe)
libc++abi.dylib: terminate called throwing an exception
iossim: WARNING: Ignoring that Simulator ended with: "The simulated application quit." (DTiPhoneSimulatorErrorDomain:1)
iossim: WARNING: Console message: Job appears to have crashed: Abort trap: 6
iossim: ERROR: Simulated app crashed or exited with non-zero status

If I run Chrome on the same Mac I get till 'PC - createOffer' but then it crashes with same 'Unable to parse' error.

$ ./out_sim/Debug/iossim out_sim/Debug/AppRTCDemo.app                     [5]
2013-08-06 16:25:50.851 AppRTCDemo[76207:11603] GAE onOpen - create offer.
2013-08-06 16:25:50.851 AppRTCDemo[76207:11603] PC - createOffer.
2013-08-06 16:25:55.734 AppRTCDemo[76207:12607] *** Assertion failure in -[APPRTCAppClient updateICEServers:withTurnServer:], ../../talk/examples/ios/AppRTCDemo/APPRTCAppClient.m:200
2013-08-06 16:25:55.735 AppRTCDemo[76207:12607] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unable to parse.  The operation couldn’t be completed. (Cocoa error 3840.)'
*** First throw call stack:
(0x2af0012 0x2d25e7e 0x2aefe78 0x161e665 0x5957 0x368353f 0x3695014 0x3685418 0x36852a6 0x3686280 0x3685fcb 0x91f08b24 0x91f0a6fe)
libc++abi.dylib: terminate called throwing an exception
iossim: WARNING: Console message: Job appears to have crashed: Abort trap: 6
iossim: ERROR: Simulated app crashed or exited with non-zero status

Sergey

Ami Fischman

unread,
Aug 6, 2013, 3:15:43 PM8/6/13
to discuss...@googlegroups.com
If you look at the NSAssert that's firing, it's in the code that tries to get a TURN server from COED, which is down at the moment.
Star https://code.google.com/p/webrtc/issues/detail?id=2184 for updates on COED being fixed.
Note that this is not ios-specific.

Ummer farooque M

unread,
Aug 7, 2013, 6:22:16 AM8/7/13
to discuss...@googlegroups.com

hello,

I'm trying to build appRTCDemo for iOS following instructions in README, but  I'm unable to build libjingle.xcproj for iPhone or iPad simulator.
Has anyone succeeded in building it for iPhone or iPad simulator and how did he manage to build it ?

sergey...@movial.com

unread,
Aug 7, 2013, 7:52:23 AM8/7/13
to discuss...@googlegroups.com
Thanks! The workaround did the trick.

sergey...@movial.com

unread,
Aug 7, 2013, 8:07:25 AM8/7/13
to discuss...@googlegroups.com
Is there a bug to track the state of audio support?



On Friday, August 2, 2013 8:58:01 PM UTC+3, Ami Fischman wrote:

andy424

unread,
Aug 7, 2013, 12:23:29 PM8/7/13
to discuss...@googlegroups.com
This is the readme to follow


In the readme, the path to the libjingle trunk can be substituted with the path to the webrtc trunk

Note, the xcodeproj was removed and the entire app is built using the command line as explained in the above README

Ami Fischman

unread,
Aug 7, 2013, 12:54:19 PM8/7/13
to discuss...@googlegroups.com
On Wed, Aug 7, 2013 at 5:07 AM, <sergey...@movial.com> wrote:
Is there a bug to track the state of audio support?

There wasn't; I just flled 2191.

Cheers,
-a

Mike Anderson

unread,
Aug 9, 2013, 12:27:52 AM8/9/13
to discuss...@googlegroups.com
I am finding that the opus audio output is choppy to the point that speech is unintelligible and seems to be suffering from buffering issues, the delay increases the longer the connection is held.
Switching to isac everything works fine.
Has anyone experienced this issue?  (connecting ipod touch 5G iOS6 to chrome 28)

Thanks
-Mike

Khang Le

unread,
Aug 9, 2013, 7:33:14 AM8/9/13
to discuss...@googlegroups.com

Dominic Wroblewski

unread,
Aug 9, 2013, 1:55:44 PM8/9/13
to discuss...@googlegroups.com
I seem to be getting the following errors:

Khang Le

unread,
Aug 9, 2013, 2:35:51 PM8/9/13
to discuss...@googlegroups.com

Dominic Wroblewski

unread,
Aug 9, 2013, 3:09:57 PM8/9/13
to discuss...@googlegroups.com
Yep, I'm having a similar issue. Where's the place to change it to use isac?

Steve Mcfarlin

unread,
Aug 9, 2013, 3:31:05 PM8/9/13
to discuss...@googlegroups.com
The issue for me is that the current implementation of libopus is not optimized. I had to compile it with O3 to get it to encode and decode in real time. There is opus 1.1-beta which has performance optimizations (works good in my testing). http://people.xiph.org/~xiphmont/demo/opus/demo3.shtml (read the last paragraph on that page).

Mike Anderson

unread,
Aug 13, 2013, 2:27:10 AM8/13/13
to discuss...@googlegroups.com
I wasn't able to find a way to do it within the native API. I think there is a feature request out for that functionality.
But for now, you can edit the SDPs to trick both clients into thinking that the other wants them to use ISAC.

if you look in the offer or answer you'll find the following lines (I've excluded many lines in-between that are not important):

m=audio 1 RTP/SAVPF 111 103 104 9 102 0 8 107 106 105 13 127 126
a=rtpmap:111 opus/48000/2
a=rtpmap:103 ISAC/16000

The sdp spec (roughly) says that you define your media channel as m=<media type> <id> <protocol> <preferred codec list>
You then have to specify using the a tag what each of those numbers corresponds to in terms of codec.

So, you can just use some regex to swap the preferred codec list around in the SDP string before sending your local sdp string and before processing the received remote sdp string.

NSError *error = NULL;
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:
@"RTP/SAVPF 111 103" options:(NSRegularExpressionOptions)nil error:&error];
NSString *modifiedSDP = [regex stringByReplacingMatchesInString:sdp.description options:0 range:NSMakeRange(0, [sdp.description length]) withTemplate:
@"RTP/SAVPF 103 111"];

Personal Disclaimer: I do not think this should ever be used for production code, as I don't think those numbers are actually set in stone. But it seems to work fine as a quick hacky work-around for testing.

Dominic Wroblewski

unread,
Aug 15, 2013, 1:29:37 PM8/15/13
to discuss...@googlegroups.com
Just pulled some updates via gclient sync, and now when I run it I get the following:

yp: Undefined variable yasm_path in trunk/third_party/libjpeg_turbo/libjpeg.gyp while loading dependencies of trunk/webrtc/common_video/common_video.gyp while loading dependencies of trunk/webrtc/webrtc.gyp while loading dependencies of trunk/all.gyp while trying to load trunk/all.gyp
Error: Command /usr/bin/python trunk/build/gyp_chromium --depth=trunk trunk/all.gyp -Dextra_gyp_flag=0 returned non-zero exit status 1 in /Users/Mac/.bin/depot_tools

sergey...@movial.com

unread,
Aug 18, 2013, 4:34:11 PM8/18/13
to discuss...@googlegroups.com
I get the same error. Reverted back to safe r4500.

Daniel Yang

unread,
Aug 19, 2013, 9:48:57 PM8/19/13
to discuss...@googlegroups.com
I have success build webrtc for ios, and would like to share the APPRTCDemo project.


在 2012年3月20日星期二UTC+8上午1时23分59秒,arik写道:

Daniel Yang

unread,
Aug 21, 2013, 3:42:03 AM8/21/13
to discuss...@googlegroups.com
Sorry, mistake
The right link is:https://github.com/newOcean/webrtc-ios/tree/master/ios-example

在 2013年8月20日星期二UTC+8上午9时48分57秒,Daniel Yang写道:
It is loading more messages.
0 new messages