feat: mute the TV while the box listens, if the brain turns that on
check / check (push) Waiting to run

whisper hears people better without the show behind them. The brain
sets a mute code (and an unmute code, if not the same) with
mute_while_listening on its ir capability, or turns it off; ir-server
keeps the setting in its state directory.

Mute is often a toggle, and the camera can't reliably tell whether the
sound is off, so the box senses nothing: the setting is the brain's
to turn on or off.

The button service holds a connection to ir-server's conversation
socket for each conversation: ir-server mutes when it opens and
unmutes, with the same codes, when it closes. The socket's group is
the button's alone, and the button still can't send any code.

Generated-by: Claude Opus 5.5
This commit is contained in:
dckc committed 2026-12-03 16:49:58 -06:00
1 parent 5191ee9931
commit f50c871521
10 files changed
+269 -22

No files matched your search

+15 -1
View File
@@ -117,7 +117,7 @@ in
"${pkgs.alsa-utils}/bin/aplay" "${pkgs.alsa-utils}/bin/amixer" "${pkgs.alsa-utils}/bin/arecord" "${pkgs.espeak-ng}/bin/espeak-ng"
(script "hear-client" "${speechJs}/hear-client.js") (script "speak-client" "${speechJs}/speak-client.js")
cfg.speechUrl
(script "ask-client" "${boxJs}/ask-client.js") cfg.askUrl
(script "ask-client" "${boxJs}/ask-client.js") cfg.askUrl "/run/pdtv26-ir-conversation.sock"
cfg.packages.earcons "/var/lib/pdtv26-button"
] + lib.optionalString (cfg.statusUrl != null) " ${lib.escapeShellArg cfg.statusUrl}";
# The private network alone: enough to reach speech and the brain, and nothing else.
@@ -131,11 +131,25 @@ in
# DeviceAllow's char-ttyACM is looked up in /proc/devices when the service starts; without cdc_acm loaded
# by then (it loads when the Pico enumerates, maybe after boot starts the service), the tty gets EPERM.
boot.kernelModules = [ "cdc_acm" ];
# The button service holds a connection here for each conversation, so ir-server can mute the TV
# meanwhile, if the brain turned that on. Its group is the whole of who may: the button service.
systemd.sockets.pdtv26-ir = {
wantedBy = [ "sockets.target" ];
socketConfig = {
ListenStream = "/run/pdtv26-ir-conversation.sock";
SocketGroup = "button";
SocketMode = "0660";
};
};
systemd.services.pdtv26-ir = {
description = "the box's IR remote, as a capability";
wantedBy = [ "multi-user.target" ];
requires = [ "pdtv26-ir.socket" ];
after = [ "pdtv26-ir.socket" ];
serviceConfig = confined // {
DynamicUser = true;
# mute.json: whether to mute the TV while the box listens, as the brain last set it.
StateDirectory = "pdtv26-ir";
SupplementaryGroups = [ "dialout" ];
LoadCredential = [ "ir-key:${keys}/ir-key" ];
ExecStart =