写点什么

啃论文俱乐部——移植 speexdsp 到 OpenHarmony 标准系统①

作者:离北况归
  • 2022-10-12
    江苏
  • 本文字数:19133 字

    阅读完需:约 63 分钟

  • 大家好!我来自南京,在 OpenHarmony 成长计划啃论文俱乐部,与华为、软通动力、润和软件、拓维信息、深开鸿等公司一起,学习和研究操作系统技术从今年 1 月 11 日加入 OpenHarmony 俱乐部已经有接近 8 个月时间了。笔者一直在思考啃论文给我带来了些什么,通过啃论文能为 OpenHarmony 做些什么。笔者利用大二升大三暑假两个月时间移植了 Speexdsp 这个三方库到 OpenHarmony 标准系统,而关于前面的问题我似乎找到了答案,现将啃论文和三方库移植分享经验如下:

由于想要分享的内容较多,为避免观众姥爷们失去看下去的耐心,分享将以连载的方式进行。

本期为移植speexdsp到OpenHarmony标准系统的第①期,主要内容如下:


Speexdsp

提到 Speexdsp 不得不先提到开源语音编解码器Speex



如下是 ACM Surveys 中收录的标题为《Survey on Application-Layer Mechanisms for Speech Quality Adaptation in VoIP》综述中的一张图表。


  • 它总结了一些常用的可变比特率编解码器,并且做了性能方面的比较。

  • 其中唯一 Open-source 开源的两个编解码器之一就是 speex。




  • 2007 年 12 月 11 日 Speex1.2beta3 中首次将 Speex 中所有非编解码器组件(预处理器、回声消除、抖动缓冲区)都已移至新的 libspeexdsp 中。

  • 2014 年 12 月 6 日推出的 Speex 1.2rc2 和 SpeexDSP1.2rc2 正式将 speex 编解码器库和 speexDSP 库拆分为单独的源代码。

Speexdsp 功能

预处理器

预处理器被设计为在运行编码器之前在音频上使用。预处理器提供三个主要功能:


  • 噪声抑制

  • 自动增益控制(AGC)

  • 语音活动检测(VAD)

自适应抖动缓冲区

  • 当通过 UDP 或 RTP 传输语音(或任何相关内容)时,包可能会丢失,以不同的延迟到达,甚至乱序。

  • 抖动缓冲区的目的是重新排序数据包,并缓冲足够长的时间,以便它们可以被发送以进行解码。

声学回声消除器

回声消除是为了提高远端质量


  • 在任何免提通信系统中,远端语音通过本地扬声器播放。音频在房间内传播,并被麦克风捕获。如果从麦克风捕获的音频被直接发送到远程端,那么用户就会听到远端语音的回声。声学回声消除器设计用于在声学回声发送到远端之前消除它。

重采样器

这个重采样器可以用于在任意两个速率之间进行转换(比率必须是有理数),并且可以控制质量/复杂性的权衡。


  • 重采样器在某些情况下将音频从一个采样率转换到另一个采样率。

  • 它可以用于混合具有不同采样率的流、用于支持声卡不支持的采样率、用于转码等。

Speexdsp 移植到 OpenHarmony 标准系统

OpenHarmony 三方库主要是基于标准 Linux 系统的 c/c++ 开源库,所以三方库的移植工作,首先是在标准 Linux 系统搭建环境、编译与验证,然后将三方库的编译加入到 OpenHarmony 工程的构建中。


三方库移植的主要开发步骤如下:


  1. 在标准 Linux 系统下载三方库源码,搭建开发环境,编译整个源码工程;

  2. 分析在标准 Linux 系统的编译过程文件,提取编译需要的源文件、编译依赖等信息;

  3. 根据上一步分析结果,编写 gn 文件,将三方库加入到 OpenHarmony 的编译体系;

  4. 验证编译结果,在 OpenHarmony 的 out 目录是否生成目标库;

  5. 测试 demo/测试单元用例执行。

一、下载源码

  • 下载三方库源码时,优先使用最新版,不要下载 master 分支,下载最新的版本分支。移植 speexdsp 下载的是1.2.1版本。


Speexdsp 源码下载地址:https://github.com/xiph/speexdsp


