Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. How to build OpenAL-Soft and set up it in Qt Creator for Android
Forum Updated to NodeBB v4.3 + New Features

How to build OpenAL-Soft and set up it in Qt Creator for Android

Scheduled Pinned Locked Moved Solved Game Development
27 Posts 4 Posters 4.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 8 8Observer8
    17 Aug 2023, 17:17

    @JoeCFD said in How to install OpenAL-Soft for Android in Qt Creator by copying OpenAL-Soft sources into a project:

    Instead you need JDK 11 to build C++ apps for Android 7. But in your settings, JDK 17 is used.

    I tried to run apps with Box2D and Bullet Physics on real smartphone Redmi 4x with Android 7. I use JDK 17 and it works. I tried to run an example with QMediaPlayer on my smartphone and it plays music. I think I found a solution. I should try to use Bass Audio Library for 3D sounds on Android. It's is too difficult to add OpenAL-Soft directly with sources. Now I know this information:

    Note that OpenAL is LGPL-licensed. Which means you need to release the source to your application if you make it part of your application.

    J Offline
    J Offline
    JoeCFD
    wrote on 17 Aug 2023, 18:03 last edited by
    #21

    @8Observer8 Great it works for you with JDK 17. You can still build OpenAL-Soft to dynamic lib and add it to your app for Android. It does not violate LGPL-license.

    8 1 Reply Last reply 17 Aug 2023, 18:13
    0
    • J JoeCFD
      17 Aug 2023, 18:03

      @8Observer8 Great it works for you with JDK 17. You can still build OpenAL-Soft to dynamic lib and add it to your app for Android. It does not violate LGPL-license.

      8 Offline
      8 Offline
      8Observer8
      wrote on 17 Aug 2023, 18:13 last edited by
      #22

      @JoeCFD what do you think about this? https://github.com/AerialX/openal-soft-android How to build it?

      J 1 Reply Last reply 17 Aug 2023, 18:44
      0
      • 8 Offline
        8 Offline
        8Observer8
        wrote on 17 Aug 2023, 18:16 last edited by
        #23

        Does anyone have compiled libraries (.so) of OpenAL-Soft for Android? I mean armeabi-v7a and x86_64. I can't find step by step instructions.

        1 Reply Last reply
        0
        • 8 8Observer8
          17 Aug 2023, 18:13

          @JoeCFD what do you think about this? https://github.com/AerialX/openal-soft-android How to build it?

          J Offline
          J Offline
          JoeCFD
          wrote on 17 Aug 2023, 18:44 last edited by JoeCFD
          #24

          @8Observer8 you may need to change CMakefile or create a pro file for Android. And build it for Android. It is just another project.

          J 1 Reply Last reply 17 Aug 2023, 19:53
          0
          • J JoeCFD
            17 Aug 2023, 18:44

            @8Observer8 you may need to change CMakefile or create a pro file for Android. And build it for Android. It is just another project.

            J Offline
            J Offline
            JoeCFD
            wrote on 17 Aug 2023, 19:53 last edited by JoeCFD
            #25

            @JoeCFD A lazy way to do it is that you find out all settings(flags and libs) for Android build in the Makefile(made from pro or cmakefile) of your Android project. Then, you open CMakefile of OpenAL-Soft with cmake-gui and add(or replace) all these settings to the corresponding locations. Do make and you will get the right lib for Android. I did it once for some testing and it worked.

            Sure it is better to do it properly. It should not be that hard.

            1 Reply Last reply
            0
            • 8 Offline
              8 Offline
              8Observer8
              wrote on 19 Aug 2023, 22:58 last edited by 8Observer8
              #26

              I found the simples way! I just download these sources: https://github.com/AerialX/openal-soft-android and built it using CMake. The libopenal.so library was created. I created the "Play" button. I built my first app that plays music using OpenAL! It works on my smartphone! It's cool!

              My step-by-step guide for Qt 6.2.4 MinGW 64-bit:

              • Download these sources: https://github.com/AerialX/openal-soft-android
              • Download CMake (add it to the Path variable): https://cmake.org/download/
              • Go to openal-soft-android from the console (cd openal-soft-android)
              • Copy the next commands to the console (don't forget to change the path to your android.toolchain.cmake)

              cmake -G "MinGW Makefiles" -S . -B ./build -DCMAKE_TOOLCHAIN_FILE=E:\AppData\Android\SDK\ndk\22.1.7171670\build\cmake\android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DANDROID_NATIVE_API_LEVEL=29

              cmake --build ./build -j 4

              The libopenal.so will be created. Create a new Qt project. Create the jniLibs/armeabi-v7a folder inside of your Qt project. And copy libopenal.so inside of jniLibs/armeabi-v7a.

              Create the libs\openal-soft\include folder inside of your Qt project and copy the AL folder there.

              Add these settings to your pro-file:

              INCLUDEPATH += $$PWD/libs/openal-soft/include
              
              contains(ANDROID_TARGET_ARCH, armeabi-v7a)
              {
                  ANDROID_EXTRA_LIBS += $$PWD/jniLibs/armeabi-v7a/libopenal.so
              }
              

              Added 2/25/2024

              I use these settings to run on Windows, real device, and Android Emulator:

              CONFIG("windows") {
                  INCLUDEPATH += $$PWD/libs/openal-soft-desktop-1.23.1/include
                  LIBS += -L$$PWD/libs/openal-soft-desktop-1.23.1/lib/x64
                  LIBS += -lOpenAL32.dll
              }
              
              CONFIG("armeabi-v7a") {
                  INCLUDEPATH += $$PWD/libs/openal-soft-android/include
                  contains(ANDROID_TARGET_ARCH, armeabi-v7a)
                  {
                      ANDROID_EXTRA_LIBS += $$PWD/jniLibs/armeabi-v7a/libopenal.so
                  }
              }
              
              CONFIG("x86") {
                  INCLUDEPATH += $$PWD/libs/openal-soft-android/include
                  contains(ANDROID_TARGET_ARCH, x86)
                  {
                      ANDROID_EXTRA_LIBS += $$PWD/jniLibs/x86/libopenal.so
                  }
              }
              
              1 Reply Last reply
              0
              • 8 8Observer8 has marked this topic as solved on 19 Aug 2023, 22:58
              • F Offline
                F Offline
                florbermudez
                wrote on 17 Nov 2023, 08:32 last edited by
                #27
                This post is deleted!
                1 Reply Last reply
                0
                • 8 8Observer8 has marked this topic as unsolved on 25 Feb 2024, 11:58
                • 8 8Observer8 has marked this topic as solved on 25 Feb 2024, 11:59

                21/27

                17 Aug 2023, 18:03

                • Login

                • Login or register to search.
                21 out of 27
                • First post
                  21/27
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved