Skip to content

Separate volumes for music, replies, sounds, timers and calls (#32) - #47

Merged
Gamer92000 merged 2 commits into
mainfrom
volume-groups
Oct 17, 2026
Merged

Gamer92000 merged 2 commits into
mainfrom
volume-groups

Conversation

@Gamer92000

Copy link
Copy Markdown
Owner

Closes #32.

What

A new setting, Separate volumes (off by default: one volume, as stock). Switched on, five kinds of audio each get a volume 0–100 %, or follow the music volume some points above or below it ("Follow music"):

Kind What Home Assistant
Music Music Assistant, a phone over Bluetooth, media_player.play_media the media player's volume
Voice replies replies, announcements, tts.speak on the media player Assistant volume
Echo sounds wake sound, buttons, chimes, Drop In ringtone Sounds volume
Timers a finished timer's ring Timer volume
Calls the other side of a Drop In call (only with Drop In) Call volume
  • The settings page gets a Volume card (Sound) that also sets the Echo's volume from the browser.
  • HA numbers exist only while a kind has its own volume.
  • Volume buttons move what is playing: a call, a reply (ring in cyan), a ringing timer, otherwise the music.
  • Exports carry the switches and offsets, never a volume itself.
  • On a Bluetooth speaker with absolute volume the speaker is set to the loudest kind and its own buttons move the music.

How

The mixer only has MainVolume (Music, Earcon, Voip), TTSVolume (TTS) and AlarmVolume, and libasp boosts the whole output at 90–100 according to whichever of MainVolume/TTSVolume was set last. So both are kept at the loudest kind and every quieter kind is turned down in its own PCM by the Echo's measured volume curve (vol_db). Details and measurements: docs/re-platform.md, PLAN.md.

Measured (Echo Dot 2)

  • Each kind at a given number vs. stock at that number: within 0.3 dB (own volumes), within 0.8 dB (following the music, references in a noisier room).
  • Drop In calls: same curve shape as music, 6.5 dB under it at every volume (call mode; stock too).

Tested

  • make unit, every test listed in CLAUDE.md, STUBS=1 builds of donut, biscuit and radar.
  • New: tests/fake_ha_volumes.py; additions to fake_ha_dropin.py and fake_ha_ring.py.
  • Clicked through the Volume card in Chromium (one-off script, not in the repo).

Not tested on hardware: the Echo Dot 3's and Echo 2's curves (they use the Dot 2's), a real Bluetooth speaker, a real call between two Echos.

🤖 Generated with Claude Code

Gamer92000 and others added 2 commits October 17, 2026 18:41
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Setting separate_volumes (off by default: one volume, as stock). On,
music (the `volume` setting: media player, Sendspin, phone over
Bluetooth, play_media), voice replies and announcements, the Echo's
sounds, timers and Drop In calls each have a volume 0..100, or follow
the music's some points above or below it (<kind>_linked,
<kind>_offset -100..100; calls follow it by default, as before).

How (Echo Dot 2, docs/re-platform.md): the mixer has MainVolume
(Music, Earcon, Voip), TTSVolume (TTS) and AlarmVolume; libasp adds
up to +14.5 dB at 90..100 from its own volume, which follows whichever
of MainVolume and TTSVolume was set last. So both stay at the loudest
kind and each kind is turned down in its PCM by the measured curve
(vol_db): audio_music_gain, audio_tts_gain, audio_call_gain, the earcon
thread for sounds, timers and the Drop In ringtone. Timers are back on
the Earcon stream (Alarm topped out 12 dB under). HA's play_media is
music although it plays on the TTS stream; the media player's
announcement flag (tts.speak) makes it speech. On a Bluetooth speaker
with absolute volume the speaker is set to the loudest kind
(a2dp_speaker_volume) and its own buttons move the music.

Settings page: a Volume card (one volume / separate; a slider per kind,
"Own volume | Follow music", the line under the name says what it plays
at; Calls only with Drop In). HA: the media player is the music;
numbers Assistant, Sounds, Timer, Call volume while a kind has its own
(Call only with Drop In). Volume keys move what plays: a call, a reply
(ring in cyan, ring.c's hassmic_assist_NN), a ringing timer, else the
music. Exports carry the switches and offsets, never a volume.

Also: state/volume.music keeps the music volume while separate (written
from volume_sync's tick, outside core_lock), read at start only while
state/config says separate; settings_peek takes the last valid line, as
loading does; switches are applied before the rest of any file.

Measured on the Dot 2 against stock at the same number: replies, media,
sounds and timers within 0.3 dB (own volumes) and within 0.8 dB
(following the music, fresh references in a noisier room); Voip has
Music's curve, 6.5 dB under it at every volume (call mode, stock too).
Not measured: the Dot 3's and Echo 2's curves (they use the Dot 2's),
a real Bluetooth speaker, a call between two real Echos.

Tests: tests/fake_ha_volumes.py (HASSMIC_FAKE_MIXER, HASSMIC_FAKE_SPEAKER:
one volume, separate, linked, keys, HA numbers, restarts and stale
files, Bluetooth speaker, page, exports), fake_ha_dropin.py (ringtone at
the sounds volume via HASSMIC_EARCONS, call volume and keys during a
call), fake_ha_ring.py (the cyan steps). make unit, every test of
CLAUDE.md and the STUBS=1 builds of all three models pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gamer92000
Gamer92000 merged commit bd9f770 into main Oct 17, 2026
7 checks passed
@Gamer92000
Gamer92000 deleted the volume-groups branch October 17, 2026 23:10
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.

Separate Volume for Media and Assistant Voice

1 participant