Beta models DSP 206 and FIR DSP 408 (without the FIR filters), read-only until allowed
Never tested on real hardware, so they are only selectable by hand and send no changes until the user has compared the shown values with the DSP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0a1f282c63
commit
86ee492ec3
11 files changed
+121
-21
No files matched your search
@@ -109,6 +109,10 @@ and the DSP's own mirroring inside groups, limiter-active bit mask, preset impor
|
|||||||
|
|
||||||
Not verified yet – ask for a log (`python server.py -v`) from real hardware before changing protocol code here:
|
Not verified yet – ask for a log (`python server.py -v`) from real hardware before changing protocol code here:
|
||||||
|
|
||||||
|
* **Beta models** `206` and `408fir` – never seen on real hardware, same protocol and memory layout are only assumed
|
||||||
|
(also the USB ID). Never auto-detected (`detect_model`, a FIR device must not pass as a 408). `Device.read_only` holds
|
||||||
|
back every write (`P.READ_COMMANDS`, `BETA_READ_ACTIONS`) until the user allows changes (`beta_write`). The FIR
|
||||||
|
filters are deliberately not implemented; ask testers for a preset export (it holds the raw image) and a log first.
|
||||||
* **DSP 408 on real hardware** (layout and frames match published captures, limiter bits for Out 5–8 assumed)
|
* **DSP 408 on real hardware** (layout and frames match published captures, limiter bits for Out 5–8 assumed)
|
||||||
* USB on Windows and Linux against a real DSP (only tested against a fake HID device)
|
* USB on Windows and Linux against a real DSP (only tested against a fake HID device)
|
||||||
* Where the PEQ bypass flag lives in the memory image; format of the set-command acknowledgement; where the number
|
* Where the PEQ bypass flag lives in the memory image; format of the set-command acknowledgement; where the number
|
||||||
|
|||||||
@@ -77,6 +77,12 @@ Control both devices at the same time from your phone, tablet or computer – ov
|
|||||||
|--------|---------|-----|-------------------------|
|
|--------|---------|-----|-------------------------|
|
||||||
| t.racks DSP 204 | ✓ | ✓ | yes (firmware V0104P, USB on macOS) |
|
| t.racks DSP 204 | ✓ | ✓ | yes (firmware V0104P, USB on macOS) |
|
||||||
| t.racks DSP 408 | ✓ | ✓ | not yet – frames match published captures |
|
| t.racks DSP 408 | ✓ | ✓ | not yet – frames match published captures |
|
||||||
|
| t.racks DSP 206 (beta) | ✓ | ? | no – assumed to work like the others, testers wanted |
|
||||||
|
| t.racks FIR DSP 408 (beta) | ✓ | ? | no – as above; the FIR filters themselves are not supported |
|
||||||
|
|
||||||
|
Beta models are not detected automatically: choose them by hand when adding the device. They start read-only. Compare
|
||||||
|
the shown values with the DSP; if they match, switch on changes in the note above the mixer (amplifiers off while
|
||||||
|
testing). If they don't match, please send the file from File… → Export.
|
||||||
|
|
||||||
The DSPs accept only **one** connection at a time – close any other control software first.
|
The DSPs accept only **one** connection at a time – close any other control software first.
|
||||||
|
|
||||||
|
|||||||
+17
-3
@@ -22,12 +22,14 @@ class Device:
|
|||||||
def __init__(self, dev_id: str, name: str, host: str, port: int = P.PORT, model: str = "auto",
|
def __init__(self, dev_id: str, name: str, host: str, port: int = P.PORT, model: str = "auto",
|
||||||
addr: int = 1, autoconnect: bool = True, on_event=None, transport: str = "tcp", usb: str = "",
|
addr: int = 1, autoconnect: bool = True, on_event=None, transport: str = "tcp", usb: str = "",
|
||||||
lock_code: str = "", auto_unlock: bool = False, test_saved: list | None = None,
|
lock_code: str = "", auto_unlock: bool = False, test_saved: list | None = None,
|
||||||
colors: dict | None = None, maxgain: dict | None = None, linknames: dict | None = None):
|
colors: dict | None = None, maxgain: dict | None = None, linknames: dict | None = None,
|
||||||
|
beta_write: bool = False):
|
||||||
self.id = dev_id
|
self.id = dev_id
|
||||||
self.name = name
|
self.name = name
|
||||||
self.host = host
|
self.host = host
|
||||||
self.port = port
|
self.port = port
|
||||||
self.model_key = model # "auto", "204" or "408"
|
self.model_key = model # "auto" or a key of P.MODELS
|
||||||
|
self.beta_write = beta_write # beta models: the user has checked the shown values and allowed changes
|
||||||
self.addr = addr
|
self.addr = addr
|
||||||
self.autoconnect = autoconnect
|
self.autoconnect = autoconnect
|
||||||
self.transport = "usb" if transport == "usb" else "tcp"
|
self.transport = "usb" if transport == "usb" else "tcp"
|
||||||
@@ -75,7 +77,8 @@ class Device:
|
|||||||
"model": self.model_key, "addr": self.addr, "autoconnect": self.autoconnect,
|
"model": self.model_key, "addr": self.addr, "autoconnect": self.autoconnect,
|
||||||
"transport": self.transport, "usb": self.usb,
|
"transport": self.transport, "usb": self.usb,
|
||||||
"lock_code": self.lock_code, "auto_unlock": self.auto_unlock, "test_saved": self.test_saved,
|
"lock_code": self.lock_code, "auto_unlock": self.auto_unlock, "test_saved": self.test_saved,
|
||||||
"colors": self.colors, "maxgain": self.maxgain, "linknames": self.linknames}
|
"colors": self.colors, "maxgain": self.maxgain, "linknames": self.linknames,
|
||||||
|
"beta_write": self.beta_write}
|
||||||
|
|
||||||
def snapshot(self) -> dict:
|
def snapshot(self) -> dict:
|
||||||
cfg = self.config()
|
cfg = self.config()
|
||||||
@@ -85,6 +88,7 @@ class Device:
|
|||||||
"detected_model": self.model_name or None,
|
"detected_model": self.model_name or None,
|
||||||
"n_in": self.model.n_in if self.model else 0,
|
"n_in": self.model.n_in if self.model else 0,
|
||||||
"n_out": self.model.n_out if self.model else 0,
|
"n_out": self.model.n_out if self.model else 0,
|
||||||
|
"beta": bool(self.model and self.model.beta), "read_only": self.read_only,
|
||||||
"presets": self.presets, "state": self.state}
|
"presets": self.presets, "state": self.state}
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
@@ -104,10 +108,17 @@ class Device:
|
|||||||
await self._close()
|
await self._close()
|
||||||
self._set_status("disconnected")
|
self._set_status("disconnected")
|
||||||
|
|
||||||
|
@property
|
||||||
|
def read_only(self) -> bool:
|
||||||
|
"""A beta model only reads until the user has compared the shown values with the DSP."""
|
||||||
|
return bool(self.model and self.model.beta and not self.beta_write)
|
||||||
|
|
||||||
def set_param(self, kind: str, idx: int, param: str, value):
|
def set_param(self, kind: str, idx: int, param: str, value):
|
||||||
"""Update local state and queue the command (coalesced per parameter)."""
|
"""Update local state and queue the command (coalesced per parameter)."""
|
||||||
if not self.state or not self.model:
|
if not self.state or not self.model:
|
||||||
raise RuntimeError("device not loaded")
|
raise RuntimeError("device not loaded")
|
||||||
|
if self.read_only:
|
||||||
|
raise RuntimeError("Beta model: changes are off")
|
||||||
chans = self.state["inputs" if kind == "in" else "outputs"]
|
chans = self.state["inputs" if kind == "in" else "outputs"]
|
||||||
ch = chans[idx]
|
ch = chans[idx]
|
||||||
if param == "name":
|
if param == "name":
|
||||||
@@ -332,6 +343,9 @@ class Device:
|
|||||||
"""Send one command and wait for its answer (the DSP is strictly request/response)."""
|
"""Send one command and wait for its answer (the DSP is strictly request/response)."""
|
||||||
if not self._writer:
|
if not self._writer:
|
||||||
raise ConnectionError("not connected")
|
raise ConnectionError("not connected")
|
||||||
|
if self.read_only and cmd not in P.READ_COMMANDS:
|
||||||
|
log.warning("%s: read-only, command 0x%02x not sent", self.name, cmd)
|
||||||
|
return None
|
||||||
async with self._lock:
|
async with self._lock:
|
||||||
deadline = time.monotonic() + timeout
|
deadline = time.monotonic() + timeout
|
||||||
self._writer.write(P.build_frame(cmd, payload, self.addr))
|
self._writer.write(P.build_frame(cmd, payload, self.addr))
|
||||||
|
|||||||
+13
-3
@@ -209,6 +209,7 @@ class Model:
|
|||||||
name: str
|
name: str
|
||||||
n_in: int
|
n_in: int
|
||||||
n_out: int
|
n_out: int
|
||||||
|
beta: bool = False # layout assumed from the other models, never seen on a real device; only selectable by hand
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def in_size(self) -> int:
|
def in_size(self) -> int:
|
||||||
@@ -247,12 +248,21 @@ class Model:
|
|||||||
return idx if kind == "in" else 4 + idx
|
return idx if kind == "in" else 4 + idx
|
||||||
|
|
||||||
|
|
||||||
MODELS = {"204": Model("DSP 204", 2, 4), "408": Model("DSP 408", 4, 8)}
|
MODELS = {"204": Model("DSP 204", 2, 4), "408": Model("DSP 408", 4, 8),
|
||||||
|
"206": Model("DSP 206", 2, 6, beta=True), "408fir": Model("FIR DSP 408", 4, 8, beta=True)}
|
||||||
|
|
||||||
|
# what a DSP may be sent while its model is read-only (see Device.read_only): connecting and looking
|
||||||
|
READ_COMMANDS = frozenset((CMD_HANDSHAKE, CMD_LOGOUT, CMD_STATUS, CMD_DEVICE_INFO, CMD_INIT_14, CMD_INIT_22,
|
||||||
|
CMD_CONFIG_REQUEST, CMD_PRESET_NAME, CMD_PRESET_COUNT, CMD_UNLOCK, CMD_METER))
|
||||||
|
|
||||||
|
|
||||||
def detect_model(info: str) -> str | None:
|
def detect_model(info: str) -> str | None:
|
||||||
for key in MODELS:
|
"""Beta models are never detected, and a FIR device must not pass as a plain DSP 408."""
|
||||||
if f"DSP{key}" in info.replace(" ", ""):
|
info = info.replace(" ", "").upper()
|
||||||
|
if "FIR" in info:
|
||||||
|
return None
|
||||||
|
for key, model in MODELS.items():
|
||||||
|
if not model.beta and f"DSP{key}" in info:
|
||||||
return key
|
return key
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
@@ -154,6 +154,11 @@ def clean_colors(v) -> dict:
|
|||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
# what a beta model allows before changes are switched on: nothing here writes to the DSP
|
||||||
|
BETA_READ_ACTIONS = ("connect", "disconnect", "refresh", "export", "backups", "unlock", "colors", "maxgain",
|
||||||
|
"linknames", "betawrite")
|
||||||
|
|
||||||
|
|
||||||
def clean_linknames(v) -> dict:
|
def clean_linknames(v) -> dict:
|
||||||
"""Names of link groups, keyed by kind and members: {"out:0,1": "Tops"}. A changed group loses its name."""
|
"""Names of link groups, keyed by kind and members: {"out:0,1": "Tops"}. A changed group loses its name."""
|
||||||
out = {}
|
out = {}
|
||||||
@@ -337,7 +342,8 @@ class App:
|
|||||||
transport="usb" if usb else "tcp", usb=str(d.get("usb") or ""),
|
transport="usb" if usb else "tcp", usb=str(d.get("usb") or ""),
|
||||||
lock_code=str(d.get("lock_code") or ""), auto_unlock=bool(d.get("auto_unlock")),
|
lock_code=str(d.get("lock_code") or ""), auto_unlock=bool(d.get("auto_unlock")),
|
||||||
test_saved=clean_gains(d.get("test_saved")), colors=clean_colors(d.get("colors")),
|
test_saved=clean_gains(d.get("test_saved")), colors=clean_colors(d.get("colors")),
|
||||||
maxgain=clean_maxgain(d.get("maxgain")), linknames=clean_linknames(d.get("linknames")))
|
maxgain=clean_maxgain(d.get("maxgain")), linknames=clean_linknames(d.get("linknames")),
|
||||||
|
beta_write=bool(d.get("beta_write")))
|
||||||
dev.on_online = self.device_online
|
dev.on_online = self.device_online
|
||||||
self.devices[dev_id] = dev
|
self.devices[dev_id] = dev
|
||||||
if dev.autoconnect:
|
if dev.autoconnect:
|
||||||
@@ -385,6 +391,8 @@ class App:
|
|||||||
return {"ok": True}
|
return {"ok": True}
|
||||||
|
|
||||||
async def device_online(self, dev: Device):
|
async def device_online(self, dev: Device):
|
||||||
|
if dev.read_only:
|
||||||
|
return
|
||||||
await self.check_audio_test(dev)
|
await self.check_audio_test(dev)
|
||||||
if not self.mute_all["active"] and self.mute_all["restore"].get(dev.id):
|
if not self.mute_all["active"] and self.mute_all["restore"].get(dev.id):
|
||||||
self.unmute_device(dev) # released while this DSP was offline
|
self.unmute_device(dev) # released while this DSP was offline
|
||||||
@@ -403,7 +411,7 @@ class App:
|
|||||||
|
|
||||||
def set_mute_all(self, mute: bool) -> dict:
|
def set_mute_all(self, mute: bool) -> dict:
|
||||||
"""Mute every channel of every connected DSP; releasing unmutes only what was open before."""
|
"""Mute every channel of every connected DSP; releasing unmutes only what was open before."""
|
||||||
online = [d for d in self.devices.values() if d.status == "online" and d.state]
|
online = [d for d in self.devices.values() if d.status == "online" and d.state and not d.read_only]
|
||||||
if mute and not self.mute_all["active"]:
|
if mute and not self.mute_all["active"]:
|
||||||
self.mute_all["restore"] = {}
|
self.mute_all["restore"] = {}
|
||||||
for dev in online:
|
for dev in online:
|
||||||
@@ -435,7 +443,7 @@ class App:
|
|||||||
changed = 0
|
changed = 0
|
||||||
for t in body.get("targets") or []:
|
for t in body.get("targets") or []:
|
||||||
dev = self.devices.get(str(t.get("device")))
|
dev = self.devices.get(str(t.get("device")))
|
||||||
if not dev or dev.status != "online" or not dev.state:
|
if not dev or dev.status != "online" or not dev.state or dev.read_only:
|
||||||
continue
|
continue
|
||||||
if dev.test_active:
|
if dev.test_active:
|
||||||
raise RuntimeError("Audio test is on – switch it off first")
|
raise RuntimeError("Audio test is on – switch it off first")
|
||||||
@@ -794,6 +802,8 @@ class App:
|
|||||||
if dev.test_active and (action in ("preset/recall", "preset/store", "export", "import", "undo", "link")
|
if dev.test_active and (action in ("preset/recall", "preset/store", "export", "import", "undo", "link")
|
||||||
or action == "set" and body.get("param") != "mute"):
|
or action == "set" and body.get("param") != "mute"):
|
||||||
raise RuntimeError("Audio test is on – switch it off first")
|
raise RuntimeError("Audio test is on – switch it off first")
|
||||||
|
if dev.read_only and method == "POST" and action not in BETA_READ_ACTIONS:
|
||||||
|
raise RuntimeError("Beta model: changes are off")
|
||||||
if self.demo["enabled"] and not dev.demo and action == "connect":
|
if self.demo["enabled"] and not dev.demo and action == "connect":
|
||||||
raise RuntimeError("Demo mode is on – switch it off to connect the real DSPs")
|
raise RuntimeError("Demo mode is on – switch it off to connect the real DSPs")
|
||||||
if method == "DELETE" and not action:
|
if method == "DELETE" and not action:
|
||||||
@@ -805,6 +815,8 @@ class App:
|
|||||||
if method == "PUT" and not action:
|
if method == "PUT" and not action:
|
||||||
was_running = dev._want_connected
|
was_running = dev._want_connected
|
||||||
await dev.stop()
|
await dev.stop()
|
||||||
|
if body.get("model", dev.model_key) != dev.model_key:
|
||||||
|
dev.beta_write = False # another model: check the values again
|
||||||
for k in ("name", "host", "model", "usb"):
|
for k in ("name", "host", "model", "usb"):
|
||||||
if k in body:
|
if k in body:
|
||||||
setattr(dev, "model_key" if k == "model" else k, str(body[k]))
|
setattr(dev, "model_key" if k == "model" else k, str(body[k]))
|
||||||
@@ -872,6 +884,11 @@ class App:
|
|||||||
self.save()
|
self.save()
|
||||||
self.broadcast({"type": "device", "device": dev.id, "data": dev.snapshot()})
|
self.broadcast({"type": "device", "device": dev.id, "data": dev.snapshot()})
|
||||||
return {"ok": True, "colors": dev.colors}
|
return {"ok": True, "colors": dev.colors}
|
||||||
|
if action == "betawrite": # beta model: the user compared the shown values with the DSP
|
||||||
|
dev.beta_write = bool(body.get("enabled"))
|
||||||
|
self.save()
|
||||||
|
self.broadcast({"type": "device", "device": dev.id, "data": dev.snapshot()})
|
||||||
|
return {"ok": True, "read_only": dev.read_only}
|
||||||
if action == "linknames": # display only, like the colours
|
if action == "linknames": # display only, like the colours
|
||||||
dev.linknames = clean_linknames(body.get("linknames"))
|
dev.linknames = clean_linknames(body.get("linknames"))
|
||||||
self.save()
|
self.save()
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class SimDSP:
|
|||||||
def handle(self, cmd: int, p: bytes) -> tuple[int, bytes]:
|
def handle(self, cmd: int, p: bytes) -> tuple[int, bytes]:
|
||||||
m = self.model
|
m = self.model
|
||||||
if cmd == P.CMD_DEVICE_INFO:
|
if cmd == P.CMD_DEVICE_INFO:
|
||||||
return cmd, f"DSP{self.key} V010 SIM".encode()
|
return cmd, f"{m.name.replace(' ', '')} V010 SIM".encode()
|
||||||
if cmd == P.CMD_PRESET_COUNT:
|
if cmd == P.CMD_PRESET_COUNT:
|
||||||
return cmd, bytes([0, 0, 0, 0, 0, 0 if self.unlocked else 1])
|
return cmd, bytes([0, 0, 0, 0, 0, 0 if self.unlocked else 1])
|
||||||
if cmd == P.CMD_UNLOCK:
|
if cmd == P.CMD_UNLOCK:
|
||||||
|
|||||||
+32
-10
@@ -137,6 +137,8 @@ const chTitle = (d, kind, i) => { const n = chans(d, kind)[i].name; return n ? `
|
|||||||
|
|
||||||
// Channel links (see protocol.py): a free channel's mask is its own bit, the first channel of a
|
// Channel links (see protocol.py): a free channel's mask is its own bit, the first channel of a
|
||||||
// group holds all members' bits, the others 0. The DSP mirrors changes within a group itself.
|
// group holds all members' bits, the others 0. The DSP mirrors changes within a group itself.
|
||||||
|
const MODEL_LABEL = { "204": "DSP 204", "408": "DSP 408", "206": "DSP 206", "408fir": "FIR DSP 408" };
|
||||||
|
const MODEL_CH = { "204": [2, 4], "408": [4, 8], "206": [2, 6], "408fir": [4, 8] }; // inputs, outputs (before a DSP has connected)
|
||||||
const LINK_COLORS = ["#f59e0b", "#22d3ee", "#a3e635", "#f472b6"];
|
const LINK_COLORS = ["#f59e0b", "#22d3ee", "#a3e635", "#f472b6"];
|
||||||
function linkGroups(list) {
|
function linkGroups(list) {
|
||||||
const seen = new Set(), groups = [];
|
const seen = new Set(), groups = [];
|
||||||
@@ -173,7 +175,7 @@ const CH_PALETTE = ["#ef4444", "#f97316", "#f59e0b", "#eab308", "#84cc16", "#22c
|
|||||||
// channel groups of one kind: linked channels together, the others on their own
|
// channel groups of one kind: linked channels together, the others on their own
|
||||||
function chanGroups(d, kind) {
|
function chanGroups(d, kind) {
|
||||||
if (d.state) return linkGroups(chans(d, kind));
|
if (d.state) return linkGroups(chans(d, kind));
|
||||||
const n = kind === "in" ? d.n_in || (d.model === "408" ? 4 : 2) : d.n_out || (d.model === "408" ? 8 : 4);
|
const n = (kind === "in" ? d.n_in : d.n_out) || (MODEL_CH[d.model] || MODEL_CH["204"])[kind === "in" ? 0 : 1];
|
||||||
return Array.from({ length: n }, (_, i) => [i]);
|
return Array.from({ length: n }, (_, i) => [i]);
|
||||||
}
|
}
|
||||||
// the colour chosen for a channel; linked channels show their group's colour
|
// the colour chosen for a channel; linked channels show their group's colour
|
||||||
@@ -592,7 +594,8 @@ function renderTabs() {
|
|||||||
const testLock = testOn(dev());
|
const testLock = testOn(dev());
|
||||||
const badge = d => {
|
const badge = d => {
|
||||||
const model = d.detected_model || (d.model !== "auto" ? d.model : "");
|
const model = d.detected_model || (d.model !== "auto" ? d.model : "");
|
||||||
return testOn(d) ? h("small", { class: "test-badge" }, "TEST") : d.demo ? h("small", { class: "demo-badge" }, "DEMO") : model ? h("small", {}, model) : null;
|
return testOn(d) ? h("small", { class: "test-badge" }, "TEST") : d.demo ? h("small", { class: "demo-badge" }, "DEMO")
|
||||||
|
: model ? h("small", {}, (MODEL_LABEL[model] || model).replace("DSP ", "") + (d.beta ? " β" : "")) : null;
|
||||||
};
|
};
|
||||||
const cur = S.devices[S.cur];
|
const cur = S.devices[S.cur];
|
||||||
if (!cur) {
|
if (!cur) {
|
||||||
@@ -796,8 +799,8 @@ async function presetFileDialog(d) {
|
|||||||
"active state – stored presets (U01 …) stay unchanged.", { name: q(d.state.preset_name || "—") })),
|
"active state – stored presets (U01 …) stay unchanged.", { name: q(d.state.preset_name || "—") })),
|
||||||
last ? h("p", { class: "dlg-text" }, t("A backup is made automatically before every import. Last backup: {last}.", { last })) : null),
|
last ? h("p", { class: "dlg-text" }, t("A backup is made automatically before every import. Last backup: {last}.", { last })) : null),
|
||||||
actions: [{ label: t("Close") },
|
actions: [{ label: t("Close") },
|
||||||
...(last && !S.locked ? [{ label: t("Undo import"), value: () => "undo" }] : []),
|
...(last && !viewOnly() ? [{ label: t("Undo import"), value: () => "undo" }] : []),
|
||||||
...(S.locked ? [] : [{ label: t("Import…"), value: () => "import" }]),
|
...(viewOnly() ? [] : [{ label: t("Import…"), value: () => "import" }]),
|
||||||
{ label: t("Export"), primary: true, value: () => "export" }],
|
{ label: t("Export"), primary: true, value: () => "export" }],
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
@@ -1945,7 +1948,8 @@ function deviceForm(d) {
|
|||||||
name: h("input", { type: "text", value: d.name, placeholder: t("e.g. DSP 204 stage") }),
|
name: h("input", { type: "text", value: d.name, placeholder: t("e.g. DSP 204 stage") }),
|
||||||
host: h("input", { type: "text", value: d.host, placeholder: "192.168.1.101", inputmode: "decimal" }),
|
host: h("input", { type: "text", value: d.host, placeholder: "192.168.1.101", inputmode: "decimal" }),
|
||||||
port: h("input", { type: "number", value: d.port }),
|
port: h("input", { type: "number", value: d.port }),
|
||||||
model: h("select", {}, [["auto", t("Automatic")], ["204", "DSP 204"], ["408", "DSP 408"]]
|
model: h("select", {}, [["auto", t("Automatic")], ["204", "DSP 204"], ["408", "DSP 408"],
|
||||||
|
["206", "DSP 206 (Beta)"], ["408fir", "FIR DSP 408 (Beta)"]]
|
||||||
.map(([v, label]) => h("option", { value: v, selected: d.model === v }, label))),
|
.map(([v, label]) => h("option", { value: v, selected: d.model === v }, label))),
|
||||||
autoconnect: h("input", { type: "checkbox", checked: d.autoconnect }),
|
autoconnect: h("input", { type: "checkbox", checked: d.autoconnect }),
|
||||||
addr: h("input", { type: "number", min: 1, max: 250, value: d.addr || 1, class: "short" }),
|
addr: h("input", { type: "number", min: 1, max: 250, value: d.addr || 1, class: "short" }),
|
||||||
@@ -2181,7 +2185,7 @@ async function scanDialog() {
|
|||||||
const list = await api("POST", "/api/scan");
|
const list = await api("POST", "/api/scan");
|
||||||
const used = new Set(S.order.map(id => S.devices[id].host));
|
const used = new Set(S.order.map(id => S.devices[id].host));
|
||||||
box.replaceChildren(...(list.length ? list.map(x => {
|
box.replaceChildren(...(list.length ? list.map(x => {
|
||||||
const title = x.model ? `DSP ${x.model}` : t("Unknown device");
|
const title = MODEL_LABEL[x.model] || t("Unknown device");
|
||||||
const add = async b => {
|
const add = async b => {
|
||||||
b.disabled = true;
|
b.disabled = true;
|
||||||
try {
|
try {
|
||||||
@@ -2232,6 +2236,21 @@ function viewSettings() {
|
|||||||
// ------------------------------------------------------------------ render
|
// ------------------------------------------------------------------ render
|
||||||
|
|
||||||
const H_SCROLL = ".mixer, .bands, .geq, .routing";
|
const H_SCROLL = ".mixer, .bands, .geq, .routing";
|
||||||
|
// beta models (never seen on a real device): read-only until the shown values were compared with the DSP
|
||||||
|
function betaBanner(d) {
|
||||||
|
const model = MODEL_LABEL[d.detected_model] || d.detected_model;
|
||||||
|
const set = async enabled => {
|
||||||
|
if (enabled && !await askConfirm(t("Allow changes"), t("Only continue if the values shown here match the DSP (names, gains, filters, routing). If they don't, a change can send wrong values – keep the amplifiers off while testing."), t("Allow changes"), true)) return;
|
||||||
|
try { await api("POST", `/api/devices/${d.id}/betawrite`, { enabled }); }
|
||||||
|
catch (e) { toast(t("Error: ") + trMsg(e.message)); }
|
||||||
|
};
|
||||||
|
return h("div", { class: "betabar" + (d.read_only ? " ro" : "") },
|
||||||
|
h("div", { class: "grow" }, h("b", {}, t("{model} – Beta", { model })), " ",
|
||||||
|
d.read_only ? t("Not tested on a real device yet, so changes are off. Compare the shown values with the DSP. If they don't match, send the file from File… → Export to the developer.")
|
||||||
|
: t("Not tested on a real device yet. Changes are on – keep the amplifiers off while testing.")),
|
||||||
|
h("button", { class: "small" + (d.read_only ? " on" : ""), "data-view-ok": "", onclick: () => set(d.read_only) }, d.read_only ? t("Allow changes") : t("Turn changes off")));
|
||||||
|
}
|
||||||
|
|
||||||
function render() {
|
function render() {
|
||||||
if (S.busy) { S.dirty = true; return; }
|
if (S.busy) { S.dirty = true; return; }
|
||||||
if ($("#app").hidden) return;
|
if ($("#app").hidden) return;
|
||||||
@@ -2252,6 +2271,7 @@ function render() {
|
|||||||
const d = dev();
|
const d = dev();
|
||||||
const field = !S.settings && S.view === "soundfield"; // the room plan works without a connected DSP
|
const field = !S.settings && S.view === "soundfield"; // the room plan works without a connected DSP
|
||||||
document.body.dataset.view = field ? "soundfield" : S.settings || !d ? "settings" : S.view;
|
document.body.dataset.view = field ? "soundfield" : S.settings || !d ? "settings" : S.view;
|
||||||
|
document.body.classList.toggle("locked", viewOnly());
|
||||||
if (field) content = viewSoundField();
|
if (field) content = viewSoundField();
|
||||||
else if (S.settings || !d) content = viewSettings();
|
else if (S.settings || !d) content = viewSettings();
|
||||||
else if (d.status !== "online" || !d.state)
|
else if (d.status !== "online" || !d.state)
|
||||||
@@ -2262,7 +2282,7 @@ function render() {
|
|||||||
h("button", { class: "on", onclick: () => unlockDialog(d) }, t("Enter code")))
|
h("button", { class: "on", onclick: () => unlockDialog(d) }, t("Enter code")))
|
||||||
: S.demo.enabled && !d.demo ? t("Disconnected while demo mode is on") : t("Not connected."));
|
: S.demo.enabled && !d.demo ? t("Disconnected while demo mode is on") : t("Not connected."));
|
||||||
else content = ({ mixer: viewMixer, channel: viewChannel, routing: viewRouting, link: viewLink, limiter: viewLimiter, test: viewTest }[S.view] || viewMixer)(d);
|
else content = ({ mixer: viewMixer, channel: viewChannel, routing: viewRouting, link: viewLink, limiter: viewLimiter, test: viewTest }[S.view] || viewMixer)(d);
|
||||||
main.replaceChildren(...[content].flat().filter(Boolean));
|
main.replaceChildren(...[!field && !S.settings && d && d.beta ? betaBanner(d) : null, content].flat().filter(Boolean));
|
||||||
main.querySelectorAll(H_SCROLL).forEach((e, i) => { if (xs[i]) e.scrollLeft = xs[i]; });
|
main.querySelectorAll(H_SCROLL).forEach((e, i) => { if (xs[i]) e.scrollLeft = xs[i]; });
|
||||||
window.scrollTo(0, y);
|
window.scrollTo(0, y);
|
||||||
collectMeters();
|
collectMeters();
|
||||||
@@ -2302,10 +2322,12 @@ new ResizeObserver(() => document.documentElement.style.setProperty("--sb", $("#
|
|||||||
|
|
||||||
// ------------------------------------------------------------------ lock (desktop app window: look, don't touch)
|
// ------------------------------------------------------------------ lock (desktop app window: look, don't touch)
|
||||||
|
|
||||||
|
const viewOnly = () => !!S.locked || (!S.settings && S.view !== "soundfield" && !!(dev() && dev().read_only));
|
||||||
|
|
||||||
function showLock() {
|
function showLock() {
|
||||||
const b = $("#btn-lock");
|
const b = $("#btn-lock");
|
||||||
b.hidden = !S.isApp;
|
b.hidden = !S.isApp;
|
||||||
document.body.classList.toggle("locked", !!S.locked);
|
document.body.classList.toggle("locked", viewOnly());
|
||||||
b.classList.toggle("on", !!S.locked);
|
b.classList.toggle("on", !!S.locked);
|
||||||
b.title = S.locked ? t("Locked – click to unlock") : t("Lock (view only)");
|
b.title = S.locked ? t("Locked – click to unlock") : t("Lock (view only)");
|
||||||
b.setAttribute("aria-label", b.title);
|
b.setAttribute("aria-label", b.title);
|
||||||
@@ -2337,14 +2359,14 @@ $("#btn-lock").addEventListener("click", async () => {
|
|||||||
const VIEW_OK = ".chsel, .nav, .strip-head, .xout, .band, #btn-muteall, [data-view-ok]";
|
const VIEW_OK = ".chsel, .nav, .strip-head, .xout, .band, #btn-muteall, [data-view-ok]";
|
||||||
for (const type of ["pointerdown", "mousedown", "click", "dblclick", "keydown", "wheel"]) {
|
for (const type of ["pointerdown", "mousedown", "click", "dblclick", "keydown", "wheel"]) {
|
||||||
document.addEventListener(type, e => {
|
document.addEventListener(type, e => {
|
||||||
if (!S.locked || !(e.target instanceof Element)) return;
|
if (!viewOnly() || !(e.target instanceof Element)) return;
|
||||||
const tgt = e.target;
|
const tgt = e.target;
|
||||||
if (!tgt.closest("#main, #statusbar") || tgt.closest(VIEW_OK)) return;
|
if (!tgt.closest("#main, #statusbar") || tgt.closest(VIEW_OK)) return;
|
||||||
if (type === "wheel" && !tgt.closest(".fader, input, select")) return; // page scrolling stays
|
if (type === "wheel" && !tgt.closest(".fader, input, select")) return; // page scrolling stays
|
||||||
if (type === "keydown" && !tgt.closest("button, input, select, textarea, .fader, [tabindex]")) return;
|
if (type === "keydown" && !tgt.closest("button, input, select, textarea, .fader, [tabindex]")) return;
|
||||||
if (type === "pointerdown" && !tgt.closest("button, input, select, textarea, .fader, canvas, a")) return;
|
if (type === "pointerdown" && !tgt.closest("button, input, select, textarea, .fader, canvas, a")) return;
|
||||||
e.preventDefault(); e.stopPropagation();
|
e.preventDefault(); e.stopPropagation();
|
||||||
if (type === "click" && Date.now() - (S.lockToast || 0) > 1500) { S.lockToast = Date.now(); toast(t("Locked – unlock at the top right to make changes")); }
|
if (type === "click" && Date.now() - (S.lockToast || 0) > 1500) { S.lockToast = Date.now(); toast(S.locked ? t("Locked – unlock at the top right to make changes") : t("Beta model: changes are off")); }
|
||||||
}, { capture: true, passive: false });
|
}, { capture: true, passive: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -516,6 +516,13 @@ const DE = {
|
|||||||
"Dissolve group": "Gruppe auflösen",
|
"Dissolve group": "Gruppe auflösen",
|
||||||
"{names} joins the group and takes over its settings (name{routing} stays).": "{names} kommt in die Gruppe und übernimmt ihre Einstellungen – außer Name{routing}.",
|
"{names} joins the group and takes over its settings (name{routing} stays).": "{names} kommt in die Gruppe und übernimmt ihre Einstellungen – außer Name{routing}.",
|
||||||
"{names} leaves the group and keeps its current settings.": "{names} verlässt die Gruppe und behält seine aktuellen Einstellungen.",
|
"{names} leaves the group and keeps its current settings.": "{names} verlässt die Gruppe und behält seine aktuellen Einstellungen.",
|
||||||
|
"Allow changes": "Änderungen erlauben",
|
||||||
|
"Turn changes off": "Änderungen ausschalten",
|
||||||
|
"Only continue if the values shown here match the DSP (names, gains, filters, routing). If they don't, a change can send wrong values – keep the amplifiers off while testing.": "Nur weitermachen, wenn die angezeigten Werte zum DSP passen (Namen, Gains, Filter, Routing). Sonst kann eine Änderung falsche Werte senden – beim Testen die Endstufen ausgeschaltet lassen.",
|
||||||
|
"{model} – Beta": "{model} – Beta",
|
||||||
|
"Not tested on a real device yet, so changes are off. Compare the shown values with the DSP. If they don't match, send the file from File… → Export to the developer.": "Noch nicht an einem echten Gerät getestet, darum sind Änderungen aus. Vergleiche die angezeigten Werte mit dem DSP. Passen sie nicht, schick die Datei aus Datei… → Export an den Entwickler.",
|
||||||
|
"Not tested on a real device yet. Changes are on – keep the amplifiers off while testing.": "Noch nicht an einem echten Gerät getestet. Änderungen sind an – beim Testen die Endstufen ausgeschaltet lassen.",
|
||||||
|
"Beta model: changes are off": "Beta-Modell: Änderungen sind aus",
|
||||||
};
|
};
|
||||||
|
|
||||||
const DE_PATTERNS = [
|
const DE_PATTERNS = [
|
||||||
|
|||||||
@@ -504,7 +504,7 @@ const sfNum = (value, step, onset, attrs = {}) => {
|
|||||||
|
|
||||||
function sfOutputs() { // every DSP output known from the device list (also offline ones)
|
function sfOutputs() { // every DSP output known from the device list (also offline ones)
|
||||||
return S.order.map(id => S.devices[id]).filter(d => !d.demo || S.demo.enabled).map(d => {
|
return S.order.map(id => S.devices[id]).filter(d => !d.demo || S.demo.enabled).map(d => {
|
||||||
const n = d.n_out || (d.model === "204" ? 4 : d.model === "408" ? 8 : 0);
|
const n = d.n_out || (MODEL_CH[d.model] || [0, 0])[1];
|
||||||
return { d, outs: Array.from({ length: n }, (_, o) => o) };
|
return { d, outs: Array.from({ length: n }, (_, o) => o) };
|
||||||
}).filter(x => x.outs.length);
|
}).filter(x => x.outs.length);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -744,3 +744,10 @@ input[type=range].haslim::-moz-range-track {
|
|||||||
.lkgroup.editing { background: color-mix(in srgb, var(--lc) 14%, var(--panel2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lc) 45%, transparent); }
|
.lkgroup.editing { background: color-mix(in srgb, var(--lc) 14%, var(--panel2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lc) 45%, transparent); }
|
||||||
.lkgroup.dim { opacity: .5; }
|
.lkgroup.dim { opacity: .5; }
|
||||||
.lkactions button + button { margin-left: 6px; }
|
.lkactions button + button { margin-left: 6px; }
|
||||||
|
/* ---- beta models */
|
||||||
|
.betabar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 9px 12px; border-radius: 9px; font-size: 13px;
|
||||||
|
background: #f59e0b14; border: 1px solid #f59e0b55; }
|
||||||
|
.betabar b { color: var(--warn); }
|
||||||
|
.betabar.ro { background: #f59e0b24; border-color: #f59e0b99; }
|
||||||
|
.betabar button { flex: none; }
|
||||||
|
@media (max-width: 560px) { .betabar { flex-direction: column; align-items: stretch; } }
|
||||||
@@ -165,6 +165,19 @@ def test_master_bypass():
|
|||||||
assert P.MODELS["408"].test_base + 6 == 0x5A2
|
assert P.MODELS["408"].test_base + 6 == 0x5A2
|
||||||
|
|
||||||
|
|
||||||
|
def test_beta_models():
|
||||||
|
assert P.detect_model("DSP408 V010") == "408" and P.detect_model("DSP 204") == "204"
|
||||||
|
for info in ("DSP206 V1", "FIR DSP408 V1", "FIRDSP408", "DSP408FIR"): # only selectable by hand
|
||||||
|
assert P.detect_model(info) is None, info
|
||||||
|
for key in ("206", "408fir"):
|
||||||
|
m = P.MODELS[key]
|
||||||
|
assert m.beta and not {P.CMD_GAIN, P.CMD_MUTE, P.CMD_LINK, P.CMD_PRESET_RECALL} & P.READ_COMMANDS
|
||||||
|
st = P.default_state(m)
|
||||||
|
st["outputs"][m.n_out - 1]["gain"] = 123
|
||||||
|
back = P.parse_state(m, bytes(P.build_state_buffer(m, st)))
|
||||||
|
assert back["outputs"][m.n_out - 1]["gain"] == 123 and len(back["inputs"]) == m.n_in
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
for name, fn in list(globals().items()):
|
for name, fn in list(globals().items()):
|
||||||
if name.startswith("test_"):
|
if name.startswith("test_"):
|
||||||
|
|||||||
Reference in new issue
Block a user