Repository navigation
Razer BlackShark V2 Pro (PlayStation): charging state and the headset's own battery level - #626
Conversation
The headset keeps its own battery percentage (customer id 0x21) and charge state (id 0x2a: none, charging, full on the charger, and a fourth value of unknown meaning). Both are asked for with customer (type 0x08) GETs right after the voltage, while the dongle is in remote mode; the replies carry no sequence number and are matched by id. The headset also pushes both as notifications on link-up, on each percent change and when the charger is plugged in or out, which are picked up while any command waits for its reply. The headset's figure is preferred over the voltage estimate, which reads high on the charger. Only "charging" is reported as charging; full on the charger is available, and the unknown state forgets the last one. The GETs are skipped when the dongle was already in remote mode, which may be another tool's firmware update. Without them, the level still comes from the voltage, now with the battery table from the headset firmware 1.0.7. Also put a dongle found in remote mode back to local when the headset is not linked; until now only a linked headset triggered the restore. A failed attempt is not repeated within FAILURE_BACKOFF. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
A GET of id 0x21 returns the headset's raw percentage, which it works out from the voltage, while its notifications carry a filtered figure that only rises on the charger and only falls off it (the filter at 0x1ffb601a in the 1.0.7 firmware: max() while charging, min() while not). Using the raw figure made the level jitter by a point between reads. Notifications are still taken as they come; GET results now go through the same max()/min() filter, with "on the charger" meaning charging or full. The jump of a point or two when the charger is plugged in stays: the firmware's own figure makes it too, because the voltage rises. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 45096eca95
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Changes made
Follow-up to #620: the BlackShark V2 Pro for PlayStation now reports whether it is charging, and its battery level comes from the headset itself instead of only from the voltage.
On the charger the voltage reads high, so the old estimate was far off: at 4077 mV it said 90 % while the headset itself reported 54 %, and nothing said it was charging.
The headset keeps its own battery percentage and charge state and serves them as "customer" (type
0x08) frames. I found the handlers by reading the headset firmware that ships with Razer's updater (Andes NDS32) and checked them on the hardware:<id> 00 00; reply02 0e 50 49 08 .. .. .. .. 00 04 00 <id> 01 01 <value>, with no sequence number, only while the dongle is in remote mode0x21: battery percent. A GET returns the raw figure the headset works out from the voltage; notifications carry its filtered figure, which only rises on the charger and only falls off it (max()/min()in the firmware)0x2a: charge state, 0 none, 1 charging, 2 full on the charger, 3 meaning unknown02instead of01: on link-up, on every percent change, and when the charger is plugged in or out (notifications only carry 0 or 1 for the charge state)What the driver does with that:
max()/min()filter as the firmware's, so the level does not jitter between reads; notifications are taken as they come. The level still jumps by a point or two when the charger is plugged in, as the headset's own figure does, because the voltage risesBATTERY_CHARGING; "full on the charger" isBATTERY_AVAILABLE, and state 3 forgets the last state rather than keep claiming oneThe firmware's customer command space also holds actions (one of them deletes the pairing), so the driver only ever sends these two ids.
Unrelated fix in the same file: a dongle found in remote mode while no headset is linked is now put back in local mode. Before, only a linked headset triggered the restore, so a dongle left in remote mode by a crash stayed there. A failed attempt is not repeated within
FAILURE_BACKOFF.Testing
2a 02 01 00/2a 02 01 01notifications-bon the charger:BATTERY_CHARGING, 61 %, about 0.95 s, dongle back in local modeChecklist
🤖 Generated with Claude Code