Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use compile_native_code=true #5

Closed
HuuNguyen312 opened this issue Jan 11, 2019 · 4 comments
Closed

How to use compile_native_code=true #5

HuuNguyen312 opened this issue Jan 11, 2019 · 4 comments

Comments

@HuuNguyen312
Copy link

HuuNguyen312 commented Jan 11, 2019

Dear @Piasy ,

android_gradle is a great repository for exploring WebRTC Android in Android Studio.
I tried with use compile_native_code=false, it works very well.

I want to explore by using native code (compile_native_code=true). But I can't build.

This is the error log.

Error configuring CMake server (/Users/xxx/Library/Android/sdk/cmake/3.10.2.4988404/bin).

Check for working C compiler: /Users/xxx/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang

Check for working C compiler: /Users/xxx/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -- works

Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
....

See also "/Users/xxx/HackWebrtc/sdk/android_gradle/webrtc/.externalNativeBuild/cmake/debug/x86/CMakeFiles/CMakeOutput.log".

Please help me resolve it.
Also, Can I build libjingle_peerconnection_so.so from Android Studio?

Thanks

@Piasy
Copy link
Member

Piasy commented Jan 11, 2019

Did you read the README here? https://github.com/Piasy/webrtc/tree/hack_webrtc/sdk/android_gradle

I just build libjingle_peerconnection_so.so within Android Studio and debug C++ code (break point and step in) successfully before I push the latest commit.

@HuuNguyen312
Copy link
Author

Thanks for your responding.

I have read the README

  1. you need download and sync WebRTC repo by yourself, this project won't do that for you;
  2. use the same version of Android SDK and NDK as WebRTC does;
  3. (re)create protoc after updating webrtc repo, build WebRTC with ninja would create it;
  4. delete webrtc_build_dir after updating webrtc repo;

Please help us explain step 3.

My gradle.properties
/Users/huunn/GitHub/WebRTC/webrtc-checkout/ is my WebRTC checkout location from https://webrtc.org/native-code/android/

webrtc_repo=/Users/huunn/GitHub/WebRTC/webrtc-checkout/src
webrtc_build_dir=out/android_studio

android_jar=third_party/android_tools_mac/sdk/platforms/android-28/android.jar

py2=/Users/piasy/anaconda3/envs/py2/bin/python
protoc=/Users/huunn/GitHub/WebRTC/webrtc-checkout/src

When Android Studio build, it return the error

Error while executing process /Users/huunn/Library/Android/sdk/cmake/3.10.2.4988404/bin/cmake with arguments {--build /Users/huunn/GitHub/WebRTC/webrtc-checkout/src/sdk/android_gradle/webrtc/.externalNativeBuild/cmake/debug/x86 --target jingle_peerconnection_so}
[1/1861] Generating err_data.c
FAILED: third_party/boringssl/boringssl/crypto/err_data.c 
cd /Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/boringssl/src/crypto/err && go run err_data_generate.go > /Users/huunn/GitHub/WebRTC/webrtc-checkout/src/sdk/android_gradle/webrtc/.externalNativeBuild/cmake/debug/x86/third_party/boringssl/boringssl/crypto/err_data.c
/bin/sh: go: command not found
[2/1861] Generating chacha/chacha-x86.S
[3/1861] Linking C static library third_party/libsrtp/libsrtp.a
[4/1861] Linking CXX static library third_party/abseil-cpp/abseil-cpp/absl/strings/libabsl_strings.a
[5/1861] Building C object third_party/libvpx/CMakeFiles/vpx.dir/Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/libvpx/vp8/common/arm/neon/idct_dequant_full_2x_neon.c.o
FAILED: third_party/libvpx/CMakeFiles/vpx.dir/Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/libvpx/vp8/common/arm/neon/idct_dequant_full_2x_neon.c.o 
/Users/huunn/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=i686-none-linux-android16 --gcc-toolchain=/Users/huunn/Library/Android/sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/darwin-x86_64 --sysroot=/Users/huunn/Library/Android/sdk/ndk-bundle/sysroot  -I/Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/config -I/Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/config/linux/arm64 -I/Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/libvpx -isystem /Users/huunn/Library/Android/sdk/ndk-bundle/sysroot/usr/include/i686-linux-android -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -Wa,--noexecstack -Wformat -Werror=format-security  -O0 -fno-limit-debug-info  -fPIC -MD -MT third_party/libvpx/CMakeFiles/vpx.dir/Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/libvpx/vp8/common/arm/neon/idct_dequant_full_2x_neon.c.o -MF third_party/libvpx/CMakeFiles/vpx.dir/Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/libvpx/vp8/common/arm/neon/idct_dequant_full_2x_neon.c.o.d -o third_party/libvpx/CMakeFiles/vpx.dir/Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/libvpx/vp8/common/arm/neon/idct_dequant_full_2x_neon.c.o   -c /Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/libvpx/vp8/common/arm/neon/idct_dequant_full_2x_neon.c
In file included from /Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/libvpx/vp8/common/arm/neon/idct_dequant_full_2x_neon.c:11:
/Users/huunn/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/7.0.2/include/arm_neon.h:28:2: error: "NEON support not enabled"
#error "NEON support not enabled"

