Expand screen resolution to the full 640x480

This commit is contained in:
James Babcock committed 2026-07-31 12:57:10 -07:00
1 parent 818f33ce33
commit 6d42f0e65e
7 files changed
+38 -36

No files matched your search

@@ -28,10 +28,10 @@ import java.util.Map;
public class FaceclawBleCommunicator implements FaceclawBleListener, Runnable {
private static final String TAG = "FaceclawComm";
// 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.
// The EvenHub image container is a memory carrier only. Its 576x288 geometry
// gives the firmware separate 165888-byte display and reconstruction
// allocations: CFW reuses the former for its 640x480 packed-4bpp shadow and
// leaves the latter wholly available for compressed incoming messages.
private static final BleProtocol.ImageTileOptions DASHBOARD_TILE =
new BleProtocol.ImageTileOptions("img00", 10, 0, 0, 576, 288);
@@ -1807,7 +1807,7 @@ public class FaceclawBleCommunicator implements FaceclawBleListener, Runnable {
private void enqueueWarmupLocked() {
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
// 640x480 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);
@@ -401,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/5 img576 img580 ... directfb fbguard", which
* field 100, a string like "EVENCFW/6 img576 img640 ... directfb fbguard", which
* stock firmware never sends. Returns null when the ack carries none of it.
*/
public static FirmwareInfo parseSettingsFirmwareInfo(byte[] pb) {
+3 -3
View File
@@ -1,13 +1,13 @@
/**
* Compatibility check for the glasses firmware. Faceclaw requires the custom
* firmware: version >= 2.2.4.34 with the "img580" and "fbguard" extension tokens
* firmware: version >= 2.2.4.34 with the "img640" 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_EXTENSIONS = ["img580", "fbguard"] as const;
const REQUIRED_FIRMWARE_EXTENSIONS = ["img640", "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
@@ -64,7 +64,7 @@ export function firmwareIncompatibilityMessage(info: FirmwareInfo): string | nul
`${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 the guarded 580x300 direct-framebuffer path.`
`Faceclaw requires the modified firmware with the guarded 640x480 direct-framebuffer path.`
);
}
+20 -20
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": "48d66bbcfeb708f309d435908694d3fa920948ef9185bb6f2af7094415c15e86",
"outputSha256": "e8520b2473d6738de5a2bbf73cf4a42523ddd0153dd08f7ad99137fe94bb9d9d",
"patches": [
{
"offset": 1449549,
@@ -42,115 +42,115 @@ export const CFW_PATCH_SET: FirmwarePatchSet = {
{
"offset": 1447919,
"old": "7ef7fefd",
"new": "baf2dcf8",
"new": "baf29ef8",
"desc": "bl snapshot_side @ 0x4db968"
},
{
"offset": 1448931,
"old": "7ef704fc",
"new": "b9f2e2fe",
"new": "b9f2a4fe",
"desc": "bl snapshot_side @ 0x4dbd5c"
},
{
"offset": 1165461,
"old": "45f0cefd",
"new": "fff28df8",
"new": "fff24ff8",
"desc": "bl image_deferred (deferred consumer -> FIFO restore + worker, both lenses)"
},
{
"offset": 1186287,
"old": "d9f7d4ff",
"new": "faf2a0fc",
"new": "faf262fc",
"desc": "bl settings_send_wrapper (append caps field 100)"
},
{
"offset": 1183983,
"old": "f4f75aff",
"new": "faf2fefe",
"new": "faf2c0fe",
"desc": "bl settings_decode_wrapper (Faceclaw lease field 101)"
},
{
"offset": 926945,
"old": "08f068fa",
"new": "39f321fc",
"new": "39f3e3fb",
"desc": "bl faceclaw_display_start @ 0x45c65a (fail-open double-tap takeover)"
},
{
"offset": 927137,
"old": "08f008fa",
"new": "39f3c1fb",
"new": "39f383fb",
"desc": "bl faceclaw_display_start @ 0x45c71a (fail-open double-tap takeover)"
},
{
"offset": 822553,
"old": "28f003f8",
"new": "53f373fb",
"new": "53f335fb",
"desc": "bl evenhub_longpress (replaces force-quit dialog)"
},
{
"offset": 823369,
"old": "1cf09bfb",
"new": "53f3f7f9",
"new": "53f3b9f9",
"desc": "bl ring_release (forward ring release-long-press)"
},
{
"offset": 1474137,
"old": "7fb50600",
"new": "b4f259ba",
"new": "b4f21bba",
"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)"
"desc": "bl display_copy_hook @ 0x473c8e (640x480 direct framebuffer)"
},
{
"offset": 1022959,
"old": "f8f754fe",
"new": "20f33efb",
"desc": "bl display_copy_hook @ 0x473d68 (580x300 direct framebuffer)"
"desc": "bl display_copy_hook @ 0x473d68 (640x480 direct framebuffer)"
},
{
"offset": 4301227,
"old": "",
"new": "02fb01f044f6d341c0f24701084700bf084644f61751c0f24701084770b500284ed001684ef66062ccf2ff02914218bf70bd90f8081190f8095142f6c52c8d42c0f2500c2ad205eb8501014491f80d2191f80e4191f80ae191f80b3191f80c1142ea0424012c4ff0010298bf14466e1c054680f80961b9b164294eea032028bf6421012888bf024644f62060824228bf02460cf5e2731046984706e0002180f80811bde870406047e047d5f8040138b149f29942c0f244022146bde87040104770bd00bf2de9f04f99b043f6fc76c2f20006d6f8009048466ff39600b0f1005f40f08c81d9f800004ef66068ccf2ff08404540f0838199f81c02002800f06d81d9f81852002d00f0688140f2b870c2f20000d0f800a004a801f0b8f8baf1000f00f0b18140f2030ccff6807caaf180034ff41640002200bfc3f88020c3f88420c3f88820c3f88c20c3f89020c3f89420c3f89820c3f89c20c3f8a020c3f8a420c3f8a820c3f8ac20c3f8b020c3f8b420c3f8b820c3f8bc20c3f8c020c3f8c420c3f8c820c3f8cc20c3f8d020c3f8d420c3f8d820c3f8dc20c3f8e020c3f8e420c3f8e820c3f8ec20c3f8f020c3f8f420c3f8f820c3f8fc20c3f80021c3f80421c3f80821c3f80c21c3f81021c3f81421c3f81821c3f81c21c3f82021c3f82421c3f82821c3f82c21c3f83021c3f83421c3f83821c3f83c21c3f84021c3f84421c3f84821c3f84c21c3f85021c3f85421c3f85821c3f85c21c3f86021c3f86421c3f86821c3f86c21c3f87021c3f87421c3f87821c3f87c2103f5807340387ff47baf47f29d005044002200bf002300bfef5cc418e91804f80e7c4f7804f80d7c8f7804f80c7ccf7804f80b7c0f7904f80a7c4f7904f8097c8f7904f8087ccf7904f8077c0f7a04f8067c4f7a04f8057c8f7a04f8047ccf7a04f8037c0f7b04f8027c4f7b04f8017c8f7bc754cf7b1d3367700f7cb3f5917fa7704f7ce7708f7c2771cf7c67710f7da7714f7de7718f7d2772cf7d67720f7ea7724f7ee7728f7e2773cf7e6773097fa173b1d1013205f59175b2f5967f00f5a070a7d1d6f800e00eea0c00b0f1005f40f08080def8000040457bd19ef8ce00002840f0c6809ef8dc00002100288df8141000f0268105aa505c002800f0f98053185878002800f0cf809878002800f0cd80d878002800f0cb801879002800f0c9805879002800f0c7809879002800f0c580d879002800f0c380187a002800f0c180587a002800f0bf80987a002800f0bd80d87a002800f0bb80187b002800f0b980587b002800f0b780987b002800f0b580d87b002800f0b380187c002800f0b180587c002800f0af80987c002800f0ad80d87c002800f0ab8014315029abd1cbe099f81e0268b1d9f8200238b144f63421c2f207010968401a002871dc002089f81e024cf61520c0f2460019b0bde8f04f004744f6d341c0f247014ff409708847002843d00021002200bf831881540432b2f5097f59709970d970f6d1012180f8ce104ff0ff31c0f80080a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe1010e0002089f81c02c9f8180289f81e02012089f81d024cf61520c0f24600804714e000203060002089f81c02c9f818024ff4163045f20f11069005a8c0f24701cdf814a08847012089f81e0204a800f089ffc9f8d40019b0bde8f08f013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f2921d84ff0520050541dd00a4445204e29507018d04f204d29907014d052204c29d07010d044204b2910710cd045204a29507108d052204929907104d020204829d07140f0898600208df8630001219ef8dd00002870d0002205ab985c00284fd09f18787838b3b87838b3f87838b3387938b3787938b3b87938b3f87938b3387a38b3787a38b3b87a38b3f87a38b3387b38b3787b38b3b87b38b3f87b38b3387c38b3787c38b3b87c38b3f87c38b31432502ad2d13ce0013222e0023220e003321ee004321ce005321ae0063218e0073216e0083214e0093212e00a3210e00b320ee00c320ce00d320ae00e3208e00f3206e0103204e0113202e0123200e013324f2a15d84ff05300985411d013444b204e2a58700cd049204d2a987008d050204c2ad87004d020204b2a187140f0608100208df8630001319ef8de0000286cd0002105aa505c00284fd05318587838b3987838b3d87838b3187938b3587938b3987938b3d87938b3187a38b3587a38b3987a38b3d87a38b3187b38b3587b38b3987b38b3d87b38b3187c38b3587c38b3987c38b3d87c38b314315029d2d138e0013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f2911d84ff0440050540dd00a4455204e29507008d050204d29907004d020204c29d07040f0ec8000208df8630001219ef8df0000284dd0002105aa505c002800f0bc8053185878002800f092809878002800f09080d878002800f08e801879002800f08c805879002800f08a809879002800f08880d879002800f08680187a002800f08480587a002800f08280987a002800f08080d87a00287ed0187b00287dd0587b00287cd0987b00287bd0d87b00287ad0187c002879d0587c002878d0987c002877d0d87c002876d014315029b4d1d0e0002940f0d180002105aa505c002800f0b88053185878002800f08e809878002800f08c80d878002800f08a801879002800f088805879002800f086809879002800f08480d879002800f08280187a002800f08080587a00287ed0987a00287dd0d87a00287cd0187b00287bd0587b00287ad0987b002879d0d87b002878d0187c002877d0587c002876d0987c002875d0d87c002874d014315029b6d181e0013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f295ad84ff05300505456d00a444e204e29507051d041204d2990704dd050204c29d07049d04f204b29107145d046204a29507141d02020492990713dd00020d0713de00020107113e7002058719fe6013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f290dd84ff04f00505409d00a444b204e29507004d020204d29907040f0788400208df8630000220df1140b1bf80200002850d00beb0203587838b3987838b3d87838b3187938b3587938b3987938b3dLine truncated
"new": "02fb01f044f6d341c0f24701084700bf084644f61751c0f24701084770b500284ed001684ef66162ccf2ff02914218bf70bd90f8081190f8095142f6c52c8d42c0f2500c2ad205eb8501014491f80d2191f80e4191f80ae191f80b3191f80c1142ea0424012c4ff0010298bf14466e1c054680f80961b9b164294eea032028bf6421012888bf024644f62060824228bf02460cf5e2731046984706e0002180f80811bde870406047e047d5f8040138b149f29942c0f244022146bde87040104770bd00bf2de9f04f99b043f6fc76c2f20006d6f8009048466ff39600b0f1005f40f04c81d9f800004ef66165ccf2ff05a84240f0438199f81c02002800f02d81d9f81842002c00f0288140f2b870c2f20000d0f8008004a801f07af8b8f1000f00f0708140f2030c45f24077cff6807ca4f1600008f160026ff0bf03c0f20207016ed4182166416ec0336166816ebb42a166c16ee166016f2167416f6167816fa167c16fe167d0f88010c4f88010d0f88410c4f88410d0f88810c4f88810d0f88c10c4f88c10d0f89010c4f89010d0f89410c4f89410d0f89810c4f89810d0f89c10c4f89c10d0f8a010c4f8a010d0f8a410c4f8a410d0f8a810c4f8a810d0f8ac10c4f8ac10d0f8b010c4f8b010d0f8b410c4f8b410d0f8b810c4f8b810d0f8bc10c4f8bc1050f8c01fc4f8c0104168c4f8c4108168c4f8c810c168c4f8cc100169c4f8d0104169c4f8d4108169c4f8d810c169c4f8dc10016ac4f8e010416ac4f8e410816ac4f8e810c16ac4f8ec10016bc4f8f010416bc4f8f410816bc4f8f810c16bc4f8fc10016cc4f80011416cc4f80411816cc4f80811c16cc4f80c11016dc4f81011416dc4f81411816dc4f81811c16dc4f81c117ff462afd6f800e00eea0c00b0f1005f40f08080def80000a8427bd19ef8ce00002840f0c5809ef8dc00002100288df8141000f0258105aa505c002800f0f88053185878002800f0ce809878002800f0cc80d878002800f0ca801879002800f0c8805879002800f0c6809879002800f0c480d879002800f0c280187a002800f0c080587a002800f0be80987a002800f0bc80d87a002800f0ba80187b002800f0b880587b002800f0b680987b002800f0b480d87b002800f0b280187c002800f0b080587c002800f0ae80987c002800f0ac80d87c002800f0aa8014315029abd1cae099f81e0268b1d9f8200238b144f63421c2f207010968401a002870dc002089f81e024cf61520c0f2460019b0bde8f04f004744f6d341c0f247014ff409708847002842d00021002200bf831881540432b2f5097f59709970d970f6d1012180f8ce104ff0ff310560a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe1010e0002089f81c02c9f8180289f81e02012089f81d024cf61520c0f24600804714e000203060002089f81c02c9f818024ff4163045f20f11069005a8c0f24701cdf814808847012089f81e0204a800f08cffc9f8d40019b0bde8f08f013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f2921d84ff0520050541dd00a4445204e29507018d04f204d29907014d052204c29d07010d044204b2910710cd045204a29507108d052204929907104d020204829d07140f08c8600208df8630001219ef8dd00002870d0002205ab985c00284fd09f18787838b3b87838b3f87838b3387938b3787938b3b87938b3f87938b3387a38b3787a38b3b87a38b3f87a38b3387b38b3787b38b3b87b38b3f87b38b3387c38b3787c38b3b87c38b3f87c38b31432502ad2d13ce0013222e0023220e003321ee004321ce005321ae0063218e0073216e0083214e0093212e00a3210e00b320ee00c320ce00d320ae00e3208e00f3206e0103204e0113202e0123200e013324f2a15d84ff05300985411d013444b204e2a58700cd049204d2a987008d050204c2ad87004d020204b2a187140f0608100208df8630001319ef8de0000286cd0002105aa505c00284fd05318587838b3987838b3d87838b3187938b3587938b3987938b3d87938b3187a38b3587a38b3987a38b3d87a38b3187b38b3587b38b3987b38b3d87b38b3187c38b3587c38b3987c38b3d87c38b314315029d2d138e0013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f2911d84ff0440050540dd00a4455204e29507008d050204d29907004d020204c29d07040f0ec8000208df8630001219ef8df0000284dd0002105aa505c002800f0bc8053185878002800f092809878002800f09080d878002800f08e801879002800f08c805879002800f08a809879002800f08880d879002800f08680187a002800f08480587a002800f08280987a002800f08080d87a00287ed0187b00287dd0587b00287cd0987b00287bd0d87b00287ad0187c002879d0587c002878d0987c002877d0d87c002876d014315029b4d1d0e0002940f0d180002105aa505c002800f0b88053185878002800f08e809878002800f08c80d878002800f08a801879002800f088805879002800f086809879002800f08480d879002800f08280187a002800f08080587a00287ed0987a00287dd0d87a00287cd0187b00287bd0587b00287ad0987b002879d0d87b002878d0187c002877d0587c002876d0987c002875d0d87c002874d014315029b6d181e0013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f295ad84ff05300505456d00a444e204e29507051d041204d2990704dd050204c29d07049d04f204b29107145d046204a29507141d02020492990713dd00020d0713de00020107113e7002058719fe6013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f290dd84ff04f00505409d00a444b204e29507004d020204d29907040f07b8400208df8630000220df1140b1bf80200002850d00beb0203587838b3987838b3d87838b3187938b3587938b3987938b3d87938b3187a38b3587a38b3987a38b3d87a38b3187b38b3587b38b3987b38b3d87b38b3187c38b3587c38b3987c38b3d87c38b31432502ad0d12be0013222e0023220e003321ee004321ce005321ae0063218e0073216e0083214e0093212e00a3210e00b320ee00c320ce00d320ae00e3208e00f3206e0103204e0113202e012320Line truncated
"desc": "append injected blobs to main-app payload"
},
{
"offset": 777711,
"old": "44c33500",
"new": "5e013600",
"new": "b2003600",
"desc": "main-app subheader payload size (ps)"
},
{
"offset": 152,
"old": "c4c33500",
"new": "de013600",
"new": "32013600",
"desc": "main-app TOC entry size (ps + 128)"
},
{
"offset": 777831,
"old": "44c33504",
"new": "5e013604",
"new": "b2003604",
"desc": "main-app preamble length (low 24 bits)"
},
{
"offset": 777835,
"old": "df8110c9",
"new": "5e1ef1ea",
"new": "20ac3023",
"desc": "[5] ota/s200_firmware_ota.bin preamble crc32"
},
{
"offset": 156,
"old": "c1be0fb1",
"new": "3f9497ba",
"new": "2668f4d0",
"desc": "[5] ota/s200_firmware_ota.bin component crc32c (TOC)"
},
{
"offset": 777715,
"old": "c1be0fb1",
"new": "3f9497ba",
"new": "2668f4d0",
"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 = 580;
export const G2_LENS_HEIGHT = 300;
export const G2_LENS_WIDTH = 640;
export const G2_LENS_HEIGHT = 480;
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 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.",
"Your reply is shown as text on a 640x480 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(" ");
+6 -4
View File
@@ -332,13 +332,15 @@ export class TextPageLayer implements Layer {
const font = getDefaultSmallFont();
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);
image.drawRect(12, 12, G2_LENS_WIDTH - 24, G2_LENS_HEIGHT - 24, 52);
const wrapped = wrapText(font, this.body, 520);
for (let index = 0; index < wrapped.length; index++) {
const wrapped = wrapText(font, this.body, G2_LENS_WIDTH - 60);
const footerY = G2_LENS_HEIGHT - 48;
const maxBodyLines = Math.max(0, Math.floor((footerY - 50) / 14));
for (let index = 0; index < Math.min(wrapped.length, maxBodyLines); index++) {
image.drawText(font, 24, 42 + index * 14, wrapped[index]!, 190);
}
image.drawText(font, 24, 252, `${GESTURE_DOUBLE_CLICK} back`, 110);
image.drawText(font, 24, footerY, `${GESTURE_DOUBLE_CLICK} back`, 110);
return image;
}