feat: point the fleet at wss LiveKit room uwh-telhai
Publish and subscribe over wss://livekit.uni-wh.de:7800 and refuse cleartext ws://. Conference room is uwh-telhai. Includes the uncommitted encoded H.264 publish path, Rally hairpin, and KMS wall overlay.
This commit is contained in:
+56
-22
@@ -189,33 +189,67 @@ def list_outputs() -> list[DrmOutput]:
|
||||
return outputs
|
||||
|
||||
|
||||
def _rank_wall(o: DrmOutput) -> tuple:
|
||||
"""Arc HDMI first, then any connected HDMI. Names shuffle across boots."""
|
||||
return (
|
||||
0 if o.connected else 1,
|
||||
0 if o.driver == "xe" else 1,
|
||||
0 if o.name.startswith("HDMI-A") else 1,
|
||||
o.name,
|
||||
)
|
||||
|
||||
|
||||
def pick_outputs(
|
||||
all_outs: list[DrmOutput],
|
||||
n: int = 3,
|
||||
names: Optional[list[str]] = None,
|
||||
connected_only: bool = False,
|
||||
) -> list[DrmOutput]:
|
||||
"""Choose DRM heads. Stale DISPLAY_CONNECTORS names must not bind a dead port
|
||||
when a connected Arc HDMI is available — the wall has to stay lit."""
|
||||
if names:
|
||||
by_name: dict[str, list[DrmOutput]] = {}
|
||||
for o in all_outs:
|
||||
by_name.setdefault(o.name, []).append(o)
|
||||
missing = [name for name in names if name not in by_name]
|
||||
if missing:
|
||||
have = sorted({o.name for o in all_outs})
|
||||
raise KeyError(f"DRM connector {missing[0]!r} not found. Have: {have}")
|
||||
picked: list[DrmOutput | None] = []
|
||||
used: set[str] = set()
|
||||
for name in names:
|
||||
cands = sorted(by_name[name], key=_rank_wall)
|
||||
chosen = next((o for o in cands if o.connected and o.sysfs not in used), None)
|
||||
if chosen is None:
|
||||
picked.append(None)
|
||||
else:
|
||||
used.add(chosen.sysfs)
|
||||
picked.append(chosen)
|
||||
fallback = sorted(
|
||||
(o for o in all_outs if o.connected and o.sysfs not in used),
|
||||
key=_rank_wall,
|
||||
)
|
||||
fi = 0
|
||||
for i, o in enumerate(picked):
|
||||
if o is None and fi < len(fallback):
|
||||
picked[i] = fallback[fi]
|
||||
used.add(fallback[fi].sysfs)
|
||||
fi += 1
|
||||
return [o for o in picked if o is not None]
|
||||
connected = [o for o in all_outs if o.connected]
|
||||
rest = [o for o in all_outs if not o.connected]
|
||||
connected.sort(key=_rank_wall)
|
||||
rest.sort(key=_rank_wall)
|
||||
ordered = connected + ([] if connected_only else rest)
|
||||
return ordered[:n]
|
||||
|
||||
|
||||
def select_outputs(
|
||||
n: int = 3,
|
||||
names: Optional[list[str]] = None,
|
||||
connected_only: bool = False,
|
||||
) -> list[DrmOutput]:
|
||||
all_outs = list_outputs()
|
||||
if names:
|
||||
by_name = {o.name: o for o in all_outs}
|
||||
picked = []
|
||||
for name in names:
|
||||
if name not in by_name:
|
||||
raise KeyError(f"DRM connector {name!r} not found. Have: {sorted(by_name)}")
|
||||
picked.append(by_name[name])
|
||||
return picked
|
||||
connected = [o for o in all_outs if o.connected]
|
||||
rest = [o for o in all_outs if not o.connected]
|
||||
# Prefer the discrete GPU (xe / Arc) HDMI heads for a 3-display wall.
|
||||
def rank(o: DrmOutput) -> tuple:
|
||||
return (
|
||||
0 if o.driver == "xe" else 1,
|
||||
0 if o.name.startswith("HDMI-A") else 1,
|
||||
o.name,
|
||||
)
|
||||
connected.sort(key=rank)
|
||||
rest.sort(key=rank)
|
||||
ordered = connected + ([] if connected_only else rest)
|
||||
return ordered[:n]
|
||||
return pick_outputs(list_outputs(), n=n, names=names, connected_only=connected_only)
|
||||
|
||||
|
||||
def format_outputs(outs: list[DrmOutput]) -> str:
|
||||
|
||||
Reference in New Issue
Block a user