Thanks

@Piasy
Copy link
Member

Piasy commented Jan 12, 2019

I've pushed a new commit, please check the diff.

@ducanh3005
Copy link

Thanks for your responding.

I have read the README

  1. you need download and sync WebRTC repo by yourself, this project won't do that for you;
  2. use the same version of Android SDK and NDK as WebRTC does;
  3. (re)create protoc after updating webrtc repo, build WebRTC with ninja would create it;
  4. delete webrtc_build_dir after updating webrtc repo;

Please help us explain step 3.

My gradle.properties
/Users/huunn/GitHub/WebRTC/webrtc-checkout/ is my WebRTC checkout location from https://webrtc.org/native-code/android/

webrtc_repo=/Users/huunn/GitHub/WebRTC/webrtc-checkout/src
webrtc_build_dir=out/android_studio

android_jar=third_party/android_tools_mac/sdk/platforms/android-28/android.jar

py2=/Users/piasy/anaconda3/envs/py2/bin/python
protoc=/Users/huunn/GitHub/WebRTC/webrtc-checkout/src

When Android Studio build, it return the error

Error while executing process /Users/huunn/Library/Android/sdk/cmake/3.10.2.4988404/bin/cmake with arguments {--build /Users/huunn/GitHub/WebRTC/webrtc-checkout/src/sdk/android_gradle/webrtc/.externalNativeBuild/cmake/debug/x86 --target jingle_peerconnection_so}
[1/1861] Generating err_data.c
FAILED: third_party/boringssl/boringssl/crypto/err_data.c 
cd /Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/boringssl/src/crypto/err && go run err_data_generate.go > /Users/huunn/GitHub/WebRTC/webrtc-checkout/src/sdk/android_gradle/webrtc/.externalNativeBuild/cmake/debug/x86/third_party/boringssl/boringssl/crypto/err_data.c
/bin/sh: go: command not found
[2/1861] Generating chacha/chacha-x86.S
[3/1861] Linking C static library third_party/libsrtp/libsrtp.a
[4/1861] Linking CXX static library third_party/abseil-cpp/abseil-cpp/absl/strings/libabsl_strings.a
[5/1861] Building C object third_party/libvpx/CMakeFiles/vpx.dir/Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/libvpx/vp8/common/arm/neon/idct_dequant_full_2x_neon.c.o
FAILED: third_party/libvpx/CMakeFiles/vpx.dir/Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/libvpx/vp8/common/arm/neon/idct_dequant_full_2x_neon.c.o 
/Users/huunn/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=i686-none-linux-android16 --gcc-toolchain=/Users/huunn/Library/Android/sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/darwin-x86_64 --sysroot=/Users/huunn/Library/Android/sdk/ndk-bundle/sysroot  -I/Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/config -I/Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/config/linux/arm64 -I/Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/libvpx -isystem /Users/huunn/Library/Android/sdk/ndk-bundle/sysroot/usr/include/i686-linux-android -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -Wa,--noexecstack -Wformat -Werror=format-security  -O0 -fno-limit-debug-info  -fPIC -MD -MT third_party/libvpx/CMakeFiles/vpx.dir/Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/libvpx/vp8/common/arm/neon/idct_dequant_full_2x_neon.c.o -MF third_party/libvpx/CMakeFiles/vpx.dir/Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/libvpx/vp8/common/arm/neon/idct_dequant_full_2x_neon.c.o.d -o third_party/libvpx/CMakeFiles/vpx.dir/Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/libvpx/vp8/common/arm/neon/idct_dequant_full_2x_neon.c.o   -c /Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/libvpx/vp8/common/arm/neon/idct_dequant_full_2x_neon.c
In file included from /Users/huunn/GitHub/WebRTC/webrtc-checkout/src/third_party/libvpx/source/libvpx/vp8/common/arm/neon/idct_dequant_full_2x_neon.c:11:
/Users/huunn/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/7.0.2/include/arm_neon.h:28:2: error: "NEON support not enabled"
#error "NEON support not enabled"

