Closed aleh4d closed 2 years ago
Your machine probably doesn't support avx2, so try removing/commenting this part in third_party/build/webrtc_aec3/os-auto.mak
:
export WEBRTC_AEC3_SRC += \
common_audio/resampler/sinc_resampler_avx2.o \
modules/audio_processing/aec3/adaptive_fir_filter_erl_avx2.o \
modules/audio_processing/aec3/adaptive_fir_filter_avx2.o \
modules/audio_processing/aec3/fft_data_avx2.o \
modules/audio_processing/aec3/matched_filter_avx2.o \
modules/audio_processing/aec3/vector_math_avx2.o \
modules/audio_processing/agc2/rnn_vad/vector_math_avx2.o
WEBRTC_AEC3_OTHER_CFLAGS += -mfma
If it works, then I can create a patch to automatically detect this.
Can not find file "third_party/build/webrtc_aec3/os-auto.mak" looks like the file does not exist:
ls -la third_party/build/webrtc_aec3/ total 28 drwxr-xr-x 2 compulab compulab 4096 Jul 15 08:05 . drwxr-xr-x 14 compulab compulab 4096 Jul 15 07:59 .. -rw-r--r-- 1 compulab compulab 7104 Jul 15 08:00 .libwebrtc-aec3-aarch64-unknown-linux-gnu.depend -rw-r--r-- 1 compulab compulab 9141 Jul 13 09:36 Makefile
It is Yocto linux that I am using - it is Debian 10 bases, but Arm64, cant that be the reason? What to try next?
Sorry, it should be third_party/build/os-auto.mak
there is the file: "third_party/build/os-auto.mak.in" so it has "mak.in" extension, right?
Thank you for support, commented the lines that you specified in the file is the file: "third_party/build/os-auto.mak.in" now make dep worked only with 2 errors:
../../webrtc/src/webrtc//modules/audio_processing/aec/aec_core_sse2.c:15:10: fatal error: emmintrin.h: No such file or directory
^~~~~~~~~~~~~
compilation terminated. ../../webrtc/src/webrtc//modules/audio_processing/aec/aec_rdft_sse2.c:13:10: fatal error: emmintrin.h: No such file or directory
^~~~~~~~~~~~~
does that mean that WebRTC was not found? It will be without echo cancellation because of that?
Just realised that your machine's architecture is aarch64
.
So please try the attached patch instead:
aconfigure_patch.txt
os-auto.mak
unzipped clean version, applied the patch, then called configure: ./configure --disable-video --enable-libwebrtc-aec3 and still got the following errors on "make dep"
../../webrtc/src/webrtc//modules/audio_processing/aec/aec_core_sse2.c:15:10: fatal error: emmintrin.h: No such file or directory
^~~~~~~~~~~~~
compilation terminated. ../../webrtc/src/webrtc//modules/audio_processing/aec/aec_rdft_sse2.c:13:10: fatal error: emmintrin.h: No such file or directory
^~~~~~~~~~~~~
I am compiling with WebRTC for echo cancellation, does that mean that I should download and compile WebRTC first? Need instruction how compile with WebRTC, and whether it needs to download WebRTC separately, or part of it is already included in PJSip project?
You can try this updated patch: aconfigure_patch2.txt
Alternatively, you can disable WebRTC as mentioned in the other issue #2752.
Downloaded fresh copy of master, When applying patch got following error: (so patch was partially applied) result of patch application:
//***** compulab@iot-gate-imx8:~/pjsip_build_3/pjproject-master$ patch < aconfigure_patch2.txt patching file aconfigure Hunk #1 succeeded at 9243 (offset 3 lines). Hunk #2 succeeded at 9357 (offset 3 lines). Hunk #3 FAILED at 9380. 1 out of 3 hunks FAILED -- saving rejects to file aconfigure.rej patching file aconfigure.ac Hunk #1 succeeded at 2206 (offset 3 lines). Hunk #2 succeeded at 2291 (offset 3 lines).
compulab@iot-gate-imx8:~/pjsip_build_3/pjproject-master$ cat aconfigure.rej --- aconfigure +++ aconfigure @@ -9380,7 +9380,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu $as_echo "Checking if libwebrtc-aec3 is enabled...no" >&6; } fi
- else ac_no_webrtc_aec3=1 $as_echo "#define PJMEDIA_HAS_LIBWEBRTC_AEC3 0" >>confdefs.h
//*****
then I run:
./configure --disable-video --enable-libwebrtc-aec3 make
make got error:
g++ -c -Wall -DPJ_AUTOCONF=1 -O2 -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -I. -I../../webrtc_aec3/src -I../../../pjlib/include -fexceptions -DWEBRTC_ARCH_ARM64 -DWEBRTC_APM_DEBUG_DUMP=0 -DWEBRTC_POSIX=1 -DWEBRTC_HAS_NEON -DPJ_AUTOCONF=1 -g -O2 -std=c++17 -Wall -DPJ_AUTOCONF=1 -O2 -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -I. -I../../webrtc_aec3/src -I../../../pjlib/include \
-o output/libwebrtc-aec3-aarch64-unknown-linux-gnu/rtc_base/platform_thread_types.o \
../../webrtc_aec3/src//rtc_base/platform_thread_types.cc
../../webrtc_aec3/src//rtc_base/platform_thread_types.cc: In function 'rtc::PlatformThreadId rtc::CurrentThreadId()':
../../webrtc_aec3/src//rtc_base/platform_thread_types.cc:46:59: error: invalid cast from type 'pthread_t' {aka 'long unsigned int'} to type 'rtc::PlatformThreadId' {aka 'int'}
return reinterpret_cast
make had also some warnings:
../../webrtc_aec3/src//modules/audio_processing/agc2/adaptive_agc.cc: In function 'std::unique_ptr
In file included from ../../webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/rnn_fc.h:19,
from ../../webrtc_aec3/src//modules/audio_processing/agc2/rnn_vad/rnn_fc.cc:14:
../../webrtc_aec3/src/api/function_view.h: In instantiation of 'rtc::FunctionView<RetT(ArgT ...)>::FunctionView(F&&) [with F = float (&)(float); typename std::enable_if<std::is_function<typename std::remove_pointer<typename std::remove_reference<_SrcTuple>::type>::type>::value>::type ^~~~~~~~~~~~~~~
../../webrtc_aec3/src/api/function_view.h:79:17: warning: the compiler can assume that the address of 'f' will never be NULL [-Waddress]
../../webrtc_aec3/src//modules/audio_processing/agc2/rnn_vad/rnn_fc.cc: In function 'rtc::FunctionView<float(float)> webrtc::rnn_vad::{anonymous}::GetActivationFunction(webrtc::rnn_vad::ActivationFunction)':
../../webrtc_aec3/src//modules/audio_processing/agc2/rnn_vad/rnn_fc.cc:64:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
In file included from ../../webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/rnn_fc.h:19,
from ../../webrtc_aec3/src//modules/audio_processing/agc2/rnn_vad/rnn_fc.cc:14:
../../webrtc_aec3/src/api/function_view.h: In constructor 'rtc::FunctionView<RetT(ArgT ...)>::FunctionView(F&&) [with F = float (&)(float); typename std::enable_if<std::is_function<typename std::remove_pointer<typename std::remove_reference<_SrcTuple>::type>::type>::value>::type^~~~~~~~~~~~~~~
}
I can confirm that manually apply the patch (adding aarch64 checks) can fix the compilation issue on arm64 machines. (At least on mine) Maybe add this patch to master branch?
Describe the bug
I tried to compile latest master sours from repository on Yocto (Debian 10) Linux to get support for WebRTC AEC3 (as describe in https://github.com/pjsip/pjproject/pull/2722)
On 'make dep' step Got Error "g++: error: unrecognized command line option '-mfma'"
Steps to reproduce
steps to reproduce:
wget https://github.com/pjsip/pjproject/archive/refs/heads/master.zip
unzip -a master.zip cd pjproject-master cp pjlib/include/pj/config_site_sample.h pjlib/include/pj/config_site.h ./configure --disable-video --enable-libwebrtc-aec3 make dep
PJSIP version
latest sources from repositary
Context
Yocto (Debian 10) Linux
Log, call stack, etc