fix(e2ee): remove diagnostic logging, video E2EE confirmed working (MAT-144)
Root cause: aggressive video re-keying (set_key at 0.3/0.8/2/5s intervals) briefly cleared encryption_key between SetKey and HKDF callback, causing DEC_FAILED oscillation. Single set_key per track subscription is sufficient. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
14
voice.py
14
voice.py
@@ -671,10 +671,9 @@ class VoiceSession:
|
|||||||
|
|
||||||
@self.lk_room.on("track_subscribed")
|
@self.lk_room.on("track_subscribed")
|
||||||
def on_ts(t, pub, p):
|
def on_ts(t, pub, p):
|
||||||
# MAT-144: Log encryption_type to diagnose frame cryptor creation
|
|
||||||
enc_type = getattr(pub, 'encryption_type', 'N/A')
|
enc_type = getattr(pub, 'encryption_type', 'N/A')
|
||||||
logger.info("Track sub: %s %s kind=%s muted=%s enc_type=%s source=%s",
|
logger.info("Track sub: %s %s kind=%s enc_type=%s source=%s",
|
||||||
p.identity, pub.sid, t.kind, pub.muted, enc_type,
|
p.identity, pub.sid, t.kind, enc_type,
|
||||||
getattr(pub, 'source', 'N/A'))
|
getattr(pub, 'source', 'N/A'))
|
||||||
# Store video track for on-demand vision (look_at_screen tool)
|
# Store video track for on-demand vision (look_at_screen tool)
|
||||||
if int(t.kind) == 2: # video track (LiveKit: 1=audio, 2=video)
|
if int(t.kind) == 2: # video track (LiveKit: 1=audio, 2=video)
|
||||||
@@ -684,17 +683,8 @@ class VoiceSession:
|
|||||||
if int(t.kind) in (1, 2) and e2ee_opts is not None: # audio + video tracks
|
if int(t.kind) in (1, 2) and e2ee_opts is not None: # audio + video tracks
|
||||||
caller_id = p.identity
|
caller_id = p.identity
|
||||||
track_type = "video" if int(t.kind) == 2 else "audio"
|
track_type = "video" if int(t.kind) == 2 else "audio"
|
||||||
logger.info("E2EE_DIAG: track_subscribed %s for %s, have %d caller keys",
|
|
||||||
track_type, caller_id, len(self._caller_all_keys))
|
|
||||||
try:
|
try:
|
||||||
kp_local = self.lk_room.e2ee_manager.key_provider
|
kp_local = self.lk_room.e2ee_manager.key_provider
|
||||||
# MAT-144: Log frame cryptors count for diagnostics
|
|
||||||
try:
|
|
||||||
fc_map = self.lk_room.e2ee_manager.frame_cryptors()
|
|
||||||
logger.info("E2EE_DIAG: frame_cryptors count=%d keys=%s",
|
|
||||||
len(fc_map), list(fc_map.keys()) if fc_map else [])
|
|
||||||
except Exception:
|
|
||||||
logger.info("E2EE_DIAG: frame_cryptors() not available")
|
|
||||||
if self._caller_all_keys:
|
if self._caller_all_keys:
|
||||||
for idx, base_k in sorted(self._caller_all_keys.items()):
|
for idx, base_k in sorted(self._caller_all_keys.items()):
|
||||||
_derive_and_set_key(kp_local, caller_id, base_k, idx)
|
_derive_and_set_key(kp_local, caller_id, base_k, idx)
|
||||||
|
|||||||
Reference in New Issue
Block a user