Skip to content

fw/services/alarms: add sound playback with selectable tones#1259

Closed
spr4bhu wants to merge 6 commits into
coredevices:mainfrom
spr4bhu:sound-enabled-alarms
Closed

fw/services/alarms: add sound playback with selectable tones#1259
spr4bhu wants to merge 6 commits into
coredevices:mainfrom
spr4bhu:sound-enabled-alarms

Conversation

@spr4bhu
Copy link
Copy Markdown
Contributor

@spr4bhu spr4bhu commented May 8, 2026

This PR adds audio playback to alarms on speaker-capable hardware (Pebble 2 Duo, Pebble Time 2). Each alarm has independent sound and vibration toggles plus a selectable tone (Reveille, Beacon, Bell, Chime). Off by default for existing alarms; new alarms on speaker hardware default to sound + vibration on.

Changes:

  • Add sound_enabled, vibrate_enabled, tone fields to AlarmConfig, bit-packed into the existing is_smart union no struct size change. Negative-logic vibrate_disabled bit chosen so legacy data (all bits 0) loads as vibrate-on, sound-off, preserving current behavior on upgrade.
  • Add alarm_tones library (src/fw/services/alarms/alarm_tones.c) with 4 in-code SpeakerNote[] arrays. No resource files needed.
  • Wire speaker_service_play_note_seq into alarm_popup.c at SpeakerPriorityCritical, looping via the speaker finish event until dismiss/snooze/timeout. Skipped in low-power mode.
  • Extend alarm_detail.c with a Sound submenu (Off + 4 tones) and a Vibration toggle, mirroring the existing snooze-delay pattern.
  • Add alarm_id to PebbleAlarmClockEvent so the popup can look up the firing alarm's settings.
  • All speaker-side code gated on CAPABILITY_HAS_SPEAKER; non-speaker boards are unaffected.

Resolves #1206

@spr4bhu spr4bhu requested review from gmarull and jplexer as code owners May 8, 2026 08:13
@sjp4
Copy link
Copy Markdown
Member

sjp4 commented May 8, 2026

new alarms on speaker hardware default to sound + vibration on

Please no!

@spr4bhu
Copy link
Copy Markdown
Contributor Author

spr4bhu commented May 8, 2026

Please no!

is the no for default being sound + vibration or is there something else too?

@sjp4
Copy link
Copy Markdown
Member

sjp4 commented May 8, 2026

Please no!

is the no for default being sound + vibration or is there something else too?

Sound being on by default (just my opinion here!)

@spr4bhu
Copy link
Copy Markdown
Contributor Author

spr4bhu commented May 8, 2026

Please no!

is the no for default being sound + vibration or is there something else too?

Sound being on by default (just my opinion here!)

sure, that can be changed

also can you pretty please take a look at pr #1156 and lmk how are features to be added in the mobile app

@gmarull
Copy link
Copy Markdown
Member

gmarull commented May 12, 2026

@jplexer ping

@KonradIT
Copy link
Copy Markdown

Agree to keep sound off as default for newly created alarms. Whole reason why I use alarms on pebble is the lack of sound.

@jplexer
Copy link
Copy Markdown
Member

jplexer commented May 13, 2026

@jplexer ping

wanted to wait until sound-off was the default

@gmarull
Copy link
Copy Markdown
Member

gmarull commented May 13, 2026

@jplexer ping

wanted to wait until sound-off was the default

I'd actually make default-on for alarms... @ericmigi ?

@ericmigi
Copy link
Copy Markdown
Collaborator

Sound off by default. Not going to change the current behavior

@ericmigi
Copy link
Copy Markdown
Collaborator

Are these settings exposed and configurable on mobile too?

@spr4bhu
Copy link
Copy Markdown
Contributor Author

spr4bhu commented May 14, 2026

The settings are only visible on the watch rn

Is there a any format you have to move the features from watch to mobileapp ?

@spr4bhu
Copy link
Copy Markdown
Contributor Author

spr4bhu commented May 14, 2026

The sound is now turned off by default

Copy link
Copy Markdown
Member

@gmarull gmarull left a comment

Choose a reason for hiding this comment

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

there seem to be some intermediate changes that are later removed, please, squash content accordingly so only the final solution is reflected. We do not merge unfinished/broken stuff.

@spr4bhu spr4bhu force-pushed the sound-enabled-alarms branch from 53b3d69 to 99edfda Compare May 21, 2026 17:19
spr4bhu added 6 commits May 21, 2026 23:00
Signed-off-by: Shashvat Prabhu <shashvatprabhu2006@gmail.com>
Signed-off-by: Shashvat Prabhu <shashvatprabhu2006@gmail.com>
Signed-off-by: Shashvat Prabhu <shashvatprabhu2006@gmail.com>
Signed-off-by: Shashvat Prabhu <shashvatprabhu2006@gmail.com>
Signed-off-by: Shashvat Prabhu <shashvatprabhu2006@gmail.com>
Signed-off-by: Shashvat Prabhu <shashvatprabhu2006@gmail.com>
@spr4bhu spr4bhu force-pushed the sound-enabled-alarms branch from 99edfda to 7b6bcb2 Compare May 21, 2026 17:32
@spr4bhu spr4bhu requested a review from gmarull May 21, 2026 17:42
@spr4bhu
Copy link
Copy Markdown
Contributor Author

spr4bhu commented May 21, 2026

should be fixed now, lmk if any other changes required

@jplexer
Copy link
Copy Markdown
Member

jplexer commented May 21, 2026

thanks, this looks quite nice! would you be okay with me making one change (specifically to make reveille fit the vibration pattern haha)

@spr4bhu
Copy link
Copy Markdown
Contributor Author

spr4bhu commented May 21, 2026

sure go ahead

@jplexer
Copy link
Copy Markdown
Member

jplexer commented May 21, 2026

Continuing work on #1357 tysm for the PR!

@jplexer jplexer closed this May 21, 2026
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.

Implement Audio/Sound-Enabled Alarms on Pebble 2 Duo and Time 2

6 participants