Thanks

Can you help me to build this project

Piasy pushed a commit that referenced this issue Jun 20, 2021
This reverts commit 76d3e7a.

Reason for revert: Causes multiple Chromium WPT tests to crash, preventing rolls.

Sample failed run:
https://ci.chromium.org/p/chromium/builders/try/win10_chromium_x64_rel_ng/685757?

Sample stack trace:
#0 0x7ff8623fbde9 base::debug::CollectStackTrace()
STDERR: #1 0x7ff862311ca3 [2665012:17:1009/162250.249660:WARNING:timestamp_aligner.cc(131)] too short translated timestamp interval: system time (us) = 3042652370324, interval (us) = 834
STDERR: base::debug::StackTrace::StackTrace()
STDERR: #2 0x7ff8623fb93b base::debug::(anonymous namespace)::StackDumpSignalHandler()
STDERR: #3 0x7ff857a70140 [2665012:17:1009/162250.249947:WARNING:timestamp_aligner.cc(131)] too short translated timestamp interval: system time (us) = 3042652370634, interval (us) = 742
STDERR: (/lib/x86_64-linux-gnu/libpthread-2.31.so+0x1413f)
STDERR: #4 0x7ff85778edb1 gsignal
STDERR: #5 0x7ff857778537 abort
STDERR: #6 0x7ff855d5eee2 [2665012:17:1009/162250.250342:WARNING:timestamp_aligner.cc(131)] too short translated timestamp interval: system time (us) = 3042652371030, interval (us) = 706
STDERR: [2665012:17:1009/162250.250514:WARNING:timestamp_aligner.cc(131)] too short translated timestamp interval: system time (us) = 3042652371204, interval (us) = 963
STDERR: rtc::webrtc_checks_impl::FatalLog()
STDERR: #7 0x7ff855f14e62 webrtc::LibvpxVp8Encoder::PrepareRawImagesForEncoding()
STDERR: #8 0x7ff855f14412 webrtc::LibvpxVp8Encoder::Encode()
STDERR: #9 0x7ff855bae765 webrtc::SimulcastEncoderAdapter::Encode()
STDERR: #10 0x7ff85607d598 webrtc::VideoStreamEncoder::EncodeVideoFrame()
STDERR: #11 0x7ff85607c60d webrtc::VideoStreamEncoder::MaybeEncodeVideoFrame()
STDERR: #12 0x7ff8560816f5 webrtc::webrtc_new_closure_impl::ClosureTask<>::Run()
STDERR: #13 0x7ff855b352b5 (anonymous namespace)::WebrtcTaskQueue::RunTask()
STDERR: #14 0x7ff855b3531e base::internal::Invoker<>::RunOnce()
STDERR: #15 0x7ff86239785b base::TaskAnnotator::RunTask()
STDERR: #16 0x7ff8623c8557 base::internal::TaskTracker::RunSkipOnShutdown()
STDERR: #17 0x7ff8623c7d92 base::internal::TaskTracker::RunTask()
STDERR: #18 0x7ff862415a06 base::internal::TaskTrackerPosix::RunTask()
STDERR: #19 0x7ff8623c75e6 base::internal::TaskTracker::RunAndPopNextTask()
STDERR: #20 0x7ff8623d3a8d base::internal::WorkerThread::RunWorker()
STDERR: #21 0x7ff8623d368d base::internal::WorkerThread::RunPooledWorker()
STDERR: #22 0x7ff862416509 base::(anonymous namespace)::ThreadFunc()
STDERR: #23 0x7ff857a64ea7 start_thread 

