android jnlibvpx.so built with libvpx v1.15.2 using build.make.Android.mk

112 views
Skip to first unread message

ChongMeng Eng

unread,
Aug 20, 2025, 9:32:57 PMAug 20
to WebM Discussion
atalk-android is an open source project.
Please refer to aTalk project sub-dir jni/static_library_build/libvpx, and jni/vps for detail info on scripts used in the build.

# Use 22.1.7171670, seems to only compattible with libvpx build
NDK=/opt/android/android-sdk/ndk/22.1.7171670/

For all the previous aTalk releases, it uses "make install" (jni/static_library_build/libvpx,), it has no problem with the .so generation.

However when I try to use build.make.Android.mk ( jni/vps scipts), I encountered multiple problems as below:

1. Building of libvpx using build.make.Android.mk does not work
a. build.make.Android.mk info errors:
# comments in Android.mk is outdated i.e. sdk-path is invalid
# set APP_ABI e.g. "arm64-v8a" to match the --target passed to configure ??? TARGET use internal defined variables i.e. "arm64-android-gcc".
b. Require ENABLE_SHARED := 1 (not mentioned) for Android.mk to build with include $(BUILD_SHARED_LIBRARY) 

2. BUILD_PFX must be specified and exported during configure
3. make: *** No rule to make target 'vp8_rtcd.h', needed by 'vpx/vpx_config.c' etc...

During "make install" build it seems that these includes are created, but not when via Android.mk
Creating makefiles for armv7-android-gcc libs
[CREATE] vpx_scale_rtcd.h
[CREATE] vpx_dsp_rtcd.h
[CREATE] vp8_rtcd.h
[CREATE] vp9_rtcd.h

Any commnets, and helps will be appreciated.

James Zern

unread,
Aug 28, 2025, 6:17:47 PM (8 days ago) Aug 28
to webm-d...@webmproject.org
Hi,

On Wed, Aug 20, 2025 at 6:32 PM ChongMeng Eng <cmen...@gmail.com> wrote:
atalk-android is an open source project.
Please refer to aTalk project sub-dir jni/static_library_build/libvpx, and jni/vps for detail info on scripts used in the build.

# Use 22.1.7171670, seems to only compattible with libvpx build
NDK=/opt/android/android-sdk/ndk/22.1.7171670/

For all the previous aTalk releases, it uses "make install" (jni/static_library_build/libvpx,), it has no problem with the .so generation.

However when I try to use build.make.Android.mk ( jni/vps scipts), I encountered multiple problems as below:

1. Building of libvpx using build.make.Android.mk does not work
a. build.make.Android.mk info errors:
# comments in Android.mk is outdated i.e. sdk-path is invalid
# set APP_ABI e.g. "arm64-v8a" to match the --target passed to configure ??? TARGET use internal defined variables i.e. "arm64-android-gcc".
b. Require ENABLE_SHARED := 1 (not mentioned) for Android.mk to build with include $(BUILD_SHARED_LIBRARY) 

2. BUILD_PFX must be specified and exported during configure
3. make: *** No rule to make target 'vp8_rtcd.h', needed by 'vpx/vpx_config.c' etc...

With `--enable-external-build` and the Android.mk, the Makefile isn't meant to be used (though make install can install the headers, you may need `make -k install` depending on what you have configured). The Android.mk build needs an update to support some of the advanced neon instructions. For now it should work when configured with --disable-neon-dotprod. There is a typo in 'build/make/Android.mk', the include path should be libvpx/build/make/Android.mk not 'jni/...' with the top level Android.mk placed in the jni directory.
 

During "make install" build it seems that these includes are created, but not when via Android.mk
Creating makefiles for armv7-android-gcc libs
[CREATE] vpx_scale_rtcd.h
[CREATE] vpx_dsp_rtcd.h
[CREATE] vp8_rtcd.h
[CREATE] vp9_rtcd.h

Any commnets, and helps will be appreciated.

--
You received this message because you are subscribed to the Google Groups "WebM Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webm-discuss...@webmproject.org.
To view this discussion visit https://groups.google.com/a/webmproject.org/d/msgid/webm-discuss/765ca57a-6769-4c15-a8e6-8bdb8c905c63n%40webmproject.org.

