Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions ft8cn/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,20 @@ android {

externalNativeBuild {
cmake {
cppFlags '-JENABLE_XOM=false'//Disable XOM

// No extra cppFlags — the upstream FT8CN's '-JENABLE_XOM=false' was
// a typo (likely intended -D, not -J) that clang rejects when an
// actual native build is wired up. It had no effect before because
// the legacy libft8cn.so is shipped prebuilt via jniLibs.
cppFlags ''
}
}

// The legacy libft8cn.so binaries in app/libs/<abi>/ stay packaged via
// jniLibs.srcDirs; this filter just keeps NDK builds focused on the
// four ABIs we ship and prevents an unexpected ABI slipping in.
ndk {
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64'
}
}

signingConfigs {
Expand Down Expand Up @@ -102,12 +112,12 @@ android {
returnDefaultValues = true
}
}
// externalNativeBuild {
// cmake {
// path file('src/main/cpp/CMakeLists.txt')
// version '3.18.1'
// }
// }
externalNativeBuild {
cmake {
path file('src/main/cpp/CMakeLists.txt')
version '3.22.1'
}
}

sourceSets {
main {
Expand Down
72 changes: 72 additions & 0 deletions ft8cn/app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# FT8AF native USB audio module.
#
# Builds libft8af_usb.so containing our libusb-backed USB Audio Class
# capture path, with libusb 1.0.27 statically linked in. The shared
# library is packaged alongside the upstream-prebuilt libft8cn.so
# (which we don't compile here — see jniLibs.srcDirs = ['libs']).
#
# Why libusb: Android's UsbRequest API silently fails to drive
# isochronous transfers on some kernels (notably automotive Android
# variants), throwing IllegalStateException on first queue. libusb
# uses USBDEVFS ioctls directly and is the most battle-tested option
# for USB audio on Android.

cmake_minimum_required(VERSION 3.18.1)

project(ft8af_native)

# ---------------------------------------------------------------------------
# libusb 1.0.27 (static)
# ---------------------------------------------------------------------------
# Source list mirrors libusb/android/jni/libusb.mk — only the Linux/USBFS
# backend + POSIX threads/events; the macOS/Windows/Haiku/etc. backends in
# libusb/os/ are intentionally not compiled.

set(LIBUSB_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/libusb)

add_library(usb1.0 STATIC
${LIBUSB_ROOT}/libusb/core.c
${LIBUSB_ROOT}/libusb/descriptor.c
${LIBUSB_ROOT}/libusb/hotplug.c
${LIBUSB_ROOT}/libusb/io.c
${LIBUSB_ROOT}/libusb/sync.c
${LIBUSB_ROOT}/libusb/strerror.c
${LIBUSB_ROOT}/libusb/os/linux_usbfs.c
${LIBUSB_ROOT}/libusb/os/events_posix.c
${LIBUSB_ROOT}/libusb/os/threads_posix.c
${LIBUSB_ROOT}/libusb/os/linux_netlink.c
)

target_include_directories(usb1.0
PUBLIC
${LIBUSB_ROOT}/libusb
PRIVATE
${LIBUSB_ROOT}/android
${LIBUSB_ROOT}/libusb/os
)

# libusb assumes POSIX threads, eventfd, timerfd, etc. — all present on
# Android. Hidden visibility matches upstream's Android build so we don't
# accidentally re-export libusb symbols from our .so.
target_compile_options(usb1.0 PRIVATE
-fvisibility=hidden
-pthread
-Wno-pointer-arith
-Wno-deprecated-declarations
)

# ---------------------------------------------------------------------------
# libft8af_usb.so — our JNI bridge
# ---------------------------------------------------------------------------

add_library(ft8af_usb SHARED
usb_audio.cpp
usb_audio_capture.cpp
)

find_library(log-lib log)

target_link_libraries(ft8af_usb
usb1.0
${log-lib}
)
224 changes: 224 additions & 0 deletions ft8cn/app/src/main/cpp/libusb/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>
Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org>
Copyright © 2010-2012 Peter Stuge <peter@stuge.se>
Copyright © 2008-2016 Nathan Hjelm <hjelmn@users.sourceforge.net>
Copyright © 2009-2013 Pete Batard <pete@akeo.ie>
Copyright © 2009-2013 Ludovic Rousseau <ludovic.rousseau@gmail.com>
Copyright © 2010-2012 Michael Plante <michael.plante@gmail.com>
Copyright © 2011-2013 Hans de Goede <hdegoede@redhat.com>
Copyright © 2012-2013 Martin Pieuchot <mpi@openbsd.org>
Copyright © 2012-2013 Toby Gray <toby.gray@realvnc.com>
Copyright © 2013-2018 Chris Dickens <christopher.a.dickens@gmail.com>

Other contributors:
Aaron Luft
Adam Korcz
Addison Crump
Adrian Bunk
Adrien Destugues
Akshay Jaggi
Alan Ott
Alan Stern
Aleksandr Mezin
Alexander Mot
Alexander Pyhalov
Alexander Schlarb
Alexander Stein
Alex Feinman
Alex Vatchenko
Andrew Aldridge
Andrew Fernandes
Andrew Goodney
Andy Chunyu
Andy McFadden
Angus Gratton
Anil Nair
Ankur Verma
Anthony Clay
Antonio Ospite
Artem Egorkine
Aurelien Jarno
Axel Gembe
Aymeric Vincent
Baruch Siach
Bastien Nocera
Bei Zhang
Bence Csokas
Benjamin Berg
Benjamin Dobell
Bohdan Tymkiv
Brad Smith
Brent Rector
Bruno Harbulot
Carl Karsten
Christophe Zeitouny
Chris Zhu
Chunyu Xie
Colin Walters
Craig Hutchinson
Dave Camarillo
David Engraf
Davidlohr Bueso
David Moore
Dmitry Fleytman
Dmitry Kostjuchenko
Dmitry Zakablukov
Dominik Boehi
Doug Johnston
Edgar Fuß
Evan Hunter
Evan Miller
Fabrice Fontaine
Federico Manzan
Felipe Balbi
Florian Albrechtskirchinger
Francesco Montorsi
Francisco Facioni
Francis Hart
Frank Li
Frederik Carlier
Freek Dijkstra
Gaurav Gupta
Graeme Gill
Greg Kroah-Hartman
Gustavo Zacarias
Haidong Zheng
Hans Ulrich Niedermann
Harry Mallon
Hector Martin
Hoi-Ho Chan
Ido Yariv
Igor Anokhin
Ihor Dutchak
Ilya Konstantinov
Ingvar Stepanyan
Jakub Klama
James Hanko
Jeffrey Nichols
Jie Zhang
Jim Chen
Johann Richard
John Keeping
John Sheu
Jonas Malaco
Jonathon Jongsma
Joost Muller
Josh Gao
Joshua Blake
Joshua Hou
Joshua M. Clulow
Juan Cruz Viotti
Julian Scheel
Justin Bischoff
Karsten Koenig
Keith Ahluwalia
Kenjiro Tsuji
Kimura Masaru
Konrad Rzepecki
Kuangye Guo
Lars Kanis
Lars Wirzenius
Lei Chen
Léo Lam
Liang Yunwang
Lonnie Abelbeck
Luca Longinotti
Luz Paz
Mac Wang
Marco Trevisan (Treviño)
Marcus Meissner
Mario Kleiner
Mark Kuo
Markus Heidelberg
Martin Ettl
Martin Koegler
Martin Ling
Martin Thierer
Mathias Hjärtström
Matthew Stapleton
Matthias Bolte
Michael Dickens
Michel Zou
Mike Frysinger
Mikhail Gusarov
Mikolaj Kucharski
Morgan Leborgne
Moritz Fischer
Nancy Li
Nia Alarie
Nicholas Corgan
Niklas Gürtler
Omri Iluz
Orhan aib Kavrakoglu
Orin Eman
Ozkan Sezer
Pablo Prietz
Patrick Stewart
Paul Cercueil
Paul Fertser
Paul Qureshi
Pekka Nikander
Petr Pazourek
Philémon Favrod
Pino Toscano
Rob Walker
Romain Vimont
Roman Kalashnikov
Rosen Penev
Ryan Hileman
Ryan Metcalfe
Ryan Schmidt
Saleem Rashid
Sameeh Jubran
Sean McBride
Sebastian Pipping
Sebastian von Ohr
Sergey Serb
Shawn Hoffman
Simon Chan
Simon Haggett
Simon Newton
Slash Gordon
Stefan Agner
Stefan Tauner
Steinar H. Gunderson
Stephen Groat
Sylvain Fasel
Theo Buehler
Thomas Röfer
Tim Hutt
Tim Roberts
Tobias Klauser
Toby Peterson
Tormod Volden
Trygve Laugstøl
Uri Lublin
Uwe Bonnes
Vasily Khoruzhick
Vegard Storheil Eriksen
Venkatesh Shukla
Vianney le Clément de Saint-Marcq
Victor Toso
Vinicius Tinti
Vitali Lovich
Vladimir Beloborodov
William Orr
William Skellenger
Xiaofan Chen
Yegor Yefremov
Zeng Guang
Zhiqiang Liu
Zoltán Kovács
Сергей Валерьевич
Ларионов Даниил
Роман Донченко
jonner
orbitcowboy
osy
parafin
RipleyTom
Seneral
saur0n
SomeAlphabetGuy
winterrace
xloem
Loading
Loading