二、搭建开发环境,生成 Makefile 编译构建 speexdsp。

  • 不同的原生三方库提供的编译方式不相同,根据原生三方库的 readme 文件或者 manual 用户手册可以知道该如何编译


Speexdsp 在 linux 下的编译安装,在 linux 终端输入如下语句:


  • 安装 make 工具。


sudo apt-get install make
复制代码


  • 安装 autoAutotools 工具


sudo apt-get install autoconf automake libtool
复制代码


GNU Autotools 框架包括三个主要的包:Autoconf,Automake,和 Libtool。


GNU 软件的构建过程,一般来说, 包含三个步骤:tar xfv xxx.tar.gz./configuremakemake install 该过程一般依赖两个文件, configure 和 Makefile 文件。

  • Autoconf/Automake 就是一套用于自动构建 configure 脚本和 Makefile 文件的工具。


  • 一般使用 Makefile.am 构建的三方库,原生库中存在 autogen.sh,configure.ac 文件。由 makefile.am 自动生成 makefile。


./autogen.sh
复制代码


  • ./autogen.sh 之后我们可以运行./configure --help 查看 configure 配置


./configure --help
复制代码


jiajiahao@ubuntu:~/Desktop/SpeexDSP-1.2.1$ ./configure --help`configure' configures speexdsp 1.2.1 to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them asVAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print `checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for `--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or `..']
Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [/usr/local] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX]
By default, `make install' will install all the files in`/usr/local/bin', `/usr/local/lib' etc. You can specifyan installation prefix other than `/usr/local' using `--prefix',for instance `--prefix=$HOME'.
For better control, use the options below.
Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/speexdsp] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR]
Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names
System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD]
Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --disable-maintainer-mode disable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-libtool-lock avoid locking (might break parallel builds) --enable-sse Enable SSE support --enable-neon Enable NEON support --enable-fixed-point Compile as fixed-point --disable-float-api Disable the floating-point API --disable-examples Do not build example programs, only the library --enable-arm4-asm Make use of ARM4 assembly optimizations --enable-arm5e-asm Make use of ARM5E assembly optimizations --enable-blackfin-asm Make use of Blackfin assembly optimizations --enable-fixed-point-debug Debug fixed-point implementation --enable-resample-full-sinc-table Resample full SINC table (no interpolation) --enable-ti-c55x Enable support for TI C55X DSP
Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-fft=choice use an alternate FFT implementation. The available choices are kiss (default fixed point), smallft (default floating point), gpl-fftw3 and proprietary-intel-mkl
Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> LIBS libraries to pass to the linker, e.g. -l<library> CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> LT_SYS_LIBRARY_PATH User-defined run-time library search path. CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path FFT_CFLAGS C compiler flags for FFT, overriding pkg-config FFT_LIBS linker flags for FFT, overriding pkg-config
Use these variables to override the choices made by `configure' or to helpit to find libraries and programs with nonstandard names/locations.
Report bugs to <speex-dev@xiph.org>.
复制代码


  • 在下载到 linux 中的 speexdsp 中新建 build 目录


mkdir build
复制代码


  • 运行 configure 命令来生成 Makefile。


./configure --prefix=/XXX/speexdsp/build -disable-sse
复制代码


SSE 是一个 X86 平台的指令集,所以要移植 speexdsp 到 OpenHarmony 过程,configure 时要 disable 掉 sse 这个配置。否则在加入 OpenHarmony 编译体系后生成 libspeexdsp_share.z.so 和在 ohos 上执行的可执行文件编译过程中会报错。

在 linux 上生成 speexdsp 的 so 动态链接库和.a 静态链接库

  • make 和 make install 后会生成 speexdsp 的.so 动态链接库和.a 静态链接库


makemake install
复制代码


编译安装后 build 目录结构如下:



整个编译安装过程终端输出 log 如下:


jiajiahao@ubuntu:~/Desktop/speexdsp-SpeexDSP-1.2.1$ ./autogen.shUpdating build configuration files, please wait....libtoolize: putting auxiliary files in '.'.libtoolize: copying file './ltmain.sh'libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.libtoolize: copying file 'm4/libtool.m4'libtoolize: copying file 'm4/ltoptions.m4'libtoolize: copying file 'm4/ltsugar.m4'libtoolize: copying file 'm4/ltversion.m4'libtoolize: copying file 'm4/lt~obsolete.m4'configure.ac:26: installing './compile'configure.ac:24: installing './config.guess'configure.ac:24: installing './config.sub'configure.ac:21: installing './install-sh'configure.ac:21: installing './missing'libspeexdsp/Makefile.am: installing './depcomp'jiajiahao@ubuntu:~/Desktop/speexdsp-SpeexDSP-1.2.1$ mkdir buildjiajiahao@ubuntu:~/Desktop/speexdsp-SpeexDSP-1.2.1$ ./configure --prefix=/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build -disable-ssechecking whether make supports nested variables... yeschecking for a BSD-compatible install... /usr/bin/install -cchecking whether build environment is sane... yeschecking for a thread-safe mkdir -p... /usr/bin/mkdir -pchecking for gawk... nochecking for mawk... mawkchecking whether make sets $(MAKE)... yeschecking whether to enable maintainer-specific portions of Makefiles... yeschecking build system type... x86_64-pc-linux-gnuchecking host system type... x86_64-pc-linux-gnuchecking how to print strings... printfchecking whether make supports the include directive... yes (GNU style)checking for gcc... gccchecking whether the C compiler works... yeschecking for C compiler default output file name... a.outchecking for suffix of executables... checking whether we are cross compiling... nochecking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether gcc accepts -g... yeschecking for gcc option to accept ISO C89... none neededchecking whether gcc understands -c and -o together... yeschecking dependency style of gcc... gcc3checking for a sed that does not truncate output... /usr/bin/sedchecking for grep that handles long lines and -e... /usr/bin/grepchecking for egrep... /usr/bin/grep -Echecking for fgrep... /usr/bin/grep -Fchecking for ld used by gcc... /usr/bin/ldchecking if the linker (/usr/bin/ld) is GNU ld... yeschecking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -Bchecking the name lister (/usr/bin/nm -B) interface... BSD nmchecking whether ln -s works... yeschecking the maximum length of command line arguments... 1572864checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noopchecking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noopchecking for /usr/bin/ld option to reload object files... -rchecking for objdump... objdumpchecking how to recognize dependent libraries... pass_allchecking for dlltool... dlltoolchecking how to associate runtime and link libraries... printf %s\nchecking for ar... archecking for archiver @FILE support... @checking for strip... stripchecking for ranlib... ranlibchecking command to parse /usr/bin/nm -B output from gcc object... okchecking for sysroot... nochecking for a working dd... /usr/bin/ddchecking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1checking for mt... mtchecking if mt is a manifest tool... nochecking how to run the C preprocessor... gcc -Echecking for ANSI C header files... yeschecking for sys/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking for dlfcn.h... yeschecking for objdir... .libschecking if gcc supports -fno-rtti -fno-exceptions... nochecking for gcc option to produce PIC... -fPIC -DPICchecking if gcc PIC flag -fPIC -DPIC works... yeschecking if gcc static flag -static works... yeschecking if gcc supports -c -o file.o... yeschecking if gcc supports -c -o file.o... (cached) yeschecking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yeschecking whether -lc should be explicitly linked in... nochecking dynamic linker characteristics... GNU/Linux ld.sochecking how to hardcode library paths into programs... immediatechecking whether stripping libraries is possible... yeschecking if libtool supports shared libraries... yeschecking whether to build shared libraries... yeschecking whether to build static libraries... yeschecking whether byte ordering is bigendian... nochecking for an ANSI C-conforming const... yeschecking for inline... inlinechecking for C/C++ restrict keyword... __restrictchecking for C99 variable-size arrays... yeschecking for SSE in current arch/CFLAGS... yeschecking for SSE2 in current arch/CFLAGS... yeschecking for NEON in current arch/CFLAGS... nochecking for ELF visibility... yeschecking sys/soundcard.h usability... yeschecking sys/soundcard.h presence... yeschecking for sys/soundcard.h... yeschecking sys/audioio.h usability... nochecking sys/audioio.h presence... nochecking for sys/audioio.h... nochecking for cos in -lm... yeschecking for pkg-config... /usr/bin/pkg-configchecking pkg-config is at least version 0.9.0... yeschecking size of int16_t... 2checking size of uint16_t... 2checking size of u_int16_t... 2checking size of int32_t... 4checking size of uint32_t... 4checking size of u_int32_t... 4checking size of short... 2checking size of int... 4checking size of long... 8checking that generated files are newer than configure... doneconfigure: creating ./config.statusconfig.status: creating Makefileconfig.status: creating libspeexdsp/Makefileconfig.status: creating doc/Makefileconfig.status: creating SpeexDSP.specconfig.status: creating include/Makefileconfig.status: creating include/speex/Makefileconfig.status: creating speexdsp.pcconfig.status: creating win32/Makefileconfig.status: creating win32/libspeexdsp/Makefileconfig.status: creating symbian/Makefileconfig.status: creating win32/VS2003/Makefileconfig.status: creating win32/VS2003/libspeexdsp/Makefileconfig.status: creating win32/VS2003/tests/Makefileconfig.status: creating win32/VS2005/Makefileconfig.status: creating win32/VS2005/libspeexdsp/Makefileconfig.status: creating win32/VS2005/tests/Makefileconfig.status: creating win32/VS2008/Makefileconfig.status: creating win32/VS2008/libspeexdsp/Makefileconfig.status: creating win32/VS2008/tests/Makefileconfig.status: creating include/speex/speexdsp_config_types.hconfig.status: creating ti/Makefileconfig.status: creating ti/speex_C54_test/Makefileconfig.status: creating ti/speex_C55_test/Makefileconfig.status: creating ti/speex_C64_test/Makefileconfig.status: creating config.hconfig.status: executing depfiles commandsconfig.status: executing libtool commandsType "make; make install" to compile and install Speexjiajiahao@ubuntu:~/Desktop/speexdsp-SpeexDSP-1.2.1$ makemake  all-recursivemake[1]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1”Making all in libspeexdspmake[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/libspeexdsp”  CC       preprocess.lo  CC       jitter.lo  CC       mdf.lo  CC       fftwrap.lo  CC       filterbank.lo  CC       resample.lo  CC       buffer.lo  CC       scal.lo  CC       smallft.lo  CCLD     libspeexdsp.lamake[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/libspeexdsp”Making all in includemake[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/include”Making all in speexmake[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/include/speex”make[3]: 对“all”无需做任何事。make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/include/speex”make[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/include”make[3]: 对“all-am”无需做任何事。make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/include”make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/include”Making all in docmake[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/doc”make[2]: 对“all”无需做任何事。make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/doc”Making all in win32make[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32”Making all in libspeexdspmake[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/libspeexdsp”make[3]: 对“all”无需做任何事。make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/libspeexdsp”Making all in VS2003make[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003”Making all in libspeexdspmake[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003/libspeexdsp”make[4]: 对“all”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003/libspeexdsp”Making all in testsmake[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003/tests”make[4]: 对“all”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003/tests”make[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003”make[4]: 对“all-am”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003”make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003”Making all in VS2005make[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005”Making all in libspeexdspmake[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005/libspeexdsp”make[4]: 对“all”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005/libspeexdsp”Making all in testsmake[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005/tests”make[4]: 对“all”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005/tests”make[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005”make[4]: 对“all-am”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005”make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005”Making all in VS2008make[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008”Making all in libspeexdspmake[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008/libspeexdsp”make[4]: 对“all”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008/libspeexdsp”Making all in testsmake[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008/tests”make[4]: 对“all”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008/tests”make[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008”make[4]: 对“all-am”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008”make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008”make[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32”make[3]: 对“all-am”无需做任何事。make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32”make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32”Making all in symbianmake[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/symbian”make[2]: 对“all”无需做任何事。make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/symbian”Making all in timake[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti”Making all in speex_C54_testmake[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C54_test”make[3]: 对“all”无需做任何事。make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C54_test”Making all in speex_C55_testmake[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C55_test”make[3]: 对“all”无需做任何事。make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C55_test”Making all in speex_C64_testmake[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C64_test”make[3]: 对“all”无需做任何事。make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C64_test”make[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti”make[3]: 对“all-am”无需做任何事。make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti”make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti”make[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1”make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1”make[1]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1”jiajiahao@ubuntu:~/Desktop/speexdsp-SpeexDSP-1.2.1$ make installMaking install in libspeexdspmake[1]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/libspeexdsp”make[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/libspeexdsp” /usr/bin/mkdir -p '/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/lib' /bin/sh ../libtool   --mode=install /usr/bin/install -c   libspeexdsp.la '/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/lib'libtool: install: /usr/bin/install -c .libs/libspeexdsp.so.1.5.2 /home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/lib/libspeexdsp.so.1.5.2libtool: install: (cd /home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/lib && { ln -s -f libspeexdsp.so.1.5.2 libspeexdsp.so.1 || { rm -f libspeexdsp.so.1 && ln -s libspeexdsp.so.1.5.2 libspeexdsp.so.1; }; })libtool: install: (cd /home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/lib && { ln -s -f libspeexdsp.so.1.5.2 libspeexdsp.so || { rm -f libspeexdsp.so && ln -s libspeexdsp.so.1.5.2 libspeexdsp.so; }; })libtool: install: /usr/bin/install -c .libs/libspeexdsp.lai /home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/lib/libspeexdsp.lalibtool: install: /usr/bin/install -c .libs/libspeexdsp.a /home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/lib/libspeexdsp.alibtool: install: chmod 644 /home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/lib/libspeexdsp.alibtool: install: ranlib /home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/lib/libspeexdsp.alibtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin" ldconfig -n /home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/lib----------------------------------------------------------------------Libraries have been installed in:   /home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/lib
If you ever happen to want to link against installed librariesin a given directory, LIBDIR, you must either use libtool, andspecify the full pathname of the library, or use the '-LLIBDIR'flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries formore information, such as the ld(1) and ld.so(8) manual pages.----------------------------------------------------------------------make[2]: 对“install-data-am”无需做任何事。make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/libspeexdsp”make[1]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/libspeexdsp”Making install in includemake[1]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/include”Making install in speexmake[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/include/speex”make[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/include/speex”make[3]: 对“install-exec-am”无需做任何事。 /usr/bin/mkdir -p '/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/include/speex' /usr/bin/install -c -m 644 speexdsp_config_types.h '/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/include/speex' /usr/bin/mkdir -p '/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/include/speex' /usr/bin/install -c -m 644 speex_echo.h speex_jitter.h speex_preprocess.h speex_resampler.h speexdsp_types.h '/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/include/speex'make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/include/speex”make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/include/speex”make[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/include”make[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/include”make[3]: 对“install-exec-am”无需做任何事。make[3]: 对“install-data-am”无需做任何事。make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/include”make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/include”make[1]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/include”Making install in docmake[1]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/doc”make[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/doc”make[2]: 对“install-exec-am”无需做任何事。 /usr/bin/mkdir -p '/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/share/doc/speexdsp' /usr/bin/install -c -m 644 manual.pdf '/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/share/doc/speexdsp'make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/doc”make[1]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/doc”Making install in win32make[1]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32”Making install in libspeexdspmake[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/libspeexdsp”make[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/libspeexdsp”make[3]: 对“install-exec-am”无需做任何事。make[3]: 对“install-data-am”无需做任何事。make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/libspeexdsp”make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/libspeexdsp”Making install in VS2003make[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003”Making install in libspeexdspmake[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003/libspeexdsp”make[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003/libspeexdsp”make[4]: 对“install-exec-am”无需做任何事。make[4]: 对“install-data-am”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003/libspeexdsp”make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003/libspeexdsp”Making install in testsmake[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003/tests”make[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003/tests”make[4]: 对“install-exec-am”无需做任何事。make[4]: 对“install-data-am”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003/tests”make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003/tests”make[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003”make[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003”make[4]: 对“install-exec-am”无需做任何事。make[4]: 对“install-data-am”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003”make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003”make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2003”Making install in VS2005make[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005”Making install in libspeexdspmake[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005/libspeexdsp”make[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005/libspeexdsp”make[4]: 对“install-exec-am”无需做任何事。make[4]: 对“install-data-am”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005/libspeexdsp”make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005/libspeexdsp”Making install in testsmake[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005/tests”make[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005/tests”make[4]: 对“install-exec-am”无需做任何事。make[4]: 对“install-data-am”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005/tests”make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005/tests”make[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005”make[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005”make[4]: 对“install-exec-am”无需做任何事。make[4]: 对“install-data-am”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005”make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005”make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2005”Making install in VS2008make[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008”Making install in libspeexdspmake[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008/libspeexdsp”make[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008/libspeexdsp”make[4]: 对“install-exec-am”无需做任何事。make[4]: 对“install-data-am”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008/libspeexdsp”make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008/libspeexdsp”Making install in testsmake[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008/tests”make[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008/tests”make[4]: 对“install-exec-am”无需做任何事。make[4]: 对“install-data-am”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008/tests”make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008/tests”make[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008”make[4]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008”make[4]: 对“install-exec-am”无需做任何事。make[4]: 对“install-data-am”无需做任何事。make[4]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008”make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008”make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32/VS2008”make[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32”make[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32”make[3]: 对“install-exec-am”无需做任何事。make[3]: 对“install-data-am”无需做任何事。make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32”make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32”make[1]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/win32”Making install in symbianmake[1]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/symbian”make[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/symbian”make[2]: 对“install-exec-am”无需做任何事。make[2]: 对“install-data-am”无需做任何事。make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/symbian”make[1]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/symbian”Making install in timake[1]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti”Making install in speex_C54_testmake[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C54_test”make[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C54_test”make[3]: 对“install-exec-am”无需做任何事。make[3]: 对“install-data-am”无需做任何事。make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C54_test”make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C54_test”Making install in speex_C55_testmake[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C55_test”make[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C55_test”make[3]: 对“install-exec-am”无需做任何事。make[3]: 对“install-data-am”无需做任何事。make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C55_test”make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C55_test”Making install in speex_C64_testmake[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C64_test”make[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C64_test”make[3]: 对“install-exec-am”无需做任何事。make[3]: 对“install-data-am”无需做任何事。make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C64_test”make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti/speex_C64_test”make[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti”make[3]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti”make[3]: 对“install-exec-am”无需做任何事。make[3]: 对“install-data-am”无需做任何事。make[3]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti”make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti”make[1]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/ti”make[1]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1”make[2]: 进入目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1”make[2]: 对“install-exec-am”无需做任何事。 /usr/bin/mkdir -p '/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/lib/pkgconfig' /usr/bin/install -c -m 644 speexdsp.pc '/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/lib/pkgconfig'make[2]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1”make[1]: 离开目录“/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1”
复制代码

生成在 linux 上测试 speexdsp 功能用的可执行文件

编译生成出在 linux 上测试 speexdsp 功能用的可执行文件,目的是为了分析 speexdsp 在 ohos 编译体系生成动态链接库后进功能测试的逻辑


阅读 speexdsp 用户手册,测试 speexdsp 功能的源文件分别为:


  • testdenoise.c

  • testecho.c

  • testjitter.c

  • testresample.c

  • testresample2.c


它们均位于 speexdsp 下的 libspeexdsp。需要把它们编译为可运行的执行文件,通过阅读用户手册可以知道在编译时需要添加-lspeexdsp 和-lm


以编译 testresample 可执行文件为例,编译执行语句如下:在 speexdsp 目录 libspeexdsp 目录下打开终端输入如下语句


gcc testjitter.c -L /home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/build/lib -lspeexdsp -o testjitter -I /home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1/include -lm
复制代码


  • 其中/home/jiajiahao/Desktop/speexdsp-SpeexDSP-1.2.1 为笔者放置 speexdsp 原生库 linux 下的绝对路径。

  • 链接动态链接库编译可执行文件,gcc 后面是测试用的源文件。-L 后指定 so 库所在的文件夹,-l+so 库的名字(出去 lib 和后缀)。-o 后面是可执行文件的名字,-I 后面是测试用的源文件要用到的头文件所在的地址。


编译出全部测试功能用的可执行文件如下:



发布于: 刚刚阅读数: 4
用户头像

离北况归

关注

还未添加个人签名 2022-03-26 加入

OpenHarmony啃论文俱乐部PIMF团队。 位于南京一学生,可私信。

评论

发布
暂无评论
啃论文俱乐部——移植speexdsp到OpenHarmony标准系统①_OpenHarmony_离北况归_InfoQ写作社区