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

Merge Android/Quest build into main distribution #91

Closed
jackjansen opened this issue Mar 5, 2024 · 8 comments
Closed

Merge Android/Quest build into main distribution #91

jackjansen opened this issue Mar 5, 2024 · 8 comments
Assignees
Milestone

Comments

@jackjansen
Copy link
Contributor

Once #89 has been merged I think we have a good chance of pulling this off.

@jackjansen jackjansen added this to the 7.6 Release milestone Mar 5, 2024
@jackjansen
Copy link
Contributor Author

Googling for "cmake vcpkg android" finds a lot of things that look like they could be relevant. For example https://gist.github.com/pthom/07a130b9f45abb1ddb14bf76b935482b which shows how to build opencv for Android.

@jackjansen
Copy link
Contributor Author

@jackjansen
Copy link
Contributor Author

This has suddenly become high priority. For the Transmixr use cases it has been decided that cwipc volumetric video playout is going to be tested for the TG4 use case, and the TG4 playout app is native-android-only.

We don't need a full VR2Gather implementation, only playback of a compressed live point cloud stream. We would create a prefab for this in cwipc_unity, and Immersion would then put this prefab into the TG4 app.

@jackjansen
Copy link
Contributor Author

The port of last year by @troeggla is in https://github.com/cwi-dis/cwipc_android

@jackjansen jackjansen self-assigned this Oct 9, 2024
@jackjansen
Copy link
Contributor Author

Notes for self (or for future, or for future self).

  • We want to use vcpkg and we want to use cross-compilation, so we set the CMAKE_TOOLCHAIN_FILE to the vcpkg toolchain file, and the VCPKG_CHAINLOAD_TOOLCHAIN_FILE to the android crosscompiler toolchain file.
  • We need to find the correct VCPKG_TARGET_TRIPLET. Lots of trial-and-error, but it turns out to be arm64-android.
  • Same for the ANDROID_ABI. Again, trial and error, and now at arm64-v8a.
  • And ANDROID_NATIVE_API_LEVEL. https://en.wikipedia.org/wiki/Quest_2 states that the Quest 2 runs Android 12.1. https://apilevels.com explains that that is level 31 or 32. Use 31 for now.

@jackjansen
Copy link
Contributor Author

Got pretty far, but now stuck on a cmake error with pcl.
The problem seems to be that when cross-compiling the pcl build cannot determine some settings.
Hacked around this by editing vcpkg/ports/pcl/portfile.cmake and adding two options to vcpkg_cmake_configure():

        -DHAVE_MM_MALLOC_EXITCODE=OFF
        -DHAVE_POSIX_MEMALIGN_EXITCODE=OFF

If this hack works I'll have to think of a better way to do this (dependent on cross-compiling) and seeing if I can submit this to the vcpkg people.

@jackjansen
Copy link
Contributor Author

Fixed the pcl issue (through a vcpkg port change, microsoft/vcpkg#41505 and microsoft/vcpkg#41506).

I can now build and create an installer on my Mac.

Added the GitHub action workflow, but that doesn't work yet.

@jackjansen
Copy link
Contributor Author

New pull request submitted, microsoft/vcpkg#43295

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

2 participants