Fix Bluetooth 5.x/6.x headsets, Android OBEX prompts, and refresh a1120 images

- Scope WirePlumber 50-bluetooth.conf roles to [ a2dp_sink hsp_hs hfp_hf ], lock HFP to 8 kHz CVSD for QDSP6 INTERNAL_BT_SCO, enable dummy AVRCP player, and set LDAC ABR quality.
- Select BR/EDR bearer and ConnectProfile fallback for Classic Audio headsets while preserving LE bearer for HOGP devices, forward AVRCP media keys to music.so, bound discoverability to 60 s, fix SCO keepalive teardown/readiness and ATA call state sync, and suppress nokia-sparkler speaker haptic audio during BT SCO.
- Advertise Smartphone Class of Device (0x5a020c / btmgmt class 2 3), handle OBEX over both L2CAP SOCK_SEQPACKET and RFCOMM SOCK_STREAM via ObexPacketReader, and add NeoUI incoming file Accept/Reject dialog and configurable target folder picker in networks.so.
- Add scripts/test-bluetooth-headset.py and scripts/test-bluetooth-obex.py, and rebuild/pin verified a1120 (cocojamboo) images and release archives for nokia-argon, nokia-beatles, nokia-coconut, and nokia-sparkler.
This commit is contained in:
Luxferre committed 2026-11-17 10:33:09 +02:00
1 parent 0030dc3910
commit 36a5f8cb8a
29 files changed
+2011 -190

No files matched your search

+10 -4
View File
@@ -14,6 +14,12 @@ Release versions follow the `<year-letter><MM><DD>` format (where `2026` is `a`,
Upcoming release build (`a1120` / `cocojamboo` via `scripts/version.sh`) targeting **Nokia 8110 4G (`nokia-argon`)**, **Nokia 2720 Flip (`nokia-beatles`)**, **Nokia 800 Tough (`nokia-coconut`)**, and **Nokia 8000 4G (`nokia-sparkler`)** while keeping `a1114` (`carbonara`) as the current published release.
### Bluetooth 5.x/6.x headset support (`A2DP` + `HSP/HFP`), Android OBEX file transfer, AVRCP controls, and power safeguards across all targets
- **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`.
### Nokia 8000 4G (`nokia-sparkler`) hardware-verified `lk2nd`, 4-core SMP/`cpufreq`, 157 Hz haptic audio, camera, and EDL bring-up
- **Layered `lk2nd` port (`bootloader/lk2nd/nokia-sparkler.patch`)**: added `nokia-sparkler.dtsi` (`msm8909-mtp.dts` `/lk2nd/nokia-sparkler`, matching `androidboot.hw.name=sparkler` without requiring `lk2nd,match-panel;`, GC9307 HLT 15-command and ST7789VX2 CTC 11-command 2.8" SPI init streams on BLSP1 QUP5 `0x078b9000`, `*` on `gpio90` as `KEY_VOLUMEUP` `0x115` alongside `#` `pm8941_resin` and Top Power) plus `"nokia,sparkler"` / `"nokia,leo"` support in `spi-display.c`; added `scripts/build-lk2nd-sparkler.sh`, `scripts/check-lk2nd-sparkler.py`, and `scripts/test-lk2nd-sparkler-port.py`, building `images/boot-lk2nd-nokia-sparkler{,-diagnostic,-display}.img` without altering `nokia-beatles` or `nokia-coconut` `lk2nd` images.
@@ -66,10 +72,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 `6b5c17059bf0341fdeb84c85dca08e64eb6b634e71add27fb9b7a93d17fb7ed8` (packaged in `bananarchy-nokia-argon-a1120-cocojamboo.zip`, SHA-256 `5b5c9eb85992a4531e960d3f00e4551366ec9abcf787f521e3400e81e5a8cbc5`, alongside `bootloader/lk2nd-msm8909.img`).
- `images/bananarchy-nokia-beatles.img`: SHA-256 `c6dad8d28ab3ab478869a0adb78dac1af4e19c111ab60a066687656c103e5723`, `images/boot-bananarchy-nokia-beatles.img`: SHA-256 `4fd4b19d525677b2e2880346b391d9a13447d62f8ad61ee0088421a100ec08dc`, and `images/boot-lk2nd-nokia-beatles-display.img`: SHA-256 `b5549698c20f4de7603fc746d32bb5baa96ec377e41e74407823c98506fc185d` (packaged in `bananarchy-nokia-beatles-a1120-cocojamboo.zip`, SHA-256 `476dd86e7078488126c08151a586cebc94f52a03d588cb0b18d7589430cee252`).
- `images/bananarchy-nokia-coconut.img`: SHA-256 `77addc7d48e40cdd017dc247969131e9ab7bc87ad590faf879d36c03b66df65c`, `images/boot-bananarchy-nokia-coconut.img`: SHA-256 `a5869b63de5cbfca3f6d87583aba162023670945f69a57276b597e1a7b85c5b2`, and `images/boot-lk2nd-nokia-coconut-display.img`: SHA-256 `e876424b38b0782f589756b4107337b24f27f7c37d624cc7d3907a5331df050a` (packaged in `bananarchy-nokia-coconut-a1120-cocojamboo.zip`, SHA-256 `70b6330654490843c07e9a47b5d509811038f5152d8030fdb8740437485e2df6`).
- `images/bananarchy-nokia-sparkler.img`: SHA-256 `a41a6ed4c2a04d521cf44d5229680f292972a4fc06ff3ad177cc3a13659295d1`, `images/boot-bananarchy-nokia-sparkler.img`: SHA-256 `e950788360e1044d5ef128d1a170b868620aa5c356354aa6ac7178218e4d8e38`, and `images/boot-lk2nd-nokia-sparkler-display.img`: SHA-256 `bc41c2ddd1079246a7e91a40222fcafb82b0b52965c8ee8081872767d006748f` (packaged in `bananarchy-nokia-sparkler-a1120-cocojamboo.zip`, SHA-256 `1e1c1f9f28b8d891b25701a01baeaebb54dee3368f40e6e12564fc53243a76a4`).
- `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`).
---