[Razer Phone 2 Guides, News, & Discussion] LSS4181:
Existing aptX codec libraries doesn't work on Android 10

It seems something's changed with Android 10 that existing aptX codec libraries no longer work, causing Bluetooth service to crash repeatedly. I just flashed Havoc 3.0 with available Magisk Modules that enabled aptX (mainly aimed for Oreo), and Bluetooth kept crashing. Removing the module fixed this though the headset would be operating in SBC mode as the GSI doesn't contain any codec libraries on its own.

The error is "null pointer dereference" and the stacktrace mentioned the function "a2dp_vendor_aptx_send_frames(unsigned long)". SBC currently doesn't cause any crashes (although I need to look for a way to improve its quality).

12-12 08:57:58.191 5073 5157 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 5157 (bt_a2dp_source_), pid 5073 (droid.bluetooth)
12-12 08:57:58.324 5643 5643 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-12 08:57:58.324 5643 5643 F DEBUG : Build fingerprint: 'Android/treble_arm64_bvN/phhgsi_arm64_ab:10/QQ1A.191205.011/expresslukeroms12062114:userdebug/release-keys'
12-12 08:57:58.324 5643 5643 F DEBUG : Revision: '0'
12-12 08:57:58.324 5643 5643 F DEBUG : ABI: 'arm64'
12-12 08:57:58.325 5643 5643 F DEBUG : Timestamp: 2019-12-12 08:57:58+0800
12-12 08:57:58.325 5643 5643 F DEBUG : pid: 5073, tid: 5157, name: bt_a2dp_source_ >>> com.android.bluetooth <<<
12-12 08:57:58.325 5643 5643 F DEBUG : uid: 1002
12-12 08:57:58.325 5643 5643 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
12-12 08:57:58.325 5643 5643 F DEBUG : Cause: null pointer dereference
12-12 08:57:58.325 5643 5643 F DEBUG : x0 000000753e21a008 x1 0000000000000001 x2 0000000000000a80 x3 0000000000001800
12-12 08:57:58.325 5643 5643 F DEBUG : x4 0000000000000000 x5 0000000000000000 x6 0000000000000000 x7 0000000000000001
12-12 08:57:58.325 5643 5643 F DEBUG : x8 000000755ba9d798 x9 00000000000002a0 x10 0000000000000000 x11 0000000000000a80
12-12 08:57:58.325 5643 5643 F DEBUG : x12 000000755bad9000 x13 00000000ffff36b4 x14 0000000000000000 x15 0000000000000000
12-12 08:57:58.325 5643 5643 F DEBUG : x16 00000000ffff36b4 x17 0000000000000000 x18 0000000000000000 x19 000000753e21a008
12-12 08:57:58.325 5643 5643 F DEBUG : x20 00000000000000e0 x21 000000755ba9d798 x22 00000075416b5020 x23 00000075416b3470
12-12 08:57:58.325 5643 5643 F DEBUG : x24 00000000000009a0 x25 00000075416b3e20 x26 00000000000002a0 x27 000000000000000e
12-12 08:57:58.325 5643 5643 F DEBUG : x28 00000000000004d0 x29 00000075416b4500
12-12 08:57:58.325 5643 5643 F DEBUG : sp 00000075416b32c0 lr 000000755b8c229c pc 000000755b842140
12-12 08:57:58.360 5643 5643 F DEBUG :
12-12 08:57:58.360 5643 5643 F DEBUG : backtrace:
12-12 08:57:58.360 5643 5643 F DEBUG : #00 pc 0000000000201140 /system/lib64/libbluetooth.so (btif_a2dp_source_enqueue_callback(BT_HDR*, unsigned long, unsigned int) [clone .cfi]+4) (BuildId: 4e8020f96512dcac7c2ad7f9bfb5386f)
12-12 08:57:58.360 5643 5643 F DEBUG : #01 pc 0000000000281298 /system/lib64/libbluetooth.so (a2dp_vendor_aptx_send_frames(unsigned long) [clone .cfi]+1084) (BuildId: 4e8020f96512dcac7c2ad7f9bfb5386f)
12-12 08:57:58.360 5643 5643 F DEBUG : #02 pc 00000000002027b8 /system/lib64/libbluetooth.so (btif_a2dp_source_audio_handle_timer() [clone .cfi]+340) (BuildId: 4e8020f96512dcac7c2ad7f9bfb5386f)
12-12 08:57:58.360 5643 5643 F DEBUG : #03 pc 00000000001a57d8 /system/lib64/libbluetooth.so (bluetooth::common::RepeatingTimer::RunTask()+568) (BuildId: 4e8020f96512dcac7c2ad7f9bfb5386f)
12-12 08:57:58.360 5643 5643 F DEBUG : #04 pc 00000000000a05c4 /system/lib64/libchrome.so (base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*)+188) (BuildId: 1a553d34f663318b9276a7b70c48fe06)
12-12 08:57:58.360 5643 5643 F DEBUG : #05 pc 00000000000bfb88 /system/lib64/libchrome.so (base::MessageLoop::RunTask(base::PendingTask*)+308) (BuildId: 1a553d34f663318b9276a7b70c48fe06)
12-12 08:57:58.360 5643 5643 F DEBUG : #06 pc 00000000000c0138 /system/lib64/libchrome.so (base::MessageLoop::DoDelayedWork(base::TimeTicks*)+488) (BuildId: 1a553d34f663318b9276a7b70c48fe06)
12-12 08:57:58.360 5643 5643 F DEBUG : #07 pc 00000000000c164c /system/lib64/libchrome.so (base::MessagePumpDefault::Run(base::MessagePump::Delegate*)+92) (BuildId: 1a553d34f663318b9276a7b70c48fe06)
12-12 08:57:58.360 5643 5643 F DEBUG : #08 pc 00000000000e32b8 /system/lib64/libchrome.so (base::RunLoop::Run()+84) (BuildId: 1a553d34f663318b9276a7b70c48fe06)
12-12 08:57:58.360 5643 5643 F DEBUG : #09 pc 000000000019b6bc /system/lib64/libbluetooth.so (bluetooth::common::MessageLoopThread::Run(std::__1::promise<void>)+304) (BuildId: 4e8020f96512dcac7c2ad7f9bfb5386f)
12-12 08:57:58.360 5643 5643 F DEBUG : #10 pc 000000000019b468 /system/lib64/libbluetooth.so (bluetooth::common::MessageLoopThread::RunThread(bluetooth::common::MessageLoopThread*, std::__1::promise<void>) [clone .cfi]+48) (BuildId: 4e8020f96512dcac7c2ad7f9bfb5386f)
12-12 08:57:58.360 5643 5643 F DEBUG : #11 pc 000000000019b500 /system/lib64/libbluetooth.so (_ZNSt3__114__thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEPFvPN9bluetooth6common17MessageLoopThreadENS_7promiseIvEEESA_SC_EEEEEPvSG_.cfi+100) (BuildId: 4e8020f96512dcac7c2ad7f9bfb5386f)
12-12 08:57:58.361 5643 5643 F DEBUG : #12 pc 00000000000e22b0 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: 8b44db81e9e81345d762ad1200226b86)
12-12 08:57:58.361 5643 5643 F DEBUG : #13 pc 0000000000083ab0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 8b44db81e9e81345d762ad1200226b86)
12-12 08:57:58.833 1593 5652 I DropBoxManagerService: add tag=system_app_native_crash isTagEnabled=true flags=0x2
12-12 08:57:58.837 1593 1885 I BootReceiver: Copying /data/tombstones/tombstone_02 to DropBox (SYSTEM_TOMBSTONE)
12-12 08:57:58.839 1593 1847 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
12-12 08:57:58.839 1593 1847 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
12-12 08:57:58.839 1593 1885 I DropBoxManagerService: add tag=SYSTEM_TOMBSTONE isTagEnabled=true flags=0x2
12-12 08:57:58.856 1593 1847 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
12-12 08:57:58.858 1593 1847 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
12-12 08:57:58.927 1593 5253 W BluetoothManagerService: Profile service for profile: ComponentInfo{com.android.bluetooth/com.android.bluetooth.hfp.HeadsetService} died.
12-12 08:57:58.929 1593 1593 I Telecom : BluetoothDeviceManager: Lost BluetoothHeadset service. Removing all tracked devices.: BMSL.oSD@ANg
12-12 08:57:58.929 1593 1593 I Telecom : BluetoothDeviceManager: Lost BluetoothHeadset service. Removing all tracked devices.: BMSL.oSD@ANk
12-12 08:57:58.929 1593 5437 I Telecom : BluetoothRouteManager: Message received: LOST_DEVICE.: BMSL.oSD->BRM.pM_2@ANg

Are there any updated Bluetooth aptX codec libraries available? Or maybe this GSI build (2019-12-06) might have issues...