Skip to content

vibes: harden AWINIC stop path and extend Vibe Log Info coverage#1712

Open
jplexer wants to merge 3 commits into
coredevices:mainfrom
jplexer:jp/firm-3361-notification-vibe-stop
Open

vibes: harden AWINIC stop path and extend Vibe Log Info coverage#1712
jplexer wants to merge 3 commits into
coredevices:mainfrom
jplexer:jp/firm-3361-notification-vibe-stop

Conversation

@jplexer

@jplexer jplexer commented Jul 15, 2026

Copy link
Copy Markdown
Member

Context

FIRM-3361 (recurrence of the FIRM-1538 / FIRM-2319 "notification vibrates endlessly until dismissed" family, now seen on getafix/Android as well as obelix/iOS).

Root-cause analysis: the notification vibe path has no software repeat — only phone_ui and alarm_popup use repeat timers. On the AWINIC haptic drivers, vibe_ctl(true) starts an open-ended hardware drive (AW86225: RAM loop mode with SEQ1 loop count 0xF = infinite loop; AW8623X: CONT mode with max drive times), so every moment of silence depends on a timed STOP sequence over I2C. The AW86225 stop path discarded every I2C return value: one transient I2C failure while stopping leaves the motor buzzing indefinitely with nothing in the logs, until the next unconditional vibe_ctl(false) — which is exactly what dismissing the notification does (vibes_cancel). This matches the reported symptom precisely.

Changes

  • aw8623x: fix uninitialized ret &= in vibe_set_strength — a failed CONTCFG6 write could never trip the assert.
  • aw86225: prv_aw862xx_play_go() now reports success; the stop path verifies the chip reached standby (including re-checking after the forced-standby fallback, which previously fired blind), retries once, and logs an error if the motor cannot be confirmed stopped.
  • vibe_pattern: the Vibe Log Info toggle now also elevates pattern-completion and pattern-clear logs (with live strength and dropped-step count at clear time). A capture showing trigger_start with no pattern complete, then a clear reporting nonzero strength, confirms the wedge; repeated trigger_start lines would instead indicate a software re-trigger.

Verification

  • getafix@dvt (AW8623X) and getafix@dvt2 (AW86225) build clean
  • 4/4 vibe unit test suites pass (test_vibe, test_vibe_score, test_vibe_score_info, test_vibe_intensity)
  • PRF variant compiles (link failure on main is pre-existing and unrelated)
  • Caveat: QEMU stubs the vibe driver, so the AW86225 stop-verify behavior needs a bench check on real getafix/obelix hardware.

FIRM-3361

🤖 Generated with Claude Code

jplexer and others added 3 commits July 15, 2026 16:24
The CONTCFG6 write result was accumulated into ret with &= before ret
was ever assigned, reading an uninitialized value; the following
CONTCFG7 write then overwrote ret entirely, so a failed CONTCFG6 write
could never trip the assert. Assign first, then accumulate.

FIRM-3361

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Joshua Jun <lets@throw.rocks>
The RAM waveform is configured with an infinite hardware loop
(WAVCFG9 SEQ1 loop count = 0xF), so once vibe_ctl(true) issues GO the
motor runs until a STOP sequence lands. The stop path ignored every
I2C return value: a single transient I2C failure while stopping left
the motor buzzing indefinitely with nothing in the logs, until the
next unconditional vibe_ctl(false) - typically the user dismissing
the notification (vibes_cancel). This matches the long-standing
"notification vibrates endlessly until dismissed" reports.

Make prv_aw862xx_play_go() report success, verify the chip actually
reached standby (including after the forced-standby fallback), retry
the stop once, and log an error if the motor could not be confirmed
stopped.

FIRM-3361

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Joshua Jun <lets@throw.rocks>
The Vibe Log Info toggle only elevated the trigger_start log, which
shows a pattern started but not whether it ever ended. For the
endless-notification-vibe reports the interesting question is exactly
that: did the final OFF step run, and what state did the cancel path
find when the user dismissed the notification.

Log pattern completion and pattern clear at the same
toggle-controlled level, including the live strength and dropped step
count at clear time: a clear that finds the motor on with no pattern
in progress is a wedged vibe. Also factor the toggle check into a
VIBE_PATTERN_LOG macro.

FIRM-3361

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Joshua Jun <lets@throw.rocks>
@jplexer
jplexer requested a review from gmarull as a code owner July 15, 2026 14:44

@gmarull gmarull left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will check more in detail tomorrow

#define AW862XX_PWR_OFF_TIME (2) /* ms */
#define AW862XX_PWR_ON_TIME (8) /* ms */
#define AW862XX_STOP_STANDBY_RETRIES (40)
#define AW862XX_STOP_ATTEMPTS (2)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless we are 100% sure this happens, we should not add a retry (yet). I'd for now log and see if this is observed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did logs contain e.g. an i2c xfer error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants