android fixes

This commit is contained in:
AlexandreRouma 2022-09-02 20:08:16 +02:00
parent ce3fea3747
commit 72b895fc67
10 changed files with 22 additions and 32 deletions

View File

@ -4,7 +4,7 @@ apply plugin: 'kotlin-android'
android {
compileSdkVersion 28
buildToolsVersion "30.0.3"
ndkVersion "23.0.7599858"
ndkVersion "25.1.8937393"
defaultConfig {
applicationId "org.sdrpp.sdrpp"
minSdkVersion 28
@ -14,7 +14,7 @@ android {
externalNativeBuild {
cmake {
arguments "-DOPT_BACKEND_GLFW=OFF", "-DOPT_BACKEND_ANDROID=ON", "-DOPT_BUILD_SOAPY_SOURCE=OFF", "-DOPT_BUILD_ANDROID_AUDIO_SINK=ON", "-DOPT_BUILD_AUDIO_SINK=OFF", "-DOPT_BUILD_DISCORD_PRESENCE=OFF", "-DOPT_BUILD_M17_DECODER=ON"
arguments "-DOPT_BACKEND_GLFW=OFF", "-DOPT_BACKEND_ANDROID=ON", "-DOPT_BUILD_SOAPY_SOURCE=OFF", "-DOPT_BUILD_ANDROID_AUDIO_SINK=ON", "-DOPT_BUILD_AUDIO_SINK=OFF", "-DOPT_BUILD_DISCORD_PRESENCE=OFF", "-DOPT_BUILD_M17_DECODER=OFF", "-DOPT_BUILD_PLUTOSDR_SOURCE=OFF"
}
}
}

View File

@ -108,17 +108,15 @@ if (MSVC)
target_link_libraries(sdrpp_core PUBLIC zstd::libzstd_shared)
elseif (ANDROID)
target_include_directories(sdrpp_core PUBLIC
../android/deps/volk/jni
../android/deps/fftw3/jni
/mnt/android_sdr/zstd/lib
/sdr-kit/${ANDROID_ABI}/include
${ANDROID_NDK}/sources/android/native_app_glue
)
target_link_libraries(sdrpp_core PUBLIC
${PROJECT_SOURCE_DIR}/../android/deps/volk/${ANDROID_ABI}/libcpu_features.a
${PROJECT_SOURCE_DIR}/../android/deps/volk/${ANDROID_ABI}/libvolk.so
${PROJECT_SOURCE_DIR}/../android/deps/fftw3/${ANDROID_ABI}/libfftw3f.a
/mnt/android_sdr/output/zstd/${ANDROID_ABI}/libzstd.so
/sdr-kit/${ANDROID_ABI}/lib/libcpu_features.a
/sdr-kit/${ANDROID_ABI}/lib/libvolk.so
/sdr-kit/${ANDROID_ABI}/lib/libfftw3f.so
/sdr-kit/${ANDROID_ABI}/lib/libzstd.so
android
EGL
GLESv3

View File

@ -26,13 +26,12 @@ if (MSVC)
target_link_libraries(airspy_source PRIVATE airspy)
elseif (ANDROID)
target_include_directories(airspy_source PUBLIC
/mnt/android_sdr/libusb/libusb
/mnt/android_sdr/airspyone_host/libairspy/src
/sdr-kit/${ANDROID_ABI}/include/libairspy
)
target_link_libraries(airspy_source PUBLIC
/mnt/android_sdr/output/libusb/${ANDROID_ABI}/libusb1.0.so
/mnt/android_sdr/output/libairspy/${ANDROID_ABI}/libairspy.so
/sdr-kit/${ANDROID_ABI}/lib/libusb1.0.so
/sdr-kit/${ANDROID_ABI}/lib/libairspy.so
)
else (MSVC)
find_package(PkgConfig)

View File

@ -131,7 +131,7 @@ public:
#ifndef __ANDROID__
int err = airspy_open_sn(&dev, serial);
#else
int err = airspy_open_sn(&dev, devFd);
int err = airspy_open_fd(&dev, devFd);
#endif
if (err != 0) {
char buf[1024];

View File

@ -26,13 +26,12 @@ if (MSVC)
target_link_libraries(airspyhf_source PRIVATE airspyhf)
elseif (ANDROID)
target_include_directories(airspyhf_source PUBLIC
/mnt/android_sdr/libusb/libusb
/mnt/android_sdr/airspyhf/libairspyhf/src
/sdr-kit/${ANDROID_ABI}/include/libairspyhf
)
target_link_libraries(airspyhf_source PUBLIC
/mnt/android_sdr/output/libusb/${ANDROID_ABI}/libusb1.0.so
/mnt/android_sdr/output/libairspyhf/${ANDROID_ABI}/libairspyhf.so
/sdr-kit/${ANDROID_ABI}/lib/libusb1.0.so
/sdr-kit/${ANDROID_ABI}/lib/libairspyhf.so
)
else (MSVC)
find_package(PkgConfig)

View File

@ -132,7 +132,7 @@ public:
#ifndef __ANDROID__
int err = airspyhf_open_sn(&dev, serial);
#else
int err = airspyhf_open_sn(&dev, devFd);
int err = airspyhf_open_fd(&dev, devFd);
#endif
if (err != 0) {
char buf[1024];

View File

@ -24,13 +24,12 @@ if (MSVC)
target_link_libraries(hackrf_source PRIVATE hackrf)
elseif (ANDROID)
target_include_directories(hackrf_source PUBLIC
/mnt/android_sdr/libusb/libusb
/mnt/android_sdr/hackrf/host/libhackrf/src
/sdr-kit/${ANDROID_ABI}/include/libhackrf
)
target_link_libraries(hackrf_source PUBLIC
/mnt/android_sdr/output/libusb/${ANDROID_ABI}/libusb1.0.so
/mnt/android_sdr/output/libhackrf/${ANDROID_ABI}/libhackrf.so
/sdr-kit/${ANDROID_ABI}/lib/libusb1.0.so
/sdr-kit/${ANDROID_ABI}/lib/libhackrf.so
)
else (MSVC)
find_package(PkgConfig)

View File

@ -248,7 +248,7 @@ private:
#ifndef __ANDROID__
hackrf_error err = (hackrf_error)hackrf_open_by_serial(_this->selectedSerial.c_str(), &_this->openDev);
#else
hackrf_error err = (hackrf_error)hackrf_open_by_fd(&_this->openDev, _this->devFd);
hackrf_error err = (hackrf_error)hackrf_open_by_fd(_this->devFd, &_this->openDev);
#endif
if (err != HACKRF_SUCCESS) {
spdlog::error("Could not open HackRF {0}: {1}", _this->selectedSerial, hackrf_error_name(err));

View File

@ -23,14 +23,9 @@ if (MSVC)
target_link_libraries(rtl_sdr_source PRIVATE rtlsdr)
elseif (ANDROID)
target_include_directories(rtl_sdr_source PUBLIC
/mnt/android_sdr/libusb/libusb
/mnt/android_sdr/librtlsdr/include
)
target_link_libraries(rtl_sdr_source PUBLIC
/mnt/android_sdr/output/libusb/${ANDROID_ABI}/libusb1.0.so
/mnt/android_sdr/output/librtlsdr/${ANDROID_ABI}/librtlsdr.so
/sdr-kit/${ANDROID_ABI}/lib/libusb1.0.so
/sdr-kit/${ANDROID_ABI}/lib/librtlsdr.so
)
else (MSVC)
find_package(PkgConfig)

View File

@ -285,7 +285,7 @@ private:
#ifndef __ANDROID__
int oret = rtlsdr_open(&_this->openDev, _this->devId);
#else
int oret = rtlsdr_open(&_this->openDev, _this->devFd);
int oret = rtlsdr_open_fd(&_this->openDev, _this->devFd);
#endif
if (oret < 0) {