ChongMeng Eng

unread,
Aug 28, 2025, 11:26:38 PM (8 days ago) Aug 28
to WebM Discussion, James Zern
Please refer to  aTalk/jni/static_library_built/libvpx/build-vpx4android.sh script
In the vpx configure, aTalk does not specify `--enable-external-build` and the build works just fine with 'make install'

When building with 'libvpx/build/make/Android.mk', the aTalk/jni/vpx/libvpx/gen-abimk4vpx.sh script is used.
I tried to include '--disable-neon-dotprod.' during configure, but the same problems still happen as before. It does not work.

regards,
CM Eng

James Zern

unread,
Aug 29, 2025, 5:10:51 PM (7 days ago) Aug 29
to WebM Discussion
On Thu, Aug 28, 2025 at 8:26 PM ChongMeng Eng <cmen...@gmail.com> wrote:
Please refer to  aTalk/jni/static_library_built/libvpx/build-vpx4android.sh script
In the vpx configure, aTalk does not specify `--enable-external-build` and the build works just fine with 'make install'

When building with 'libvpx/build/make/Android.mk', the aTalk/jni/vpx/libvpx/gen-abimk4vpx.sh script is used.
I tried to include '--disable-neon-dotprod.' during configure, but the same problems still happen as before. It does not work.

There may be an issue with the script. Can you try building libvpx standalone?

```
$ mkdir libvpx-ndk
$ cd libvpx-ndk
$ git clone https://chromium.googlesource.com/webm/libvpx jni/libvpx
$ cd jni
$ cat >Android.mk << EOF
LOCAL_PATH := \$(call my-dir)
include \$(CLEAR_VARS)
include libvpx/build/make/Android.mk
EOF
$ ./libvpx/configure --target=arm64-android-gcc --disable-examples --enable-external-build --prefix=/tmp/install --disable-neon-dotprod --disable-libyuv --disable-dependency-tracking --disable-webm-io --disable-tools --disable-docs --disable-examples --prefix=vpx-install
$  ndk-build APP_ABI=arm64-v8a -j
$ make install
```

ChongMeng Eng

unread,
Aug 29, 2025, 7:15:36 PM (7 days ago) Aug 29
to webm-d...@webmproject.org
The build is ok and the output is as below:

cmeng@Legion5Pro:~/tmp$ mkdir libvpx-ndk
cmeng@Legion5Pro:~/tmp$ cd libvpx-ndk/
cmeng@Legion5Pro:~/tmp/libvpx-ndk$  git clone https://chromium.googlesource.com/webm/libvpx jni/libvpx
Cloning into 'jni/libvpx'...
remote: Total 170970 (delta 134370), reused 170970 (delta 134370)
Receiving objects: 100% (170970/170970), 74.53 MiB | 54.08 MiB/s, done.
Resolving deltas: 100% (134370/134370), done.
d cmeng@Legion5Pro:~/tmp/libvpx-ndk$ cd jni
cmeng@Legion5Pro:~/tmp/libvpx-ndk/jni$ ls
libvpx
cmeng@Legion5Pro:~/tmp/libvpx-ndk/jni$  git clone https://chromium.googlesource.com/webm/libvpx jni/libvpx
Cloning into 'jni/libvpx'...
remote: Total 170970 (delta 134370), reused 170970 (delta 134370)
Receiving objects: 100% (170970/170970), 74.53 MiB | 51.70 MiB/s, done.
Resolving deltas: 100% (134370/134370), done.
cmeng@Legion5Pro:~/tmp/libvpx-ndk/jni$ ls
jni  libvpx
cmeng@Legion5Pro:~/tmp/libvpx-ndk/jni$ cat >Android.mk << EOF

> LOCAL_PATH := \$(call my-dir)
> include \$(CLEAR_VARS)
> include libvpx/build/make/Android.mk
> EOF
cmeng@Legion5Pro:~/tmp/libvpx-ndk/jni$ ./libvpx/configure --target=arm64-android-gcc --disable-examples --enable-external-build --prefix=/tmp/install --disable-neon-dotprod --disable-libyuv --disable-dependency-tracking --disable-webm-io --disable-tools --disable-docs --disable-examples --prefix=vpx-install
  disabling examples
  enabling external_build
  disabling libyuv
  disabling dependency_tracking
  disabling webm_io
  disabling tools
  disabling docs
  enabling vp8_encoder
  enabling vp8_decoder
  enabling vp9_encoder
  enabling vp9_decoder
Configuring for target 'arm64-android-gcc'
  enabling arm64
  enabling runtime_cpu_detect
Assuming standalone build with NDK toolchain.
See build/make/Android.mk for details.
  enabling unit_tests
  enabling neon
  disabling neon_i8mm
  disabling sve
  disabling sve2
Bypassing toolchain for environment detection.
Creating makefiles for arm64-android-gcc libs
cmeng@Legion5Pro:~/tmp/libvpx-ndk/jni$ /opt/android/android-sdk/ndk/22.1.7171670/ndk-build APP_ABI=arm64-v8a -j
Android NDK: APP_PLATFORM not set. Defaulting to minimum supported version android-16.    
    [CREATE] vpx_scale_rtcd.h
    [CREATE] vp9_rtcd.h
    [CREATE] vp8_rtcd.h
    [CREATE] vpx_dsp_rtcd.h
[arm64-v8a] Compile        : vpx <= vpx_config.c
[arm64-v8a] Compile        : vpx <= entropymv.c
[arm64-v8a] Compile        : vpx <= blockd.c
[arm64-v8a] Compile        : vpx <= loopfilter_arm.c
[arm64-v8a] Compile        : vpx <= entropymode.c
[arm64-v8a] Compile        : vpx <= dequantize.c
[arm64-v8a] Compile        : vpx <= entropy.c
[arm64-v8a] Compile        : vpx <= systemdependent.c
...
[arm64-v8a] Compile        : vpx <= subpel_variance_neon.c
[arm64-v8a] Compile        : vpx <= vp9_encodeframe.c
[arm64-v8a] Compile        : vpx <= vp9_mcomp.c
[arm64-v8a] StaticLibrary  : libvpx.a
cmeng@Legion5Pro:~/tmp/libvpx-ndk/jni$ make install
make[1]: Nothing to be done for 'install'.

However I am not sure what your purpose is in doing this.

In aTalk libvpx static library build, it uses the following script files as attached to build. It too builds without any problem.
However I found that the specified 'BUILD_PFX' is important. The build is ok when this parameter is not specified.

When I set  it to  BUILD_PFX=${BASEDIR}/ , then I found that all the missing  e.g. libvpxvp9_rtcd.h etc are created.
When I specified it as  BUILD_PFX=${BASEDIR}/libvpx, all the earlier reported problems started to occur.
I cannot locate where these files are when the parameter is not specified, but the build is OK. 

regards,
CM Eng.




You received this message because you are subscribed to a topic in the Google Groups "WebM Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/a/webmproject.org/d/topic/webm-discuss/4_HTW6SAcw8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to webm-discuss...@webmproject.org.
To view this discussion visit https://groups.google.com/a/webmproject.org/d/msgid/webm-discuss/CABWgkXKawSyJ1gJBDbtHJXEiifiGgMNDp_P1nO4ATtrdBKEe-Q%40mail.gmail.com.
libvpx_scripts.zip

ChongMeng Eng

unread,
Aug 29, 2025, 9:43:53 PM (7 days ago) Aug 29
to WebM Discussion, ChongMeng Eng
I try to use the following scripts (see attached) to build libvpx using libvpx/build/make/Android.mk. Followings are the observation.

1. In order to generate all the xxx_rtcd.h etc files, I must include the 'make' process; when running the gen_abimk4vpx.sh. 
I must also 'export BUILD_PFX=' with null parameter. Other values if specified will cause weired problems.