Original change's description:
> NV12 support for VP8 simulcast
>
> Tested using video_loopback with generated NV12 frames.
>
> Bug: webrtc:11635, webrtc:11975
> Change-Id: I14b2d663c55a83d80e48e226fcf706cb18903193
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186722
> Commit-Queue: Evan Shrubsole <eshr@google.com>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32325}

TBR=ilnik@webrtc.org,eshr@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:11635
Bug: webrtc:11975
Change-Id: I61c8aed1270bc9c2f7f0577fa5ca717a325f548a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187484
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32369}
Piasy pushed a commit that referenced this issue Jun 20, 2021
This reverts commit c5f7108.

Reason for revert: Causes Chromium WPT Tests to fail, preventing rolls.

Sample failed run:
https://ci.chromium.org/p/chromium/builders/try/linux-rel/511995?

Sample logs:

STDERR: # Fatal error in: ../../third_party/webrtc/pc/peer_connection.cc, line 575
STDERR: # last system error: 0
STDERR: # Check failed: (signaling_thread())->IsCurrent()
STDERR: # Received signal 6
STDERR: #0 0x7f81d39e3de9 base::debug::CollectStackTrace()
STDERR: #1 0x7f81d38f9ca3 base::debug::StackTrace::StackTrace()
STDERR: #2 0x7f81d39e393b base::debug::(anonymous namespace)::StackDumpSignalHandler()
STDERR: #3 0x7f81c9054140 (/lib/x86_64-linux-gnu/libpthread-2.31.so+0x1413f)
STDERR: #4 0x7f81c8d72db1 gsignal
STDERR: #5 0x7f81c8d5c537 abort
STDERR: #6 0x7f81c7344032 rtc::webrtc_checks_impl::FatalLog()
STDERR: #7 0x7f81c722e5c0 webrtc::webrtc_function_impl::CallHelpers<>::CallInlineStorage<>()
STDERR: #8 0x7f81c7348d99 webrtc::robo_caller_impl::RoboCallerReceivers::Foreach()
STDERR: #9 0x7f81c72d6e8e webrtc::webrtc_function_impl::CallHelpers<>::CallInlineStorage<>()
STDERR: #10 0x7f81c7348d99 webrtc::robo_caller_impl::RoboCallerReceivers::Foreach()
STDERR: #11 0x7f81c71c6df3 webrtc::webrtc_function_impl::CallHelpers<>::CallInlineStorage<>()
STDERR: #12 0x7f81c7348d99 webrtc::robo_caller_impl::RoboCallerReceivers::Foreach()
STDERR: #13 0x7f81c73135bc rtc::OpenSSLStreamAdapter::ContinueSSL()
STDERR: #14 0x7f81c7312fd4 rtc::OpenSSLStreamAdapter::OnEvent()
STDERR: #15 0x7f81c71c30d9 cricket::StreamInterfaceChannel::OnPacketReceived()
STDERR: #16 0x7f81c71c640a cricket::DtlsTransport::OnReadPacket()
STDERR: #17 0x7f81c71cad61 cricket::P2PTransportChannel::OnReadPacket()
STDERR: #18 0x7f81c71bc90f cricket::Connection::OnReadPacket()
STDERR: #19 0x7f81c71e6255 cricket::UDPPort::HandleIncomingPacket()
STDERR: #20 0x7f81cd1f1bff blink::(anonymous namespace)::IpcPacketSocket::OnDataReceived()
STDERR: #21 0x7f81cd1f645d blink::P2PSocketClientImpl::DataReceived()
STDERR: #22 0x7f81cd50a16b network::mojom::blink::P2PSocketClientStubDispatch::Accept()
STDERR: #23 0x7f81d2b4f642 mojo::InterfaceEndpointClient::HandleValidatedMessage()
STDERR: #24 0x7f81d2b5304b mojo::MessageDispatcher::Accept()
STDERR: #25 0x7f81d2b50bb1 mojo::InterfaceEndpointClient::HandleIncomingMessage()
STDERR: #26 0x7f81d2b58a3a mojo::internal::MultiplexRouter::ProcessIncomingMessage()
STDERR: #27 0x7f81d2b57f7f mojo::internal::MultiplexRouter::Accept()
STDERR: #28 0x7f81d2b5304b mojo::MessageDispatcher::Accept()
STDERR: #29 0x7f81d2b48851 mojo::Connector::DispatchMessage()
STDERR: #30 0x7f81d2b492e7 mojo::Connector::ReadAllAvailableMessages()
STDERR: #31 0x7f81d2b490a3 mojo::Connector::OnHandleReadyInternal()
STDERR: #32 0x7f81d2b498f0 mojo::SimpleWatcher::DiscardReadyState()
STDERR: #33 0x7f81d2d0e67a mojo::SimpleWatcher::OnHandleReady()
STDERR: #34 0x7f81d2d0eb2b base::internal::Invoker<>::RunOnce()
STDERR: #35 0x7f81d397f85b base::TaskAnnotator::RunTask()
STDERR: #36 0x7f81d399a04c base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl()
STDERR: #37 0x7f81d3999c78 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork()
STDERR: #38 0x7f81d391fe64 base::MessagePumpDefault::Run()
STDERR: #39 0x7f81d399a8dc base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run()
STDERR: #40 0x7f81d395ae55 base::RunLoop::Run()
STDERR: #41 0x7f81d39c87f2 base::Thread::Run()




