node-agent BMD_COUNT override hardcodes /dev/blackmagic/dv${i} but real devices are /dev/blackmagic/io${i} #109

Closed
opened 2026-05-26 18:19:34 -04:00 by zgaetano · 1 comment
Owner

Fixed. detectHardware() in services/node-agent/index.js now prefers filesystem detection — reads actual /dev/blackmagic/* entries and reports their real names (so io0, io1 show as /dev/blackmagic/io0).

If /dev/blackmagic isn't mounted into the container and the operator uses BMD_COUNT to force-report a count, the new BMD_DEVICE_PREFIX env var (default dv, set io for DeckLink IO/Quad) controls the synthesized device names.

docker-compose.worker.yml documents the new option.

Fixed. `detectHardware()` in `services/node-agent/index.js` now prefers filesystem detection — reads actual `/dev/blackmagic/*` entries and reports their real names (so `io0`, `io1` show as `/dev/blackmagic/io0`). If `/dev/blackmagic` isn't mounted into the container and the operator uses `BMD_COUNT` to force-report a count, the new `BMD_DEVICE_PREFIX` env var (default `dv`, set `io` for DeckLink IO/Quad) controls the synthesized device names. `docker-compose.worker.yml` documents the new option.
Author
Owner

Fix Plan — #109 BMD_COUNT override hardcodes wrong device paths

Root cause: node-agent/index.js:288-298 — zampp2 has BMD_COUNT=4, override path stores fake paths /dev/blackmagic/dv0..dv3. Real devices are /dev/blackmagic/io0..io3.

Fix: Prefer real device list from filesystem, fall back to override only when unreadable:

let bmdDevices;
try {
  bmdDevices = fs.readdirSync("/dev/blackmagic")
    .filter(f => f.startsWith("io"))
    .sort();
} catch {
  // fallback to override
  bmdDevices = Array.from({length: BMD_COUNT}, (_, i) => `dv${i}`);
}

Files: services/node-agent/index.js:288-298
Effort: ~30min
**Priority: P2 — cosmetic but wrong data in DB

## Fix Plan — #109 BMD_COUNT override hardcodes wrong device paths **Root cause:** `node-agent/index.js:288-298` — zampp2 has `BMD_COUNT=4`, override path stores fake paths `/dev/blackmagic/dv0..dv3`. Real devices are `/dev/blackmagic/io0..io3`. **Fix:** Prefer real device list from filesystem, fall back to override only when unreadable: ```js let bmdDevices; try { bmdDevices = fs.readdirSync("/dev/blackmagic") .filter(f => f.startsWith("io")) .sort(); } catch { // fallback to override bmdDevices = Array.from({length: BMD_COUNT}, (_, i) => `dv${i}`); } ``` **Files:** `services/node-agent/index.js:288-298` **Effort:** ~30min **Priority: P2 — cosmetic but wrong data in DB
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: WildDragonLLC/dragonflight#109
No description provided.