Sync NAM engine block_size with JACK period on profile switch

- Add FastNAMHost.set_block_size() — reloads current model with
  new block_size, keeping the engine in sync with JACK's period
- Wire into POST /api/audio/profile so NAM engine restarts with
  correct frame count when switching between standard/low/stable
- Prevents sample-alignment drift when JACK period changes but
  NAM engine stays at old block_size (was causing passthrough)
This commit is contained in:
2026-06-13 22:26:27 -04:00
parent fa787debd1
commit 2a74c8e114
2 changed files with 17 additions and 0 deletions
+4
View File
@@ -1361,6 +1361,10 @@ class WebServer:
# Restart JACK audio client
if jack_client:
jack_client.start()
# Sync NAM engine block size with new period
nam_host = self.deps.nam_host
if nam_host and hasattr(nam_host, 'set_block_size'):
nam_host.set_block_size(profile["period"])
await self._manager.broadcast({
"type": "audio_profile_changed",
"profile": profile_key,