5

I am trying to build Native WebRTC on Pi2 using the following commands

sudo apt-get install git
sudo git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /opt/depot_tools

echo "export PATH=\$PATH:/opt/depot_tools" | sudo tee /etc/profile.d/depot_tools.sh
source /etc/profile

mkdir webrtc
cd webrtc
GYP_DEFINES="clang=0" fetch --no-history webrtc 

This fails ending with :

________ running '/usr/bin/python src/tools/clang/scripts/update.py --if-needed' in '/home/pi/webrtc/src/chromium'
Error: Command /usr/bin/python src/tools/clang/scripts/update.py --if-needed returned non-zero exit status 1 in /home/pi/webrtc/src/chromium
Traceback (most recent call last):
  File "src/tools/clang/scripts/update.py", line 324, in <module>
    sys.exit(main())
  File "src/tools/clang/scripts/update.py", line 304, in main
    stderr=os.fdopen(os.dup(sys.stdin.fileno())))
OSError: [Errno 22] Invalid argument
Hook '/usr/bin/python -u src/sync_chromium.py --target-revision d5098d02757b36232af2a50c2bcaa9dc36e70017' took 4732.59 secs
Running: gclient config --spec 'solutions = [
  {
    "managed": False,
    "name": "src",
    "url": "https://chromium.googlesource.com/external/webrtc.git",
    "custom_deps": {},
    "deps_file": "DEPS",
    "safesync_url": "",
  },
]
'
Running: gclient sync --no-history --with_branch_heads
Traceback (most recent call last):
  File "/opt/depot_tools/fetch.py", line 335, in <module>
    sys.exit(main())
  File "/opt/depot_tools/fetch.py", line 330, in main
    return run(options, spec, root)
  File "/opt/depot_tools/fetch.py", line 324, in run
    return checkout.init()
  File "/opt/depot_tools/fetch.py", line 136, in init
    self.run_gclient(*sync_cmd)
  File "/opt/depot_tools/fetch.py", line 76, in run_gclient
    return self.run(cmd_prefix + cmd, **kwargs)
  File "/opt/depot_tools/fetch.py", line 66, in run
    return subprocess.check_call(cmd, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 511, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('gclient', 'sync', '--no-history', '--with_branch_heads')' returned non-zero exit status 2

I tried with many revision, with one gclient revinfo -a says:

src: https://chromium.googlesource.com/external/webrtc.git@bd67f66ebd1ee5a4605ca14b230ec5ee8bf6407e
src/third_party/gflags/src: https://chromium.googlesource.com/external/gflags/src@e7390f9185c75f8d902c05ed7d20bb94eb914d0c
src/third_party/junit: https://chromium.googlesource.com/external/webrtc/deps/third_party/junit@f35596b476aa6e62fd3b3857b9942ddcd13ce35e

As uv4l-webrtc use it, it should be possible to build it, but how ?

mpromonet
  • 1,124
  • 1
  • 19
  • 38

2 Answers2

5

Native WebRTC use an old sysroot debian_wheezy_arm_sysroot.tgz that is linked to gcc-4.6 and some tools (like chromium-gn) seems not available for arm platform, so I changed my mind and try to cross-compile it.

It is possible to cross-compile on an Ubuntu 14.10 x86_64 system using the following steps :

  1. Install toolchain :

    sudo apt-get install git
    sudo git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /opt/depot_tools
    echo "export PATH=/opt/depot_tools:\$PATH" | sudo tee /etc/profile.d/depot_tools.sh
    sudo git clone https://github.com/raspberrypi/tools.git /opt/rpi_tools
    echo "export PATH=/opt/rpi_tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:\$PATH" | sudo tee /etc/profile.d/rpi_tools.sh
    source /etc/profile
    
  2. get sources:

    export GYP_DEFINES="target_arch=arm"
    fetch --no-history webrtc 
    

This step takes quite long time and it could be needed to run gclient sync if fetch fails.

  1. build :

    pushd src
    gn gen arm/out/Release --args='is_debug=false rtc_include_tests=false is_clang=false target_cpu="arm" treat_warnings_as_errors=false rtc_enable_protobuf=false'
    ninja -C arm/out/Release
    popd
    
mpromonet
  • 1,124
  • 1
  • 19
  • 38
0

Google WebRTC is not officially supported on ARM Linux (!= Android). I think you will have to patch the code in any case. I tried once, but I gave up.

strumpet
  • 9
  • 1