diff --git a/FEATURE_COMPATIBILITY.md b/FEATURE_COMPATIBILITY.md index e1c7435..a1a3b79 100644 --- a/FEATURE_COMPATIBILITY.md +++ b/FEATURE_COMPATIBILITY.md @@ -2,6 +2,8 @@ ## Current Windows account-free checkpoint (2026-11-26) +**Capture release during a 600 ms stall:** A core regression revoked the capture epoch with one frame queued, one dequeued, and one held by VAD. The transport guard rejected the dequeued frame immediately. After a 600 ms consumer stall, the queue contained only an end marker; the old dequeued and preroll frames could neither enter encoding nor pass the send guard. A fresh frame with the new epoch started a new VAD burst and passed the guard. No network or devices were used in this stall test; live PTT and whisper release were checked separately on beta14. + **PTT key on Windows:** The Audio recorder rejected Ctrl+F9 and a failed atomic save without replacing F8. Cancel restored the old binding. Saving F10 retained the new key across two restarts. On private beta14 with continuous synthetic input, the old F8 did not transmit; F10 started and ended speech at the receiver and respected the selected tail. This checks native local key events, not OS-wide registration. **Overlapping PTT and Push to Mute (Windows beta14):** With F8 held and both peers reporting speech, F9 stopped transmission and cleared the receiver's talking indicator without changing the visible mute flags. Releasing F9 with F8 held restored speech; releasing F8 before F9 left both peers silent. A later F8 hold still transmitted. These were local native key events with a synthetic capture backend, not OS-wide shortcut registration. diff --git a/core/src/vad.rs b/core/src/vad.rs index ddb95bf..83da21e 100644 --- a/core/src/vad.rs +++ b/core/src/vad.rs @@ -478,6 +478,46 @@ pub mod tests { assert!(held.iter().all(Option::is_none)); } + #[test] + fn released_capture_cannot_restart_after_a_stalled_consumer() { + use crate::audio::{AudioIn, AudioInQueue}; + use tsclientlib::{AudioSendGuard, AudioSendMetadata}; + + let queue = AudioInQueue::new(); + let mut vad = VoiceGate::new(GateMode::VolumeGate { level_db: -30.0 }); + assert_eq!(vad.push_captured(&captured_frame(&queue, 1)), Decision::Hold); + assert!(queue.try_push(captured_frame(&queue, 2))); + let Some(AudioIn::Frame(dequeued)) = queue.pop() else { panic!("missing dequeued frame") }; + assert!(queue.try_push(captured_frame(&queue, 3))); + let metadata = |f: &CapturedFrame| AudioSendMetadata { + captured_at: f.captured_at, capture_epoch: f.capture_epoch, connection_generation: f.connection_generation, + }; + // The last frame may already be encoded and awaiting socket readiness at key-up. + let pending_send = metadata(&dequeued); + let epoch = queue.invalidate(); + queue.with_valid_audio(&pending_send, &mut || panic!("revoked packet sent before stall")); + std::thread::sleep(std::time::Duration::from_millis(600)); + + let mut preroll = std::array::from_fn(|_| None); + assert_eq!(vad.take_captured_preroll(&mut preroll), 1); + for frame in [dequeued, preroll[0].take().unwrap()] { + assert!(queue.with_valid_frame(&frame, || panic!("stale PCM encoded")).is_none()); + queue.with_valid_audio(&metadata(&frame), &mut || panic!("stale PCM sent")); + } + assert!(matches!(queue.pop(), Some(AudioIn::End))); + assert!(queue.pop().is_none(), "release must discard the queued frame"); + vad.reset(); + let fresh = captured_frame(&queue, 20_000); + assert_eq!(fresh.capture_epoch, epoch); + assert!(queue.try_push(fresh)); + let Some(AudioIn::Frame(fresh)) = queue.pop() else { panic!("missing fresh frame") }; + assert_eq!(vad.push_captured(&fresh), Decision::Start); + assert_eq!(vad.take_captured_preroll(&mut preroll), 0); + let mut sent = false; + queue.with_valid_audio(&metadata(&fresh), &mut || sent = true); + assert!(sent, "fresh burst blocked after release"); + } + #[test] fn captured_preroll_is_revoked_by_every_routing_boundary() { let queue = crate::audio::AudioInQueue::new(); diff --git a/docs/mobile-port-progress.md b/docs/mobile-port-progress.md index 3ef615b..c4b716f 100644 --- a/docs/mobile-port-progress.md +++ b/docs/mobile-port-progress.md @@ -4,6 +4,8 @@ ## Возврат к разработке на ПК, 2026-11-26 +Windows, база `4aaab8f`: закрыт preload:endAudio для нативного пути. После отзыва разрешения и паузы потребителя на 600 мс очередь сохранила только маркер конца; извлечённый кадр и кадр из VAD не прошли к отправке. Свежий кадр с новой меткой начал новую передачу. Прошли четыре теста ядра. Пауза проверена без сети; живые остановки PTT и шёпота проверялись отдельно. + Windows, база `0f5551a`: приватный beta14 отклонил создание каналов с кодеками 0, 1, 2 и 3 (WebQuery 1538). Контрольный канал с кодеком 4 создан, значение подтверждено channelinfo. Проверка живого входа в Speex/CELT и отсутствия исходящих пакетов остаётся открытой; стенд остановлен. Windows, база `9cbf0bd`: закрыт pttEnabled. После отпускания клавиши выключение PTT восстановило передачу уже разрешённого синтетического ввода, а включение остановило её у обоих клиентов beta14. Прошли два адресных теста, включая перезапуск Slint и отказ при сохранении. Физические устройства не открывались.