Add "Use microphone control" option to developer settings

This commit is contained in:
James Babcock committed 2026-08-30 21:18:32 -07:00
1 parent 8a86cf28e1
commit e98f19d7e4
4 files changed
+28 -4

No files matched your search

+12 -1
View File
@@ -1,4 +1,5 @@
import { getStringSetting, setStringSetting } from "../../native/settings-store";
import { useMicControlSetting } from "../../ui/dashboard-settings";
import { toJavaBytes } from "../../native/cloud-stt";
import { toUint8Array } from "../../util/array-util";
import {
@@ -38,7 +39,7 @@ function activeCommunicator(): any {
}
/** True when the connected glasses advertise the CFW mic_control feature. */
export function micControlSupported(): boolean {
export function micControlAdvertised(): boolean {
const communicator = activeCommunicator();
if (!communicator) return false;
try {
@@ -49,6 +50,16 @@ export function micControlSupported(): boolean {
}
}
/**
* True when the connected glasses advertise the CFW mic_control feature AND
* the "Use microphone control" developer setting is on. With the setting off
* (the default), Faceclaw behaves exactly as it would on firmware without the
* micctl caps token.
*/
export function micControlSupported(): boolean {
return useMicControlSetting.get() && micControlAdvertised();
}
export function loadMicConfig(): MicConfig {
const raw = getStringSetting(CONFIG_SETTING_KEY, "");
if (!raw) return defaultMicConfig();
+5 -3
View File
@@ -23,7 +23,7 @@ import { isAsrModelReady, startAsrModelDownload, asrModelState } from "../../nat
import { CaptionsLayer } from "./captions-layer";
import { LevelsLayer } from "./levels-layer";
import { RadarLayer } from "./radar-layer";
import { loadMicConfig, micArrayController, micControlSupported, saveMicConfig } from "./mic-control";
import { loadMicConfig, micArrayController, micControlAdvertised, micControlSupported, saveMicConfig } from "./mic-control";
import { isMicModelReady, micModelState, startMicModelDownload } from "./mic-models";
import { micChannelLabel, type MicChannelKey, type MicConfig } from "./mic-protocol";
import { micSession } from "./mic-session";
@@ -166,7 +166,7 @@ function micSetupMenu(): MenuLayer {
{
label: "Array status",
description:
"Per-temple mic-control status. Requires the mic-control custom firmware (caps token micctl).",
"Per-temple mic-control status. Requires the mic-control custom firmware (caps token micctl) and the Use microphone control developer setting.",
onSelect: (ctx) => {
micArrayController.query();
const { left, right } = micArrayController.getStatuses();
@@ -186,7 +186,9 @@ function micSetupMenu(): MenuLayer {
"Array status",
micControlSupported()
? `${describe("Left", left)}\n${describe("Right", right)}\n${consistency}`
: "The connected firmware does not advertise mic-control. Flash the microphone-configurations CFW build to control the four mics individually; on stock firmware the glasses stream one mixed channel with a firmware-computed direction of arrival.",
: micControlAdvertised()
? "Mic-control is available but disabled. Turn on Settings > Developer > Use microphone control to control the four mics individually."
: "The connected firmware does not advertise mic-control. Flash the microphone-configurations CFW build to control the four mics individually; on stock firmware the glasses stream one mixed channel with a firmware-computed direction of arrival.",
),
);
},