However following warnings are seen during the gen_abimk4vpx.sh build e.g.
a. vpx_dsp/x86/highbd_variance_sse2.c:171:1: warning: no previous prototype for function 'vpx_highbd_10_variance64x64_sse2' [-Wmissing-prototypes] etc...
b. opt/android/android-sdk/ndk/22.1.7171670//toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android-strip: Unable to recognise the format of the input file `libvpxrc_g.a(vp9_iht4x4_add_neon.c.o)' etc

In jni/Andorid.mk, I specified to run the jni/vpx/Android_ndk.mk. When I do a gradle sync, following error is reported
i.e. make: *** No rule to make target 'vpx_config.h', needed by 'vpx_config.asm'.  Stop.
So I am unable to proceed with the jin/Android.mk build.

During configure preparation for the xxx.so buid, I have to move all the generated libx-xxx.mk files to vpx/ directory as libvpx/build/make/Android.mk
makes referece to these files in the vpx/ location.

Actually my intention to use libvpx/build/make/Android.mk, so that aTalk will build the jnlibvpx.so file in a single step.
Currently aTalk use 2 steps process to build the jblibvpx.so library; using the previous enclosed scripts file i.e. running scripts in jin/static_library_built/vpx/.
Look like the current libvpx/build/make/Android.mk also needs 2 steps build process, little gain on migrating to this process.
If you refer to aTalk jni/opus build, it is a simple single step to build the jnopus.so library. This is what I am hoping for libvpx build.

ChongMeng Eng

unread,
Aug 29, 2025, 9:54:13 PM (7 days ago) Aug 29
to WebM Discussion
Here are the attached scripts.
libvpx_so_script.zip

ChongMeng Eng

unread,
Aug 29, 2025, 10:44:53 PM (7 days ago) Aug 29
to WebM Discussion, ChongMeng Eng
Found that the two warnings below occured, is because I 'mv the ./libs-*.mk' within the do loop in 'configure make'.
a. vpx_dsp/x86/highbd_variance_sse2.c:171:1: warning: no previous prototype for function 'vpx_highbd_10_variance64x64_sse2' [-Wmissing-prototypes] etc...
b. opt/android/android-sdk/ndk/22.1.7171670//toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android-strip: Unable to recognise the format of the input file `libvpxrc_g.a(vp9_iht4x4_add_neon.c.o)' etc

after I mofiied the gen_abimk4vpx.sh file i.e. to mv the files after end of loop. then the observed problems do not happen anymore.
pushd "${LIB_VPX}" || exit
for ((i=0; i < ${#ABIS[@]}; i++))
do
  if [[ $# -eq 0 ]] || [[ "$1" == "${ABIS[i]}" ]]; then
    echo -e "\n** CONFIGURE STARTED: ${LIB_VPX} (${version}) for ${ABIS[i]} **"
    configure_make "${ABIS[i]}"
    echo -e "** CONFIGURE COMPLETED: ${LIB_VPX} for ${ABIS[i]} **\n"
  fi
done
# must only move the files outside the loop.
mv ./libs-*.mk ../
popd || true

However other observed problem still happen.

ChongMeng Eng

unread,
Aug 31, 2025, 11:49:51 PM (5 days ago) Aug 31
to WebM Discussion, ChongMeng Eng
After further clean up to the scripts and mk files;
I no longer require to 'export BUILD_PFX='

The only problem left during the ndk build is, and I do not have any idea why this happen.

i.e. make: *** No rule to make target 'vpx_config.h', needed by 'vpx_config.asm'.  Stop.

ChongMeng Eng

unread,
Sep 1, 2025, 12:07:02 AM (4 days ago) Sep 1
to WebM Discussion, ChongMeng Eng
The reason for the problem below is because aTalk mk file specifies  'ENABLE_SHARED := 1'
i.e. make: *** No rule to make target 'vpx_config.h', needed by 'vpx_config.asm'.  Stop.

However even with no error messages in the build process, the jnlibvpx.so is not generated/included in the aTalk.apk.
Hence there is no libvpx codec support in the released apk.

The conclusion is that for libvpx codec support, aTalk build process still have to use the two steps build process, using the first attached zip file scripts. 

Reply all
Reply to author
Forward
0 new messages