Original change's description:
> Reland "Replace sigslot usages with robocaller library."
>
> This is a reland of 40261c3
>
> Note: Instead of changing the type of JsepTransportController->SignalSSLHandshakeError
> added a new member with a different name and used it in webrtc code.
> After this change do two more follow up CLs to completely remove the old code
> from google3.
>
> Original change's description:
> > Replace sigslot usages with robocaller library.
> >
> > - Replace all the top level signals from jsep_transport_controller.
> > - There are still sigslot usages in this file so keep the inheritance
> >   and that is the reason for not having a binary size gain in this CL.
> >
> > Bug: webrtc:11943
> > Change-Id: I249d3b9710783aef70ba273e082ceeafe3056898
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185540
> > Commit-Queue: Lahiru Ginnaliya Gamathige <glahiru@webrtc.org>
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#32321}
>
> Bug: webrtc:11943
> Change-Id: Ia07394ee395f94836f6b576c3a97d119a7678e1a
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186946
> Commit-Queue: Lahiru Ginnaliya Gamathige <glahiru@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32359}

TBR=mbonadei@webrtc.org,kwiberg@webrtc.org,glahiru@webrtc.org

Change-Id: I6bce1775d10758ac4a9d05b855f473dd70bd9815
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11943
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187487
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32372}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants