Repository navigation
Bluetooth: pad battery and PIN message, keyboards and mice, headphones (A2DP) prototype - #19
Open
KurdtNervanna wants to merge 3 commits into
Open
KurdtNervanna wants to merge 3 commits into
KurdtNervanna wants to merge 3 commits into
Conversation
…s a PIN or cable rsos-bt list adds an optional 4th field (BlueZ Battery Percentage) for a connected device; the screen shows "connected, 85%". A pairing that fails with AuthenticationFailed or a PIN/passkey request now says the pad needs a PIN or a USB cable first. Tests, docs and rsos.pot updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Author
|
A note on CI: the board script tests job fails on this PR, but not in the tests themselves. Its first step ( Once the server answers, a re-run of that job should be enough. I can't re-run it from the fork, so I'll leave it for you; tell me if you would rather I push a small commit to retrigger CI. |
A trackpad, tablet or a pad's touchpad node (absolute X, 4+ buttons, no KEY_A) was taken for an unconfigured gamepad and got a player port. Move the node classification into classify_dev() and exclude pointers from the generic heuristic (explicit pad bits still win). Test: make check-input (classify). docs/input-design.md: what works for USB/Bluetooth keyboards and mice today and what is not built (core keyboard/mouse forwarding, menu cursor). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…creen - defconfigs (retrostone2 + release): BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_AUDIO, BR2_PACKAGE_BLUEZ_ALSA (names checked against Buildroot 2026.02.3) - rsos-net: bluealsa -p a2dp-source (the daemon name in bluez-alsa 4.3.1) with bluetoothd - rsos-bt: audio=headphones in the list extras field for A2DP sinks (cached), rsos-bt sink - frontend audio: try plug:bluealsa first (120 ms buffer), fall back to the card when it does not open or the sink vanishes; settings audio_bluetooth - devices screen: headphones shown/worded as such; stub tests, check-ui - docs/bluetooth-audio.md: design and the risks to measure on hardware Untested on hardware. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KurdtNervanna
added a commit
to KurdtNervanna/RetroStoneOS
that referenced
this pull request
Nov 21, 2026
…dphones prototype) into pro-storage The three commits of upstream PR PaddleStroke#19. Conflicts: README docs table (both rows kept), test_input.c (both test sets kept), rsos.pot (regenerated), and input.c, where the fork's caps_are_pad() and the branch's classify_dev() guard against the same thing: classify_dev() now calls caps_are_pad() for the generic pad case, so touch pads, multitouch nodes, keys named A, mice, pens and finger tools are all kept out of the player ports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows the Bluetooth devices screen (Settings > Network > Bluetooth devices, issue #13). This PR replaces #19 and #20 and adds a third part, Bluetooth headphones. It is three commits, one per part, so each part can be reviewed or dropped separately:
Bluetooth devices: pad battery level, clearer message when a pad needs a PIN or cable(was Bluetooth: pad battery and PIN message, keyboards and mice, headphones (A2DP) prototype #19)input: a pointer is no gamepad; document Bluetooth keyboards and mice(was input: a pointer is no gamepad; document Bluetooth keyboards and mice #20)Bluetooth headphones (A2DP) prototype: bluez-alsa, routing, pairing screen(new, prototype)The shared
rsos-bt listformatParts 1 and 3 both add information to the device list, so they share one optional 4th field. It holds a comma-separated list of
key=valueextras. The frontend ignores keys it does not know, so more can be added later. A device with no extras still has three fields, as before:battery=N: the BlueZ "Battery Percentage" (bluetoothctl info) of a connected device that reports one.audio=headphones: the device is an A2DP sink, meaning its UUID is110bor its icon isaudio-*. The answer is cached in/run/rsos-bt/kindsbecause the list is rebuilt every 1.5 s.1. Pad battery level and the PIN/cable message
rsos-bt listaddsbattery=85for a connected device that reports its battery. The screen then shows "connected, 85%".AuthenticationFailed, or that asks for a PIN or passkey, now gets a message saying the controller needs a PIN or a USB cable first, instead of the generic "put it in pairing mode". A PlayStation 3 pad is an example.bt-test.sh(the battery field from the stubbluetoothctl) andmake check-ui(a fake helper withFAKE_BT_FAIL=pinshows the new dialog). Docs:docs/build.md. Two new messages are inrsos.pot.2. Keyboards and mice: a pointer is not a gamepad
classify_dev()infrontend/src/input/input.cnow holds the node classification: pad, keyboard or nothing.KEY_A) used to be taken for an unconfigured gamepad and got a player port. Pointers are now excluded from the generic heuristic. A node with explicit pad bits (BTN_GAMEPAD,BTN_JOYSTICK,BTN_TRIGGER_HAPPY) is still a pad.frontend/tests/test_input.c(make check-input,classify).docs/input-design.mdhas a new "Keyboards and mice" section on what works today with USB and Bluetooth keyboards and mice: a keyboard works in the menus and for the in-game hotkeys, and a mouse is ignored. It also lists what is not built yet: keyboard and mouse forwarding to cores, a menu cursor, and a device-type label in the list. The README has one extra sentence about it.3. Bluetooth headphones (A2DP): prototype
BR2_PACKAGE_BLUEZ_ALSA(bluez-alsa 4.3.1: thebluealsadaemon, the ALSA plugin, SBC) andBR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_AUDIOare added toretrostone2_defconfigandretrostone2_release_defconfig. The option names were checked against the Buildroot 2026.02.3 sources. The other boards have no Bluetooth, so their configs are unchanged. AAC, aptX and LDAC are not built, only SBC.rsos-net bt onstartsbluealsa -p a2dp-sourcenext to bluetoothd, andbt offstops it. In 4.3.1 the daemon is calledbluealsa;bluealsadis the name in later releases. Headset and hands-free profiles are not enabled.audio_open()first triesplug:bluealsa, which fails to open when no sink is connected, and uses a buffer of at least 120 ms there. If that fails it falls back to the existing card choice (HDMI or the codec), unchanged. If the sink disappears during a game (-ENODEV), the host reopens on the card. The settings keyaudio_bluetooth = falsekeeps the sound on the card.rsos-bt sinkexits 0 when an A2DP sink is connected, for scripts and for a future native-game launcher (AUDIODEV=plug:bluealsa).docs/bluetooth-audio.mdcovers the design, the routing rule, volume, and the list of things to measure. There is a README docs-table row for it.bt-test.shhas a stub headphone device (theaudio=headphonesextra,sink, and forget clears the kind cache).make check-uipairs headphones successfully and also shows the headphones failure message.Hardware risks that have to be measured before this is a feature:
latency_bt_msis a guess that needs tuning.bluealsadaemon has to encode while a heavy core runs (N64, PSX). This needs CPU and underrun counts.bluealsadaemon is never in the signalled group.bt off/oncycles, idle power, and the D-Bus policy fororg.bluealsa.What was tested
Host only, on WSL Ubuntu:
buildroot-external/board/common/tests/bt-test.sh: 23 ok, 0 failedbuildroot-external/board/common/tests/release-defconfig-test.sh: ok (retrostone1 and retrostone2 release blocks)buildroot-external/board/common/tests/board-sh-test.sh: 11 passed, 0 failed (sh)frontend:make check-input,make check-ui,make check-i18nand the fullmake checkall pass (exit 0, ending incheck-frontend: OK)po/rsos.potcontains only the new and changed messages. A fullmake potalso moves source references in files this PR does not touch (screens.c,storage.c, …), because those were already out of date onmain. That churn is left out.Not tried: no real Bluetooth pad, keyboard, mouse or headphones, and no RetroStone2. Pairing, the battery readout, the PIN message, keyboard and mouse classification, and all of the audio part have only been checked against stub
bluetoothctloutput and fake input devices. shellcheck was not run locally because it is not installed. The U-Boot host-tools part of the board script tests could not run either, because the download from ftp.denx.de fails.CI note: the upstream CI board-script job currently fails on that same ftp.denx.de U-Boot download. The failure is in the job's setup, not in these changes.
🤖 Generated with Claude Code