Increase screen size a little bit past 576x288, to exercise the corresponding new firmware

This commit is contained in:
James Babcock committed 2026-07-30 00:45:31 -07:00
1 parent e96011ef47
commit 818f33ce33
9 files changed
+171 -55

No files matched your search

@@ -28,9 +28,10 @@ import java.util.Map;
public class FaceclawBleCommunicator implements FaceclawBleListener, Runnable {
private static final String TAG = "FaceclawComm";
// A single full-screen image container. Earlier firmware capped image tiles at
// 288x144, which forced a 2x2 tile layout; the custom firmware lifts that limit,
// so the dashboard is now one 576x288 container.
// The EvenHub image container is a transport/reconstruction carrier only.
// Its 576x288 allocation remains large enough for the compressed 580x300
// logical image and the firmware's packed-4bpp shadow; the CFW presents that
// shadow directly instead of asking EvenHub/LVGL to composite this geometry.
private static final BleProtocol.ImageTileOptions DASHBOARD_TILE =
new BleProtocol.ImageTileOptions("img00", 10, 0, 0, 576, 288);
@@ -79,6 +80,9 @@ public class FaceclawBleCommunicator implements FaceclawBleListener, Runnable {
private long lastFaceclawWakeLeaseQueuedAtMs;
private int faceclawWakeControlGeneration;
private int faceclawWakeControlSentCount;
private long lastFaceclawFramebufferLeaseQueuedAtMs;
private int faceclawFramebufferControlGeneration;
private int faceclawFramebufferControlSentCount;
private int faceclawWakePendingNonce = -1;
private long reconnectAfterMs;
@@ -185,6 +189,7 @@ public class FaceclawBleCommunicator implements FaceclawBleListener, Runnable {
}
public void disconnect() {
releaseFaceclawFramebufferLease();
Thread threadToJoin;
synchronized (lock) {
userDisconnectRequested = true;
@@ -1098,6 +1103,11 @@ public class FaceclawBleCommunicator implements FaceclawBleListener, Runnable {
audioCaptureActive = false;
faceclawWakePendingNonce = -1;
lastFaceclawWakeLeaseQueuedAtMs = 0;
lastFaceclawFramebufferLeaseQueuedAtMs = 0;
enqueueFaceclawFramebufferControlLocked(
BleProtocol.FACECLAW_FB_OP_ACQUIRE,
true
);
if (faceclawWakeLeaseEnabled) {
enqueueFaceclawWakeControlLocked(
BleProtocol.FACECLAW_WAKE_OP_ACQUIRE,
@@ -1295,6 +1305,14 @@ public class FaceclawBleCommunicator implements FaceclawBleListener, Runnable {
maybeFinishNoChangeDesiredFrame();
synchronized (lock) {
if (sessionReady
&& now - lastFaceclawFramebufferLeaseQueuedAtMs >= FACECLAW_WAKE_LEASE_RENEW_MS
&& !hasPendingOrInflightKindLocked("framebuffer-lease-control")) {
enqueueFaceclawFramebufferControlLocked(
BleProtocol.FACECLAW_FB_OP_ACQUIRE,
false
);
}
if (faceclawWakeLeaseEnabled
&& sessionReady
&& now - lastFaceclawWakeLeaseQueuedAtMs >= FACECLAW_WAKE_LEASE_RENEW_MS
@@ -1787,18 +1805,12 @@ public class FaceclawBleCommunicator implements FaceclawBleListener, Runnable {
}
private void enqueueWarmupLocked() {
int width;
int height;
synchronized (desiredTilesLock) {
width = desiredWidth;
height = desiredHeight;
}
// A blank full-size raw BMP: warmup primes the firmware image path with
// a frame shaped like the real ones, without flashing stale content.
byte[] bmp = (width > 0 && height > 0)
? BmpUtil.build4bppBmpFromPacked(new byte[((width + 1) >> 1) * height], width, height)
: new byte[] {0};
BleProtocol.ImageTileOptions tile = DASHBOARD_TILE;
// Warm up the legacy container with a carrier-sized blank BMP. Real
// 580x300 frames use mode 6 and are intentionally independent of this
// geometry; a mismatched raw BMP would be rejected by the stock loader.
byte[] bmp = BmpUtil.build4bppBmpFromPacked(
new byte[((tile.width + 1) >> 1) * tile.height], tile.width, tile.height);
int sessionId = nextMapSessionId();
List<BleProtocol.ImageFragment> fragments = BleImageOptimizer.planImageFragments(bmp, ConnectionOptions.IMAGE_FRAGMENT_SIZE);
for (BleProtocol.ImageFragment fragment : fragments) {
@@ -2200,6 +2212,80 @@ public class FaceclawBleCommunicator implements FaceclawBleListener, Runnable {
}
}
/**
* Acquire/renew or release CFW's independent direct-framebuffer repaint
* guard on both arms. It is separate from the optional idle-wake lease:
* every Faceclaw display session needs this guard while its EvenHub layout
* contains swipe-capturing stock widgets.
*/
private int enqueueFaceclawFramebufferControlLocked(int operation, boolean priority) {
clearMessagesOfKindLocked("framebuffer-lease-control");
final int generation = ++faceclawFramebufferControlGeneration;
faceclawFramebufferControlSentCount = 0;
if (operation == BleProtocol.FACECLAW_FB_OP_ACQUIRE) {
lastFaceclawFramebufferLeaseQueuedAtMs = SystemClock.elapsedRealtime();
}
Runnable onSent = () -> {
if (faceclawFramebufferControlGeneration == generation) {
faceclawFramebufferControlSentCount += 1;
}
};
OutboundMessage right = messageBuilder.faceclawFramebufferControl(operation, false);
OutboundMessage left = messageBuilder.faceclawFramebufferControl(operation, true);
right.onSent = onSent;
left.onSent = onSent;
if (priority) {
pendingMessages.addFirst(left);
pendingMessages.addFirst(right);
} else {
pendingMessages.addLast(right);
pendingMessages.addLast(left);
}
logLine("queue " + right.label + " + L");
return generation;
}
private boolean waitForFaceclawFramebufferControlDelivery(int generation, long timeoutMs) {
long deadline = SystemClock.elapsedRealtime() + Math.max(0, timeoutMs);
synchronized (lock) {
while (running
&& sessionReady
&& faceclawFramebufferControlGeneration == generation
&& faceclawFramebufferControlSentCount < 2) {
long remaining = deadline - SystemClock.elapsedRealtime();
if (remaining <= 0) {
break;
}
try {
lock.wait(Math.min(remaining, 100));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
break;
}
}
return faceclawFramebufferControlGeneration == generation
&& faceclawFramebufferControlSentCount >= 2;
}
}
private boolean releaseFaceclawFramebufferLease() {
int generation;
synchronized (lock) {
if (!running || !sessionReady) {
return true;
}
generation = enqueueFaceclawFramebufferControlLocked(
BleProtocol.FACECLAW_FB_OP_RELEASE,
true
);
}
interruptibleSleep.interrupt();
return waitForFaceclawFramebufferControlDelivery(
generation,
FACECLAW_WAKE_CONTROL_WAIT_MS
);
}
private void clearMessagesOfKindLocked(String kind) {
Iterator<OutboundMessage> pendingIterator = pendingMessages.iterator();
while (pendingIterator.hasNext()) {
@@ -79,7 +79,7 @@ public final class BleImageOptimizer {
public final byte[] packed;
public final int width;
public final int height;
final byte[] payload; // bytes actually streamed: mode-6 zlib(rle(4bpp)) when it shrinks, else a raw BMP
final byte[] payload; // bytes actually streamed: mode-6 zlib(rle(4bpp))
final int sessionId;
List<BleProtocol.ImageFragment> fragments = Collections.emptyList();
@@ -408,19 +408,16 @@ public final class BleImageOptimizer {
}
/**
* RLE- then zlib-compress headerless 4bpp pixels for CFW load_image_z mode 6 when
* it shrinks the payload. Wire format: [6][zlib(rle(4bpp pixels))]. A raw BMP
* (starts 'B') is sent when compression does not help; that is the only spot
* where BMP framing is still built.
* RLE- then zlib-compress headerless 4bpp pixels for CFW load_image_z mode 6.
* Wire format: [6][zlib(rle(4bpp pixels))]. Always use mode 6: the logical
* image can be larger than its EvenHub carrier, so a raw BMP fallback would
* carry dimensions the legacy container loader cannot accept.
*/
static byte[] maybeCompress(byte[] packed, int width, int height) {
if (packed == null || packed.length == 0) {
return packed;
}
byte[] z = deflate(rleEncode(packed));
if (z == null || z.length + 1 >= packed.length) {
return BmpUtil.build4bppBmpFromPacked(packed, width, height);
}
byte[] out = new byte[z.length + 1];
out[0] = 6;
System.arraycopy(z, 0, out, 1, z.length);
@@ -42,6 +42,8 @@ public class BleProtocol {
public static final int FACECLAW_WAKE_OP_RELEASE = 2;
public static final int FACECLAW_WAKE_OP_CLAIM = 3;
public static final int FACECLAW_WAKE_OP_READY = 4;
public static final int FACECLAW_FB_OP_ACQUIRE = 5;
public static final int FACECLAW_FB_OP_RELEASE = 6;
private static final int FACECLAW_WAKE_EVENT = 1;
private static final int FACECLAW_WAKE_PROTOCOL_VERSION = 1;
// UI_FOREGROUND_EVEN_AI_ID: the stock "Even AI" assistant app. It is a
@@ -399,7 +401,7 @@ public class BleProtocol {
* Firmware versions and the CFW capability advertisement from a settings
* READ ack. Versions are fields 5/6 of the deviceReceiveRequestFromApp
* submessage (field 4); the custom firmware additionally appends top-level
* field 100, a string like "EVENCFW/1 img576 imgz xordelta stereo", which
* field 100, a string like "EVENCFW/5 img576 img580 ... directfb fbguard", which
* stock firmware never sends. Returns null when the ack carries none of it.
*/
public static FirmwareInfo parseSettingsFirmwareInfo(byte[] pb) {
@@ -210,4 +210,18 @@ public class MessageBuilder {
leftArm
);
}
public OutboundMessage faceclawFramebufferControl(int operation, boolean leftArm) {
return new OutboundMessage(
"framebuffer-lease-control",
"framebuffer lease op=" + operation + (leftArm ? " L" : " R"),
BleProtocol.SID_UI_SETTING,
BleProtocol.FLAG_REQUEST,
0,
BleProtocol.buildFaceclawWakeControl(operation, 0),
ACK_TIMEOUT_MS,
-1,
leftArm
);
}
}
+14 -9
View File
@@ -1,14 +1,13 @@
/**
* Compatibility check for the glasses firmware. Faceclaw requires the custom
* firmware: version >= 2.2.4.34 with the "imgz" extension token in the CFW
* capability string ("EVENCFW/1 img576 imgz ..."). Stock firmware sends no
* capability string at all.
* firmware: version >= 2.2.4.34 with the "img580" and "fbguard" extension tokens
* in the CFW capability string. Stock firmware sends no capability string at all.
*/
import { type FirmwareInfo } from "../native/faceclaw-communicator";
const MIN_FIRMWARE_VERSION = [2, 2, 4, 34];
const REQUIRED_FIRMWARE_EXTENSION = "imgz";
const REQUIRED_FIRMWARE_EXTENSIONS = ["img580", "fbguard"] as const;
// The stock firmware release Faceclaw's custom image is built from. Stock at or
// below this can be flashed with our patched image; a newer stock version is
@@ -56,20 +55,26 @@ export function firmwareIncompatibilityMessage(info: FirmwareInfo): string | nul
}
const tokens = info.capabilities.trim().split(/\s+/);
if (!tokens.includes(REQUIRED_FIRMWARE_EXTENSION)) {
const missingExtensions = REQUIRED_FIRMWARE_EXTENSIONS.filter(
(extension) => !tokens.includes(extension),
);
if (missingExtensions.length) {
return (
`The glasses firmware (${versionsText}) does not advertise the "${REQUIRED_FIRMWARE_EXTENSION}" extension` +
`The glasses firmware (${versionsText}) does not advertise the required ` +
`${missingExtensions.map((extension) => `"${extension}"`).join(" and ")} extension` +
`${missingExtensions.length === 1 ? "" : "s"}` +
`${info.capabilities.trim() ? ` (reported: ${info.capabilities.trim()})` : ", which suggests stock firmware"}. ` +
`Faceclaw requires the modified firmware with compressed-image support.`
`Faceclaw requires the modified firmware with the guarded 580x300 direct-framebuffer path.`
);
}
return null;
}
/** True when the glasses advertise Faceclaw's custom-firmware image extension. */
/** True when the glasses advertise every custom-firmware extension Faceclaw needs. */
export function hasCustomFirmware(info: FirmwareInfo): boolean {
return info.capabilities.trim().split(/\s+/).includes(REQUIRED_FIRMWARE_EXTENSION);
const tokens = info.capabilities.trim().split(/\s+/);
return REQUIRED_FIRMWARE_EXTENSIONS.every((extension) => tokens.includes(extension));
}
/** The higher of the two arms' reported versions, or "" if none reported. */
+30 -18
View File
@@ -19,7 +19,7 @@ export type FirmwarePatchSet = {
export const CFW_PATCH_SET: FirmwarePatchSet = {
"base": "g2_2.2.6.10.bin",
"baseSha256": "f4dfb0b49ad3de3c2daf17f8a27a157c3dc98411d6a0d3ab2cfd0918f41b9afa",
"outputSha256": "ba7e896e516d049e530d7aaed30e358b45f940e81a90f997a44465299151b452",
"outputSha256": "48d66bbcfeb708f309d435908694d3fa920948ef9185bb6f2af7094415c15e86",
"patches": [
{
"offset": 1449549,
@@ -42,103 +42,115 @@ export const CFW_PATCH_SET: FirmwarePatchSet = {
{
"offset": 1447919,
"old": "7ef7fefd",
"new": "b8f2f6fe",
"new": "baf2dcf8",
"desc": "bl snapshot_side @ 0x4db968"
},
{
"offset": 1448931,
"old": "7ef704fc",
"new": "b8f2fcfc",
"new": "b9f2e2fe",
"desc": "bl snapshot_side @ 0x4dbd5c"
},
{
"offset": 1165461,
"old": "45f0cefd",
"new": "fdf2a7fe",
"new": "fff28df8",
"desc": "bl image_deferred (deferred consumer -> FIFO restore + worker, both lenses)"
},
{
"offset": 1186287,
"old": "d9f7d4ff",
"new": "f9f2b8fb",
"new": "faf2a0fc",
"desc": "bl settings_send_wrapper (append caps field 100)"
},
{
"offset": 1183983,
"old": "f4f75aff",
"new": "f9f2b6fd",
"new": "faf2fefe",
"desc": "bl settings_decode_wrapper (Faceclaw lease field 101)"
},
{
"offset": 926945,
"old": "08f068fa",
"new": "38f3d9fa",
"new": "39f321fc",
"desc": "bl faceclaw_display_start @ 0x45c65a (fail-open double-tap takeover)"
},
{
"offset": 927137,
"old": "08f008fa",
"new": "38f379fa",
"new": "39f3c1fb",
"desc": "bl faceclaw_display_start @ 0x45c71a (fail-open double-tap takeover)"
},
{
"offset": 822553,
"old": "28f003f8",
"new": "52f39dfa",
"new": "53f373fb",
"desc": "bl evenhub_longpress (replaces force-quit dialog)"
},
{
"offset": 823369,
"old": "1cf09bfb",
"new": "52f321f9",
"new": "53f3f7f9",
"desc": "bl ring_release (forward ring release-long-press)"
},
{
"offset": 1474137,
"old": "7fb50600",
"new": "b3f271b9",
"new": "b4f259ba",
"desc": "even_ai_display_ctrl entry -> conditional Faceclaw lease trampoline"
},
{
"offset": 1022741,
"old": "f8f7c1fe",
"new": "20f3abfb",
"desc": "bl display_copy_hook @ 0x473c8e (580x300 direct framebuffer)"
},
{
"offset": 1022959,
"old": "f8f754fe",
"new": "20f33efb",
"desc": "bl display_copy_hook @ 0x473d68 (580x300 direct framebuffer)"
},
{
"offset": 4301227,
"old": "",
"new": "02fb01f044f6d341c0f24701084700bf084644f61751c0f24701084770b500284ed001684ef65a62ccf2ff02914218bf70bd90f8081190f8095142f6c52c8d42c0f2500c2ad205eb8501014491f80d2191f80e4191f80ae191f80b3191f80c1142ea0424012c4ff0010298bf14466e1c054680f80961b9b164294eea032028bf6421012888bf024644f62060824228bf02460cf5e2731046984706e0002180f80811bde870406047e047d5f8040138b149f29942c0f244022146bde87040104770bd00bf2de9f04f83b043f6fc76c2f200063568824628466ff3960044f6d344b0f1005fc0f2470407d128684ef65a61ccf2ff01884200f0a4804ff40670a0470546002800f09c8000206ff021010022ab18a85443326f18b2f5067f01f1430158709870d870187158719871d871187258729872d872187358739873d873187458749874d874187558759875d875187658769876d876187758779877d87783f8200087f8430087f8440083f8230083f8240083f8250083f8260083f8270083f8280083f8290083f82a0083f82b0083f82c0083f82d0083f82e0083f82f0083f8300083f8310083f8320083f8330083f8340083f8350083f8360083f8370083f8380083f8390083f83a0083f83b0083f83c0083f83d0083f83e0083f83f0083f8400083f8410083f8420091d14ef65a60ccf2ff002860012085f8ce004ff0ff30a5f8e000a5f8e200a5f8e400a5f8e600a5f8e800a5f8ea00a5f8ec00a5f8ee00a5f8f000a5f8f200a5f8f400a5f8f600a5f8f800a5f8fa00a5f8fc00a5f8fe003560baf1000f18bf002d07d14af26950c0f2450003b0bde8f04f0047daf80cb0bbf1000ff2d0daf82080b8f1000fedd0a94659f8040f00287cd0686900287bd0686a00287ad0686b002879d0686c002878d0686d002877d0686e002876d0686f002875d0d5f88400002873d0d5f89400002871d0d5f8a40000286fd0d5f8b40000286dd0d5f8b00029690290d5f8a0002c6a0190d5f8900000260090286bd5f880e0d5f870c02b6e2f6d2a6c8c4238bf214638bf012688423cbf014602268a423cbf114603268f423cbf394604268b423cbf194605268c453cbf614606268e453cbf71460726009844f6d34488423cbf014608260198c0f2470488423cbf014609260298884238bf0146d5f8c00038bf0a26884238bf0b2609eb0610406804f1440137018847002049f80700012085f8df0016e0002614e0012612e0022610e003260ee004260ce005260ae0062608e0072606e0082604e0092602e00a2600e00b264046a04700283ff450af08f0030c5fea98034ff0000219d00296a2eb830e431c0bf101066ff0030700bff119cc78da19d4700c79043714714c79547189790eeb070404349171f0d1029e3a1dbcf1000f10d01bf80230bcf1010f83540ad0531c1bf80370bcf1020fc75403d0911c1bf80120425409eb06114860d5f8c400320149f802a0421cc1f80880c5f8c420c8600be738464146fff744be2de9f04f81b043f6fc79c2f20009d9f80050044628466ff3960044f6d34816460f46b0f1005fc0f2470807d128684ef65a61ccf2ff01884200f0a6804ff40670c0470546002800f0fc8000206ff02101002200bfab18a85443326f18b2f5067f01f1430158709870d870187158719871d871187258729872d872187358739873d873187458749874d874187558759875d875187658769876d876187758779877d87783f8200087f8430087f8440083f8230083f8240083f8250083f8260083f8270083f8280083f8290083f82a0083f82b0083f82c0083f82d0083f82e0083f82f0083f8300083f8310083f8320083f8330083f8340083f8350083f8360083f8370083f8380083f8390083f83a0083f83b0083f83c0083f83d0083f83e0083f83f0083f8400083f8410083f8420091d14ef65a60ccf2ff002860012085f8ce004ff0ff30a5f8e000a5f8e200a5f8e400a5f8e600a5f8e800a5f8ea00a5f8ec00a5f8ee00a5f8f000a5f8f200a5f8f400a5f8f600a5f8f800a5f8fa00a5f8fc00a5f8fe00c9f8005005f1040b4ff0000a4ff000094ff0ff30002200234ff0ff3105e000bf6032c02a03f1060332d0af187e68a64204d13e6986423cbf194630467e69a64204d13e6a86423cbf591c30467e6aa64204d13e6b86423cbf991c30467e6ba64204d13e6c86423cbfd91c30467e6ca64204d13e6d86423cbf191d30467e6da642ced13f6e87423cbf591d3846c8e700bf002910d40beb01104768090182684bf801a02046394600f013f8814608f1440138468847ace7484601b0bde8f08f204639463246c9f8005001b0bde8f04fffe72de9f041a4b0064640f6bb4043f6fc78c0f24e0014460d46c2f200088047002002af0390384600f049fd0df10c0c3046294622460123cdf800c000f055fe0446384601f07dfcd8f8001005460a466ff39602b2f1005f07d108684ef65a62ccf2ff02904200f0aa8044f6d341c0f247014ff406708847002800f0a380014600206ff02102002300bfcf18c85443338e18b3f5067f02f143027870b870f87038717871b871f87138727872b872f87238737873b873f87338747874b874f87438757875b875f87538767876b876f87638777877b877f87787f8200086f8430086f8440087f8230087f8240087f8250087f8260087f8270087f8280087f8290087f82a0087f82b0087f82c0087f82d0087f82e0087f82f0087f8300087f8310087f8320087f8330087f8340087f8350087f8360087f8370087f8380087f8390087f83a0087f83b0087f83c0087f83d0087f83e0087f83f0087f8400087f8410087f8420091d14ef65a60ccf2ff000860012081f8ce004ff0ff30a1f8e000a1f8e200a1f8e400a1f8e600a1f8e800a1f8ea00a1f8ec00a1f8ee00a1f8f000a1f8f200a1f8f400a1f8f600a1f8f800a1f8fa00a1f8fc00a1f8fe00c8f80010c1f8d05002e00020c8f80000204624b0bde8f08143f6fc70c2f20000016808466ff39600b0f1005f16d108684ef65a62ccf2ff0290420fd1d1f8fc0160b144f63422c2f207021268801a0028cebf01200020c1f8fc01704700207047f0b101684ef65a62ccf2ff02914218bf704790f8061299b110b544f62f344ff0000cc0f24604864680f806c20120002100220023aef804c2a446bde810406047704700bf2de9f04143f6fc77c2f200073f684ff000083c466ff39604b4f1005f07d13e684ef65a65ccf2ff05ae4208bfb84601280fd11c4615460f460646fff79bff2346044639462a463046002c18bfb8f1000f06d144f62f3cc0f2460cbde8f041604798f8060270b1d8f800020021002888f80612a8f804123ed049f2d941c0f24401884738e0b8f804020121013080b2012898bf0846a8f80402d8f8000249f2d944c0f2440488f8061268b94ff60370cff6ff70a4f594777844002142460023b847c8f8000240b1a047d8f80002a4f140024Line truncated
"new": "02fb01f044f6d341c0f24701084700bf084644f61751c0f24701084770b500284ed001684ef66062ccf2ff02914218bf70bd90f8081190f8095142f6c52c8d42c0f2500c2ad205eb8501014491f80d2191f80e4191f80ae191f80b3191f80c1142ea0424012c4ff0010298bf14466e1c054680f80961b9b164294eea032028bf6421012888bf024644f62060824228bf02460cf5e2731046984706e0002180f80811bde870406047e047d5f8040138b149f29942c0f244022146bde87040104770bd00bf2de9f04f99b043f6fc76c2f20006d6f8009048466ff39600b0f1005f40f08c81d9f800004ef66068ccf2ff08404540f0838199f81c02002800f06d81d9f81852002d00f0688140f2b870c2f20000d0f800a004a801f0b8f8baf1000f00f0b18140f2030ccff6807caaf180034ff41640002200bfc3f88020c3f88420c3f88820c3f88c20c3f89020c3f89420c3f89820c3f89c20c3f8a020c3f8a420c3f8a820c3f8ac20c3f8b020c3f8b420c3f8b820c3f8bc20c3f8c020c3f8c420c3f8c820c3f8cc20c3f8d020c3f8d420c3f8d820c3f8dc20c3f8e020c3f8e420c3f8e820c3f8ec20c3f8f020c3f8f420c3f8f820c3f8fc20c3f80021c3f80421c3f80821c3f80c21c3f81021c3f81421c3f81821c3f81c21c3f82021c3f82421c3f82821c3f82c21c3f83021c3f83421c3f83821c3f83c21c3f84021c3f84421c3f84821c3f84c21c3f85021c3f85421c3f85821c3f85c21c3f86021c3f86421c3f86821c3f86c21c3f87021c3f87421c3f87821c3f87c2103f5807340387ff47baf47f29d005044002200bf002300bfef5cc418e91804f80e7c4f7804f80d7c8f7804f80c7ccf7804f80b7c0f7904f80a7c4f7904f8097c8f7904f8087ccf7904f8077c0f7a04f8067c4f7a04f8057c8f7a04f8047ccf7a04f8037c0f7b04f8027c4f7b04f8017c8f7bc754cf7b1d3367700f7cb3f5917fa7704f7ce7708f7c2771cf7c67710f7da7714f7de7718f7d2772cf7d67720f7ea7724f7ee7728f7e2773cf7e6773097fa173b1d1013205f59175b2f5967f00f5a070a7d1d6f800e00eea0c00b0f1005f40f08080def8000040457bd19ef8ce00002840f0c6809ef8dc00002100288df8141000f0268105aa505c002800f0f98053185878002800f0cf809878002800f0cd80d878002800f0cb801879002800f0c9805879002800f0c7809879002800f0c580d879002800f0c380187a002800f0c180587a002800f0bf80987a002800f0bd80d87a002800f0bb80187b002800f0b980587b002800f0b780987b002800f0b580d87b002800f0b380187c002800f0b180587c002800f0af80987c002800f0ad80d87c002800f0ab8014315029abd1cbe099f81e0268b1d9f8200238b144f63421c2f207010968401a002871dc002089f81e024cf61520c0f2460019b0bde8f04f004744f6d341c0f247014ff409708847002843d00021002200bf831881540432b2f5097f59709970d970f6d1012180f8ce104ff0ff31c0f80080a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe1010e0002089f81c02c9f8180289f81e02012089f81d024cf61520c0f24600804714e000203060002089f81c02c9f818024ff4163045f20f11069005a8c0f24701cdf814a08847012089f81e0204a800f089ffc9f8d40019b0bde8f08f013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f2921d84ff0520050541dd00a4445204e29507018d04f204d29907014d052204c29d07010d044204b2910710cd045204a29507108d052204929907104d020204829d07140f0898600208df8630001219ef8dd00002870d0002205ab985c00284fd09f18787838b3b87838b3f87838b3387938b3787938b3b87938b3f87938b3387a38b3787a38b3b87a38b3f87a38b3387b38b3787b38b3b87b38b3f87b38b3387c38b3787c38b3b87c38b3f87c38b31432502ad2d13ce0013222e0023220e003321ee004321ce005321ae0063218e0073216e0083214e0093212e00a3210e00b320ee00c320ce00d320ae00e3208e00f3206e0103204e0113202e0123200e013324f2a15d84ff05300985411d013444b204e2a58700cd049204d2a987008d050204c2ad87004d020204b2a187140f0608100208df8630001319ef8de0000286cd0002105aa505c00284fd05318587838b3987838b3d87838b3187938b3587938b3987938b3d87938b3187a38b3587a38b3987a38b3d87a38b3187b38b3587b38b3987b38b3d87b38b3187c38b3587c38b3987c38b3d87c38b314315029d2d138e0013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f2911d84ff0440050540dd00a4455204e29507008d050204d29907004d020204c29d07040f0ec8000208df8630001219ef8df0000284dd0002105aa505c002800f0bc8053185878002800f092809878002800f09080d878002800f08e801879002800f08c805879002800f08a809879002800f08880d879002800f08680187a002800f08480587a002800f08280987a002800f08080d87a00287ed0187b00287dd0587b00287cd0987b00287bd0d87b00287ad0187c002879d0587c002878d0987c002877d0d87c002876d014315029b4d1d0e0002940f0d180002105aa505c002800f0b88053185878002800f08e809878002800f08c80d878002800f08a801879002800f088805879002800f086809879002800f08480d879002800f08280187a002800f08080587a00287ed0987a00287dd0d87a00287cd0187b00287bd0587b00287ad0987b002879d0d87b002878d0187c002877d0587c002876d0987c002875d0d87c002874d014315029b6d181e0013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f295ad84ff05300505456d00a444e204e29507051d041204d2990704dd050204c29d07049d04f204b29107145d046204a29507141d02020492990713dd00020d0713de00020107113e7002058719fe6013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f290dd84ff04f00505409d00a444b204e29507004d020204d29907040f0788400208df8630000220df1140b1bf80200002850d00beb0203587838b3987838b3d87838b3187938b3587938b3987938b3dLine truncated
"desc": "append injected blobs to main-app payload"
},
{
"offset": 777711,
"old": "44c33500",
"new": "380e3600",
"new": "5e013600",
"desc": "main-app subheader payload size (ps)"
},
{
"offset": 152,
"old": "c4c33500",
"new": "b80e3600",
"new": "de013600",
"desc": "main-app TOC entry size (ps + 128)"
},
{
"offset": 777831,
"old": "44c33504",
"new": "380e3604",
"new": "5e013604",
"desc": "main-app preamble length (low 24 bits)"
},
{
"offset": 777835,
"old": "df8110c9",
"new": "88ed0126",
"new": "5e1ef1ea",
"desc": "[5] ota/s200_firmware_ota.bin preamble crc32"
},
{
"offset": 156,
"old": "c1be0fb1",
"new": "f1e9f8d8",
"new": "3f9497ba",
"desc": "[5] ota/s200_firmware_ota.bin component crc32c (TOC)"
},
{
"offset": 777715,
"old": "c1be0fb1",
"new": "f1e9f8d8",
"new": "3f9497ba",
"desc": "[5] ota/s200_firmware_ota.bin component crc32c (subheader)"
}
]
+2 -2
View File
@@ -1,8 +1,8 @@
import { BdfFont, Glyph } from "./bdffont";
import { wrapText } from "./textwrap";
export const G2_LENS_WIDTH = 576;
export const G2_LENS_HEIGHT = 288;
export const G2_LENS_WIDTH = 580;
export const G2_LENS_HEIGHT = 300;
const DEFAULT_CORNER_RADIUS = 8;
export function imageFromAsciiArt(lines: readonly string[], value = 255): GrayImage {
+1 -1
View File
@@ -8,7 +8,7 @@ import type { AssistantContext } from "./assistant/types";
/** Base system prompt for the on-glasses voice assistant. */
export const ASSISTANT_SYSTEM_PROMPT_BASE = [
"You are the voice assistant built into a pair of Even Realities G2 smart glasses.",
"Your reply is shown as text on a 576x288 monochrome heads-up display and may also be read aloud, so keep it short: 1-3 plain sentences, no markdown, no bullet lists unless the user explicitly asks for a list.",
"Your reply is shown as text on a 580x300 monochrome heads-up display and may also be read aloud, so keep it short: 1-3 plain sentences, no markdown, no bullet lists unless the user explicitly asks for a list.",
"Prefer doing things with the tools you have over describing how the user could do them; when a tool can answer or act, use it.",
"If a tool fails or a capability is missing, say so briefly rather than inventing a result.",
].join(" ");
+2 -2
View File
@@ -1,4 +1,4 @@
import { G2_LENS_HEIGHT, GrayImage } from "../graphics/image";
import { G2_LENS_HEIGHT, G2_LENS_WIDTH, GrayImage } from "../graphics/image";
import { wrapText } from "../graphics/textwrap";
import { getDefaultSmallFont, type BdfFont } from "../graphics/bdffont";
import { clamp } from "../util/numeric-util";
@@ -330,7 +330,7 @@ export class TextPageLayer implements Layer {
paint(ctx: LayerContext): GrayImage {
const font = getDefaultSmallFont();
const image = new GrayImage(576, 288, 0);
const image = new GrayImage(G2_LENS_WIDTH, G2_LENS_HEIGHT, 0);
image.drawText(font, 18, 14, this.title, 220);
image.drawRect(12, 12, 552, 264, 52);