Fix Bluetooth KeyboardDisplay pairing agent, MGMT flags, and refresh a1120 images

- Switch bananarchy-bt-obex Agent1 from NoInputNoOutput to KeyboardDisplay with /run/bananarchy/bt-obex/pair_{prompt,decision}.tsv and op_done.tsv IPC, auto-confirming Classic Audio headsets while prompting user confirmation, PIN, passkey, or keyboard display codes.
- Enforce bredr on, ssp on, linksec on, bondable on, advertising off, class 2 3, and le on in bananarchy-bt-le-enable.sh alongside PairableTimeout = 0 in main.conf (keeping DiscoverableTimeout = 60 hidden by default) and boot hook sync in sxmo_hook_start.sh.
- Fix root/user daemon UID collisions and sticky-/tmp status/PID writes, separate phones from Classic Audio headsets, increase Pair timeout to 50 s, and add non-blocking --async-ui pairing/connect plus NetModal::BtPairingPrompt in networks.so.
- Extend scripts/test-bluetooth-obex.py, scripts/test-bluetooth-headset.py, scripts/check-rebuild.sh, docs, and rebuild/pin a1120 (cocojamboo) images and archives for nokia-argon, nokia-beatles, nokia-coconut, and nokia-sparkler.
This commit is contained in:
Luxferre committed 2026-11-17 11:30:42 +02:00
1 parent 36a5f8cb8a
commit 1e1fe7c317
17 files changed
+1387 -326

No files matched your search

+5 -4
View File
@@ -16,6 +16,7 @@ Upcoming release build (`a1120` / `cocojamboo` via `scripts/version.sh`) targeti
### Bluetooth 5.x/6.x headset support (`A2DP` + `HSP/HFP`), Android OBEX file transfer, AVRCP controls, and power safeguards across all targets
- **Android SSP/PIN/Passkey pairing agent & NeoUI confirmation popup (`etc/bluetooth/main.conf`, `bananarchy-bt-le-enable.sh`, `sxmo_bluetoothtoggle.sh`, `sxmo_hook_start.sh`, `bananarchy-bt-obex`, `networks_plugin.cpp`)**: switched the persistent `Agent1` capability from dummy `"NoInputNoOutput"` (which replied `"0000"` / `0` with zero prompt and tripped BlueZ/WCNSS `"incorrect PIN or passkey"`) to `"KeyboardDisplay"` backed by `/run/bananarchy/bt-obex/{pair_prompt,pair_decision,op_done}.tsv` IPC and `NetModal::BtPairingPrompt` (`CONFIRM` 6-digit passkey match, keypad `PIN` / `PASSKEY` entry, `DISPLAY` keyboard code, and `Cancel`/`Close` rejection, while auto-confirming screenless Classic Audio headsets); enabled `bredr on`, `ssp on`, `linksec on`, `bondable on`, and `advertising off` alongside `class 2 3` and `le on` in `bananarchy-bt-le-enable.sh` (`PairableTimeout = 0` in `main.conf` while keeping `DiscoverableTimeout = 60` hidden by default); fixed root/`user` daemon UID collisions and sticky-`/tmp` PID/status writes (`errno != EPERM` + `doas -n bananarchy-bt-obex start` + boot hook restart when BT is enabled); made `networks_plugin.cpp` `Connect`/`Pair` non-blocking (`--async-ui`), prevented `cli_agent` hijacking and 8 s `Pair` aborts (`50 s` timeout), and fixed phone `Icon: phone`/`computer` (`OBEX/PAN`) vs Classic Audio classification across `queryBtDevices()` and `is_phone_or_computer_props()`.
- **Android OBEX (`0x1105`) recognition, L2CAP `SOCK_SEQPACKET`, and incoming file Accept/Reject + Target Folder UI (`etc/bluetooth/main.conf`, `50-bluetooth.conf`, `bananarchy-bt-le-enable.sh`, `sxmo_bluetoothtoggle.sh`, `bananarchy-bt-obex`, `networks_plugin.cpp`)**: added `Class = 0x5a020c` (`Phone / Smartphone` with `Object Transfer`) in `main.conf`, set `btmgmt -i hci0 class 2 3` at power-on/LE-enable, and removed `a2dp_source` from `50-bluetooth.conf` (`bluez5.roles = [ a2dp_sink hsp_hs hfp_hf ]`) so paired Android phones recognize Bananarchy as a phone supporting OBEX Object Push rather than a Bluetooth audio sink; replaced `recv(3)` with `ObexPacketReader` handling full L2CAP `SOCK_SEQPACKET` (GOEP 2.0) datagrams alongside RFCOMM `SOCK_STREAM`; registered BlueZ `OPP_UUID` (`0x1105`) with retries before falling back to raw RFCOMM channel 9 bind; added `/run/bananarchy/bt-obex/{prompt,decision}.tsv` IPC with an interactive `networks.so` prompt (`Accept & Save File`, `Dir: ... [Set]`, `Reject Transfer` returning OBEX `0xC3` Forbidden) and interactive `ObexDirPicker` / `ObexActions` directory chooser (`~/.config/sxmo/bt_obex_dir`, supporting `/media/sdcard`, custom folders, and duress confinement); verified via `scripts/test-bluetooth-obex.py`.
- **Dual-bearer BR/EDR audio selection & PipeWire role/codec fixes (`bananarchy-bt-obex`, all four `50-bluetooth.conf` copies)**: kept `ControllerMode = dual` and `PreferredBearer = "le"` for HOGP (`00001812-`) while adding Classic Audio (`0000110b-`/`0000111e-`/`00001108-`/`audio-*`) detection (`set_audio_preferred_bearer()` -> `PreferredBearer = "bredr"`), `public` BR/EDR ranking over `random` BLE beacons in `find_matching_device()`/`scan_for_device()`, and `ConnectProfile` fallback so dual-mode Bluetooth 5.x/6.x earbuds do not stop on a GATT-only BLE link; updated `50-bluetooth.conf` across `/etc/`, `/usr/share/`, `/home/user/`, and `/etc/skel/` to restrict roles to `[ a2dp_sink hsp_hs hfp_hf ]` (removing `a2dp_source`, `bap_sink`/`bap_source`, and `hsp_ag`/`hfp_ag`), disable `msbc` and `lc3-a127`/`lc3` so HFP locks to 8 kHz `cvsd` for QDSP6 `INTERNAL_BT_SCO`, fix `opus_05_dup` -> `opus_05_duplex`, set `bluez5.dummy-avrcp-player = true`, and enable `bluez5.a2dp.ldac.quality = "auto"` (ABR) + `aac.bitratemode = 0` for 2.4 GHz Wi-Fi coexistence.
- **SCO keepalive race, missing `pkill` leak, headset `ATA` call pickup, AVRCP media keys, and `nokia-sparkler` haptic guard (`sxmo_audio.sh`, `sxmo_modemaudio.sh`, `callscreen_plugin.cpp`, `networks_plugin.cpp`, `music_plugin.cpp`, `sxmo_vibrate.c`)**: replaced missing `pkill` in `stop_bt_sco_keepalive()` with `/proc` + `ps` teardown and stopped keepalive unconditionally when switching off Bluetooth HFP (even mid-call); added bounded (`25 x 0.1 s` / `15 x 0.1 s`) sink readiness waits and direct `$bt_sink` volume/mute mirroring (`+VGS`/AVRCP); synced `/tmp/sxmo_in_call` and `.pickedupcall` in `callscreen_plugin.cpp` when calls transition active via headset `ATA` so hangup restores A2DP and avoids false Missed Call logs; forwarded BlueZ `(AVRCP)` input keys to `music.so` (`PLAYPAUSE`/`PLAY`/`PAUSE`/`STOP`/`NEXT`/`PREV`) via the 0%-CPU `select()` bridge in `bananarchy-bt-obex` and handled `XF86XK_AudioPlay`/`Pause`/`Stop`/`Next`/`Prev` in `music_plugin.cpp`; refreshed stale `targetBt` after `Pair`/`Connect` in `networks_plugin.cpp` with a 24-device `info` batch cap; added `/tmp/sxmo_bt_sco_mm_active` suppression in `sxmo_vibrate.c` so 157 Hz haptic audio cannot leak over non-call BT SCO on `nokia-sparkler`; and changed `bt_discoverable` defaults across `sxmo_bluetoothtoggle.sh`, `bananarchy-bt-obex`, and `networks_plugin.cpp` to hidden-by-default with a 60 s discoverable timeout. Verified via `scripts/test-bluetooth-headset.py` alongside `test-bluetooth-{hid,scan,live-scan}.py` and `scripts/check-rebuild.sh`.
@@ -72,10 +73,10 @@ Upcoming release build (`a1120` / `cocojamboo` via `scripts/version.sh`) targeti
### Image persistence and upcoming `a1120` (`cocojamboo`) release archives
- **Verified `a1120` / `cocojamboo` image set (`--mkinitfs`) and packaged archives**:
- `images/bananarchy-nokia-argon.img`: SHA-256 `92b23d34180c157861c492e7c2ea848ea4580857f3c1674020ae6b9f6fbdd39f` (packaged in `bananarchy-nokia-argon-a1120-cocojamboo.zip`, SHA-256 `f3680c940ba95f063822e033c60fc18faa3fd20faab4dcec558445d6d1d828f0`, alongside `bootloader/lk2nd-msm8909.img`).
- `images/bananarchy-nokia-beatles.img`: SHA-256 `5c284c314a378d09fda37e56ebe745ab557d45c77499206440e8c362c709e7a7`, `images/boot-bananarchy-nokia-beatles.img`: SHA-256 `80485ccf2af4f1d6107965ecde43d888c66ec19006e6feabc7fb63b6a7852391`, and `images/boot-lk2nd-nokia-beatles-display.img`: SHA-256 `b5549698c20f4de7603fc746d32bb5baa96ec377e41e74407823c98506fc185d` (packaged in `bananarchy-nokia-beatles-a1120-cocojamboo.zip`, SHA-256 `1d2849c73dcf3d0bf8d0e2417778366bd726442556567ab9180e314951a5b993`).
- `images/bananarchy-nokia-coconut.img`: SHA-256 `4e1d4799d42f56423f9cba8e175adf3b1f6c7fcd89965a7bc0b84a4f03ebc6e5`, `images/boot-bananarchy-nokia-coconut.img`: SHA-256 `1e22879fc0533f419dc98c88a1700d75101fda85669837d1457bb15b9ab4ed9c`, and `images/boot-lk2nd-nokia-coconut-display.img`: SHA-256 `e876424b38b0782f589756b4107337b24f27f7c37d624cc7d3907a5331df050a` (packaged in `bananarchy-nokia-coconut-a1120-cocojamboo.zip`, SHA-256 `af06ab7bbb3933732f644d24acb03d04ef066d59aae0c2009d0c9cf367bec4d1`).
- `images/bananarchy-nokia-sparkler.img`: SHA-256 `6b40db4674821bdde80d6f7619acc5a6414df684201d3e4e2e7cc3ac6c25dcfd`, `images/boot-bananarchy-nokia-sparkler.img`: SHA-256 `8f41328f0197f5debba92eaffa9df46c530721719309024a4d9cd7bf79a722c7`, and `images/boot-lk2nd-nokia-sparkler-display.img`: SHA-256 `bc41c2ddd1079246a7e91a40222fcafb82b0b52965c8ee8081872767d006748f` (packaged in `bananarchy-nokia-sparkler-a1120-cocojamboo.zip`, SHA-256 `0ca08f7a58e517fce283028548ba6d7657c419e823782fe188c75b0fbd93d378`).
- `images/bananarchy-nokia-argon.img`: SHA-256 `09c46d21b140b486e21ebed39740b57808f8f1f0045f1801af2a7f8eba72bb4d` (packaged in `bananarchy-nokia-argon-a1120-cocojamboo.zip`, SHA-256 `5a290c236aa85828fb0b8a9bf6e2a7afa8ebe10c9d2819617661e8c0cb53d3ff`, alongside `bootloader/lk2nd-msm8909.img`).
- `images/bananarchy-nokia-beatles.img`: SHA-256 `5d8c50f89e257dbadd9050479d56c46b1902cb38707f6f692e3508b44aa4fd10`, `images/boot-bananarchy-nokia-beatles.img`: SHA-256 `f6c897f8e5fac17df38ac3d3222279f229b84c53ea73c323d06de5c40b26ccc0`, and `images/boot-lk2nd-nokia-beatles-display.img`: SHA-256 `b5549698c20f4de7603fc746d32bb5baa96ec377e41e74407823c98506fc185d` (packaged in `bananarchy-nokia-beatles-a1120-cocojamboo.zip`, SHA-256 `a49d0d905af1ea5350bc1197e7970f59296359a913e3a09afc46c06aaf80d891`).
- `images/bananarchy-nokia-coconut.img`: SHA-256 `836331fb3034d0527f8c03eb90aae25bc8c87a84cc56baf24459d2e81e7a28d1`, `images/boot-bananarchy-nokia-coconut.img`: SHA-256 `6e2fefec812594dc7b4dc322c68b1ab4c10b1c93abee4a0fbd11dfbf2dc59a0b`, and `images/boot-lk2nd-nokia-coconut-display.img`: SHA-256 `e876424b38b0782f589756b4107337b24f27f7c37d624cc7d3907a5331df050a` (packaged in `bananarchy-nokia-coconut-a1120-cocojamboo.zip`, SHA-256 `68af7997cbe1227d49e5238cabbbfcb44dcb728e8456b0fd0d416477307074b2`).
- `images/bananarchy-nokia-sparkler.img`: SHA-256 `61a068ca432f064812a96356b0dc49f1a38102a717c8dccd31768f0cbd1d7639`, `images/boot-bananarchy-nokia-sparkler.img`: SHA-256 `4357d48ac069104495629f1f35e220a01cde3412950e73e3e47e5372649fb6a2`, and `images/boot-lk2nd-nokia-sparkler-display.img`: SHA-256 `bc41c2ddd1079246a7e91a40222fcafb82b0b52965c8ee8081872767d006748f` (packaged in `bananarchy-nokia-sparkler-a1120-cocojamboo.zip`, SHA-256 `73951ce01b3ff8f782488333767101d8e83701ae3822b1c7a0bef6ab8e96d1dc`).
---