lib: send each feedback history event in its own packet #823
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
stale
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-streetpea/chiaki-ng!823
Loading…
Reference in a new issue
No description provided.
Delete branch "aoleg94/lib-feedback-history-per-event"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Button and touchpad events reach the console in "feedback history" packets. The console
appears to apply only one new event per packet, but
FeedbackSenderputs every event of acontroller state change into a single packet. Whenever two things change in the same update,
all but the newest event are dropped:
either the finger or the click held on the console, depending on the order. With the current
order (#748: touches before buttons) the finger lift is lost and the touch sticks; with the
reverse order the click release is lost, and after the next game switch the new game ignores
all input while the home screen still works.
This is likely why #748 changed the swipe behaviour ("unsure why this breaks swipe"): the order
only decides which event is lost.
Evidence
feedback_sender_send_history_packet) while reproducing on a PS5 from Android. A tap endedwith one packet containing both
80 91(click up) andc0 …(touch up), and the console keptwhichever came first as held. L2 and R2 changes in one packet behaved the same way.
(
Controller._button()→_add_event_buffer()→_send_event()), so it never batches.rarely hits this. It does with L2+R2 pressed together and with touchscreen tap emulation.
Change
chiaki_feedback_history_buffer_record_state()(new,feedback.c) records a state change andcalls back after each pushed event;
FeedbackSenderformats and queues one packet percallback, so every event gets its own sequence number. The resend window (last 4 events) is
unchanged.
the finger lands before the click, for a release the click lets go before the finger lifts,
like a real pad.
Testing
test/feedback.c(4 tests): tap release → 2 packets, click up first; touch + click press→ 2 packets, touch first; L2 + R2 → 2 packets; no change → no packet. Reverting to one packet
per state change fails 3 of them.
chiaki-unit: 114/114.no longer stick, touchpad clicks show up in Astro's touchpad test, L2+R2 together register both,
switching games after a touchpad click no longer leaves the new game ignoring input.
Notes
Developed with the assistance of Claude Code, and tested on real hardware as described above.
🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.