crow-misia / libmediasoup-android

libmediasoupclient for Android
Apache License 2.0
9 stars 9 forks source link

A question regarding the Github Action to build libwebrtc.aar and .a #16

Closed neilyoung closed 1 year ago

neilyoung commented 1 year ago

I like the way how you automated the build of the libwebrtc binaries. I cloned your project in order to follow.

Would you mind to explain to me the logic of this file? https://github.com/neilyoung/libwebrtc-bin/blob/m114/VERSION

I mean I cannot find any commit e46e37b6f831763aceaf5f5bd081a47cbd562890 in the libwebrtc project and I would also like to understand, how you are deriving WEBRTC_VERSION and WEBRTC_SEMANTIC_VERSION.

I'm especially interested to build a M102. A pointer would be highly appreciated.

Thanks in advance

crow-misia commented 1 year ago

This is the commit. https://webrtc.googlesource.com/src.git/+log/refs/branch-heads/5735 https://webrtc.googlesource.com/src.git/+/e46e37b6f831763aceaf5f5bd081a47cbd562890

You should see this page. https://chromiumdash.appspot.com/branches

neilyoung commented 1 year ago

Ah, sh... For some reason I was on the Chromium repo.

Thanks, yes there it ist. But how do you build

WEBRTC_VERSION=m114.5735@{#3} WEBRTC_SEMANTIC_VERSION=114.5735.3.0

EDIT: Or better asked: How do you generate these strings? What is the input?

neilyoung commented 1 year ago

I was trying to build an older release (your commit 21b20e35a66e4f8607f1d8a5f77e9a93227bd059, that looked as if it would have M102 as target). But I failed with all targets: Always ninja missing.

depot_tools/ninja.py: Could not find Ninja in the third_party of the current project, nor in your PATH.
Please take one of the following actions to install Ninja:
- If your project has DEPS, add a CIPD Ninja dependency to DEPS.
- Otherwise, add Ninja to your PATH *after* depot_tools.
make[2]: *** [Makefile:41: build] Error 1
make[2]: Leaving directory '/root/build/linux-arm'
make[1]: *** [Makefile:76: linux-arm.build-nofetch] Error 2
make[1]: Leaving directory '/root/build'
make: *** [Makefile:79: linux-arm] Error 2
make: *** [Makefile:80: linux-arm] Error 2
make: Leaving directory '/home/runner/work/libwebrtc-bin/libwebrtc-bin/docker'
Error: Process completed with exit code 2.

Wouldn't that have to be installed as separate requirement? Didn't find any hint.

neilyoung commented 1 year ago

I added a dependency for ninja-build in all four Dockerfiles.. Seems to work.


RUN \
  apt update \
  && apt upgrade -y \
  && apt install -y \
    build-essential \
    curl \
    git \
    ninja-build \
    libncurses5 \
    lsb-release \
    python \
    pkg-config \
    rsync
neilyoung commented 1 year ago

The addition of ninja-build did help definitely, but in the end it fails after about 90 minutes with:

FAILED: obj/third_party/ffmpeg/ffmpeg_internal/autorename_libavutil_arm_cpu.o 
../../../webrtc/src/third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF obj/third_party/ffmpeg/ffmpeg_internal/autorename_libavutil_arm_cpu.o.d -DHAVE_AV_CONFIG_H -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -DFFMPEG_CONFIGURATION=NULL -D_ISOC99_SOURCE -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DANDROID -DHAVE_SYS_UIO_H -DANDROID_NDK_VERSION_ROLL=r23_1 -DCR_CLANG_REVISION=\"llvmorg-15-init-7040-g50de659a-3\" -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -DCR_LIBCXX_REVISION=79a2e924d96e2fc1e4b937c42efd08898fa472d7 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DOPUS_FIXED_POINT -I../../../webrtc/src/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon -I../../../webrtc/src/third_party/ffmpeg -I../../../webrtc/src -Igen -I../../../webrtc/src/buildtools/third_party/libc++ -I../../../webrtc/src/third_party/opus/src/include -fPIC -Wno-deprecated-declarations -fomit-frame-pointer -std=c99 -pthread -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../../webrtc/src/tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -ffp-contract=off -fcomplete-member-pointers -ffunction-sections -fno-short-enums --target=arm-linux-androideabi16 -march=armv7-a -mfloat-abi=softfp -mtune=generic-armv7-a -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes -mfpu=neon -mthumb -gdwarf-4 -g1 -gdwarf-aranges -fdebug-info-for-profiling -fvisibility=hidden -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang raw-ptr-template-as-trivial-member -Xclang -plugin-arg-find-bad-constructs -Xclang use-classify-type -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Werror -Wall -Wno-unused-variable -Wno-c++11-narrowing -Wno-unused-but-set-variable -Wno-misleading-indentation -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -Wno-unqualified-std-cast-call -Wmax-tokens -Wno-incompatible-pointer-types -Wno-absolute-value -Wno-deprecated-declarations -Wno-incompatible-pointer-types -Wno-logical-op-parentheses -Wno-parentheses -Wno-pointer-sign -Wno-switch -Wno-unused-label -Wno-unused-variable -Wno-string-conversion -Wno-sometimes-uninitialized -Wno-unguarded-availability -Wno-unused-function -Wno-constant-conversion -Wno-string-plus-int -Wno-tautological-constant-out-of-range-compare -Wno-implicit-int-float-conversion -Wno-inline-asm -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -std=c11 --sysroot=../../../webrtc/src/third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot -c ../../../webrtc/src/third_party/ffmpeg/libavutil/arm/autorename_libavutil_arm_cpu.c -o obj/third_party/ffmpeg/ffmpeg_internal/autorename_libavutil_arm_cpu.o
In file included from ../../../webrtc/src/third_party/ffmpeg/libavutil/arm/autorename_libavutil_arm_cpu.c:2:
../../../webrtc/src/third_party/ffmpeg/libavutil/arm/cpu.c:58:25: error: implicit declaration of function 'getauxval' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    unsigned long ret = getauxval(AT_HWCAP);
                        ^
../../../webrtc/src/third_party/ffmpeg/libavutil/arm/cpu.c:58:25: note: did you mean 'get_auxval'?
../../../webrtc/src/third_party/ffmpeg/libavutil/arm/cpu.c:55:12: note: 'get_auxval' declared here
static int get_auxval(uint32_t *hwcap)
           ^
1 error generated.
[3335/4373] CC obj/third_party/ffmpeg/ffmpeg_internal/tx_double.o
[3336/4373] CC obj/third_party/ffmpeg/ffmpeg_internal/tx_int32.o
ninja: build stopped: subcommand failed.
make[2]: *** [Makefile:78: build] Error 1
make[2]: Leaving directory '/root/build/android'
make[1]: *** [Makefile:76: android.build-nofetch] Error 2
make[1]: Leaving directory '/root/build'
make: *** [Makefile:79: android] Error 2
make: *** [Makefile:80: android] Error 2
make: Leaving directory '/home/runner/work/libwebrtc-bin/libwebrtc-bin/docker'
Error: Process completed with exit code 2.
cd /root/webrtc/src && gn gen /root/webrtc_build/static/armeabi-v7a --args='is_debug=false is_java_debug=false rtc_use_h264=true rtc_build_tools=false rtc_build_examples=false rtc_include_tests=false is_clang=true is_component_build=false rtc_enable_protobuf=false rtc_build_json=true use_rtti=true  target_os="android" target_cpu="arm" arm_version=7' && ninja -C /root/webrtc_build/static/armeabi-v7a && ninja -C /root/webrtc_build/static/armeabi-v7a native_api

I had made the same experience when attempting to compile M102 with rtc_use_h264=true manually.

neilyoung commented 1 year ago

Building M114 with rtc_use_h264=true works, but it is literally impossible (at least for me) to adjust libmediasoup to the changes of libwebrtc. Too far away, as it seems.

neilyoung commented 1 year ago

I was able to make the necessary changes to make it compile with M114. But it crashes onProduce.

crow-misia commented 1 year ago

I am not your support center and cannot set up a time to respond to your questions.

libmediasoup itself does not support m114, nor can I take the time to develop a patch.

neilyoung commented 1 year ago

I am not your support center and cannot set up a time to respond to your questions.

It wasn't meant like so, I just wanted to share the progress, I thought it would be in your interest. Sorry for bother

libmediasoup itself does not support m114, nor can I take the time to develop a patch.

Wrong. It does support M114. Meanwhile. I took the time to develop a patch.

Thanks