██╗ █████╗ ██╗ █████╗
██║ ██╔══██╗██║ ██╔══██╗
██║ ███████║██║ ███████║
██║ ██╔══██║██║ ██╔══██║
███████╗██║ ██║███████╗██║ ██║
╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
When Bluetooth dies after a kernel flash, the log already knows why.
Flash a custom kernel on a Qualcomm device and Bluetooth stops working. The device still boots, Wi-Fi
still connects, and the only clue is a few lines buried in dmesg that scroll past before Android
finishes starting. Reading them means an ADB session, a working USB driver, and knowing which of the
six common failure modes you are looking at.
This repo gives you two things:
- A Magisk module that captures the Bluetooth bring-up state at early boot — before the logs
rotate — and dumps it to
/sdcard/bt-logs/. No PC needed. - A log analyzer that reads those logs and tells you which failure it is, with evidence and a concrete fix.
Verified on POCO X3 NFC (surya / SM7150) with kernel 4.14.117-perf; the failure patterns are
generic Qualcomm hci_qca / WCN3990 and apply across the family.
| Code | What it means |
|---|---|
MODUL_HILANG |
Kernel cannot find hci_qca.ko (ENOENT, probe -2). The driver file is gone. |
DEVICE_HILANG |
UART ttyHS0 missing at probe (-19). Driver has nothing to attach to. |
VERMAGIC_MISMATCH |
Module was signed for a different kernel, or CONFIG_MODULE_SIG_FORCE is on. |
ABI_MISMATCH |
disagrees about version of symbol — the module was built against another kernel. |
FIRMWARE_GAGAL |
WCN3990 rampatch failed or timed out — firmware blobs missing after a ROM swap. |
RFKILL_KOSONG |
/dev/rfkill absent — CONFIG_RFKILL is not in the kernel config. |
Each hit comes with the raw log line as evidence and a specific fix.
Install magisk-module/ as a Magisk module (or flash the ZIP), reboot, then pull:
adb pull /sdcard/bt-logs
# or just copy the folder off the phoneWithout Magisk, the analyzer also accepts a folder you assembled by hand containing dmesg-bt.txt,
lsmod.txt, logcat-bt.txt, and friends.
git clone https://github.com/Coding-No/android-bt-diag
cd android-bt-diag
./run.sh /path/to/bt-logs # Linux / macOS / Termux / Kalisrc\android-bt-diag.bat C:\path\to\bt-logspython3 src/android_bt_diag/analyze.py /path/to/bt-logs # any platformAccepts either an extracted directory or the ZIP the collector produces.
── ERROR TERDETEKSI ──
[1] MODUL_HILANG
MASALAH : Kernel tidak menemukan file modul hci_qca.ko (ENOENT).
BUKTI : hci_qca: probe of 1c00000.serial failed with error -2
SOLUSI : Copy hci_qca.ko dari ROM asli ke /vendor/lib/modules/, lalu insmod manual.
[2] RFKILL_KOSONG
MASALAH : /dev/rfkill tidak dibuat kernel — Bluetooth stack Android wajib butuh ini.
BUKTI : rfkill_init failed
SOLUSI : Kernel harus punya CONFIG_RFKILL=y. Reflash kernel dengan config itu.
pip install . # or: pipx install .
android-bt-diag /path/to/bt-logsAnalyzer: Python 3.8+. Nothing else, ever — no pip install, no adb.
Collector: Magisk (or a rooted device using the manual file list).
Read this before filing an issue:
- Pattern matching, not magic. The analyzer matches known Qualcomm
hci_qca/ WCN3990 failure signatures. An unfamiliar failure mode is reported as "no known pattern" rather than guessed at. - Verified on one device family. The module targets Qualcomm (surya/SM7150 confirmed). Other SoCs (MediaTek, Exynos) have different Bluetooth stacks and are not covered.
- Collector needs root. Non-Qualcomm paths may not exist; missing files show as
HILANGinstead of a false pass. - It does not repair anything. It reads logs and prints a diagnosis. Flashing modules and copying kernel blobs stays manual, on purpose.
LALA — github.com/Coding-No
MIT — see LICENSE.