Instrument Autodetection Failure: The instlist command outputs JSON formatted devices ({"event": "instruments", "devices": [{"port": 1, "name": "libusb0-0001 (X-Rite i1 Pro 2)", "type": "X-Rite i1 Pro 2"}]}), but src/js/chartread.js only parses legacy plain-text regex (1: 'i1Pro' on 'USB'), failing to populate detected instruments.
Calibrate Button Ineffective (Ignored Stdin / Console Keystroke Block): When starting chartread, Argyll prompts Place the instrument on its reflective white reference S/N ..., and then hit any key to continue. Clicking the [✓ Calibrate] button does not advance the process because on Windows, ArgyllCMS tools by default read interactive keystrokes directly from the console buffer (_getch() / ReadConsoleInput()), completely bypassing the piped standard input stream (stdin).
Root Cause Analysis
Console vs Pipe Mode in ArgyllCMS: Without the environment variable ARGYLL_NOT_INTERACTIVE=1, Argyll tools poll raw Windows console events rather than reading piped stdin. In headless/GUI child processes with CREATE_NO_WINDOW and piped stdin, input sent via stdin.write_all() is never consumed by Argyll.
JSON Parser Missing in chartread.js: instlist in our Argyll build outputs JSON events (event === "instruments"). The frontend regex parser does not decode the JSON structure.
Steps to Reproduce
Open Stage 3 and click ↻ Detect -> Dropdown displays "No instruments found via instlist" despite a connected i1 Pro 2.
Click Start Measurement -> chartread spawns and outputs white reference calibration prompt.
Click ✓ Calibrate -> Nothing happens; chartread remains blocked waiting for a console keypress.
Remediation & Implementation Details
Backend (src-tauri/src/process_manager.rs):
Add command.env("ARGYLL_NOT_INTERACTIVE", "1"); to ProcessManager::spawn so all Argyll sub-processes switch from raw console polling to standard piped stdin stream reads.
Frontend (src/js/chartread.js):
Update detect_instruments stdout listener to accumulate output and parse JSON devices: [{ port, name, type }] (with fallback to legacy regex line matching).
Update calibration prompt matchers to detect white reference, place the instrument, and hit any key to continue.
Ensure send_stdin cleanly flushes " \n" to advance calibration and strip read prompts.
### Bug Description
In Stage 3 (Measure Target / `chartread`):
1. **Instrument Autodetection Failure**: The `instlist` command outputs JSON formatted devices (`{"event": "instruments", "devices": [{"port": 1, "name": "libusb0-0001 (X-Rite i1 Pro 2)", "type": "X-Rite i1 Pro 2"}]}`), but `src/js/chartread.js` only parses legacy plain-text regex (`1: 'i1Pro' on 'USB'`), failing to populate detected instruments.
2. **Calibrate Button Ineffective (Ignored Stdin / Console Keystroke Block)**: When starting `chartread`, Argyll prompts `Place the instrument on its reflective white reference S/N ..., and then hit any key to continue`. Clicking the `[✓ Calibrate]` button does not advance the process because on Windows, ArgyllCMS tools by default read interactive keystrokes directly from the console buffer (`_getch()` / `ReadConsoleInput()`), completely bypassing the piped standard input stream (`stdin`).
---
### Root Cause Analysis
1. **Console vs Pipe Mode in ArgyllCMS**: Without the environment variable `ARGYLL_NOT_INTERACTIVE=1`, Argyll tools poll raw Windows console events rather than reading piped stdin. In headless/GUI child processes with `CREATE_NO_WINDOW` and piped stdin, input sent via `stdin.write_all()` is never consumed by Argyll.
2. **JSON Parser Missing in `chartread.js`**: `instlist` in our Argyll build outputs JSON events (`event === "instruments"`). The frontend regex parser does not decode the JSON structure.
---
### Steps to Reproduce
1. Open Stage 3 and click `↻ Detect` -> Dropdown displays "No instruments found via instlist" despite a connected i1 Pro 2.
2. Click `Start Measurement` -> `chartread` spawns and outputs white reference calibration prompt.
3. Click `✓ Calibrate` -> Nothing happens; `chartread` remains blocked waiting for a console keypress.
---
### Remediation & Implementation Details
1. **Backend (`src-tauri/src/process_manager.rs`)**:
- Add `command.env("ARGYLL_NOT_INTERACTIVE", "1");` to `ProcessManager::spawn` so all Argyll sub-processes switch from raw console polling to standard piped stdin stream reads.
2. **Frontend (`src/js/chartread.js`)**:
- Update `detect_instruments` stdout listener to accumulate output and parse JSON `devices: [{ port, name, type }]` (with fallback to legacy regex line matching).
- Update calibration prompt matchers to detect `white reference`, `place the instrument`, and `hit any key to continue`.
- Ensure `send_stdin` cleanly flushes `" \n"` to advance calibration and strip read prompts.
gronod
added this to the Milestone 11: Enterprise Colour Workflow (v0.6.0) milestone 2026-08-29 13:21:24 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Bug Description
In Stage 3 (Measure Target /
chartread):instlistcommand outputs JSON formatted devices ({"event": "instruments", "devices": [{"port": 1, "name": "libusb0-0001 (X-Rite i1 Pro 2)", "type": "X-Rite i1 Pro 2"}]}), butsrc/js/chartread.jsonly parses legacy plain-text regex (1: 'i1Pro' on 'USB'), failing to populate detected instruments.chartread, Argyll promptsPlace the instrument on its reflective white reference S/N ..., and then hit any key to continue. Clicking the[✓ Calibrate]button does not advance the process because on Windows, ArgyllCMS tools by default read interactive keystrokes directly from the console buffer (_getch()/ReadConsoleInput()), completely bypassing the piped standard input stream (stdin).Root Cause Analysis
ARGYLL_NOT_INTERACTIVE=1, Argyll tools poll raw Windows console events rather than reading piped stdin. In headless/GUI child processes withCREATE_NO_WINDOWand piped stdin, input sent viastdin.write_all()is never consumed by Argyll.chartread.js:instlistin our Argyll build outputs JSON events (event === "instruments"). The frontend regex parser does not decode the JSON structure.Steps to Reproduce
↻ Detect-> Dropdown displays "No instruments found via instlist" despite a connected i1 Pro 2.Start Measurement->chartreadspawns and outputs white reference calibration prompt.✓ Calibrate-> Nothing happens;chartreadremains blocked waiting for a console keypress.Remediation & Implementation Details
src-tauri/src/process_manager.rs):command.env("ARGYLL_NOT_INTERACTIVE", "1");toProcessManager::spawnso all Argyll sub-processes switch from raw console polling to standard piped stdin stream reads.src/js/chartread.js):detect_instrumentsstdout listener to accumulate output and parse JSONdevices: [{ port, name, type }](with fallback to legacy regex line matching).white reference,place the instrument, andhit any key to continue.send_stdincleanly flushes" \n"to advance calibration and strip read prompts.