Overview
Unmute includes several debugging tools to help diagnose issues with audio quality, latency, service connectivity, and system behavior. This guide covers both development and production debugging techniques.Development Mode
Enabling Dev Mode
Unmute includes a hidden debug view for development. Enable it by modifyingfrontend/src/app/useKeyboardShortcuts.ts:
Debug Information Available
The debug view displays real-time information fromself.debug_dict in unmute_handler.py. You can add custom debug data:
Subtitles Mode
Press S to enable subtitles showing:- User speech transcription (from STT)
- Bot responses (text and audio)
Logging
Backend Logging
Unmute uses Python’s standard logging with structured output:Log Configuration
Fromloadtest_client.py example:
level=logging.DEBUG for verbose output.
Service-Specific Logs
TTS and STT services write logs to dedicated volumes:Recording Sessions
Enabling Recordings
Set theKYUTAI_RECORDINGS_DIR environment variable:
- User audio input
- Bot audio output
- Session metadata
Recording Format
Recordings use theRecorder class (from unmute_handler.py):
Load Testing
Running Load Tests
Theloadtest_client.py script simulates realistic user conversations:
--n-workers: Parallel connections (simulates concurrent users)--n-conversations: Total conversations to run--audio-dir: Directory with test audio files (MP3 format)--listen: Play received audio for manual verification
Interpreting Results
Load test output includes detailed timing:- Mean/Median: Average performance
- p90/p95: Tail latencies (worst-case scenarios)
- Realtime factor: Less than 1.0 means TTS generates faster than playback (good)
- OK fraction: Success rate (should be >0.95)
Debugging with Load Tests
Health Checks
Backend Health Endpoint
Service Discovery
Unmute uses service discovery to find available STT/TTS instances (fromservice_discovery.py):
Common Issues
Issue: STT Not Transcribing
Symptoms: No subtitles appear, silence timeout triggers Debug steps:- Check STT service logs:
docker logs <stt_container> - Verify microphone permissions in browser
- Enable subtitles (press S) to see if any text appears
- Check STT metrics:
worker_stt_recv_words_total(should increase) - Test with known audio file using load test
- Microphone not connected/permitted
- Echo cancellation consuming speech
- STT service out of memory
Issue: High Latency
Symptoms: Delayed responses, choppy audio Debug steps:- Check Grafana dashboards for latency spikes
- Monitor GPU utilization:
nvidia-smi -l 1 - Check service metrics:
- Run load test to isolate bottleneck
- Review
self.debug_dictin dev mode
- GPU shared between services (use multi-GPU setup)
- High context length (
--max-model-lentoo large) - Network latency between services
- Insufficient GPU memory causing swapping
Issue: TTS Audio Choppy
Symptoms: Audio stutters or drops frames Debug steps:- Check output frame size in
unmute_handler.py: - Monitor TTS realtime factor:
Should be less than 1.0 (faster than realtime)
- Check TTS service logs for errors
- Verify GPU not overloaded
- Output frame size too large
- TTS generation slower than realtime
- Network congestion
- CPU throttling
Issue: Service Connection Failures
Symptoms:worker_stt_misses or worker_tts_misses increasing
Debug steps:
- Check service health:
- Test connectivity from backend:
- Check service discovery:
- Review service logs for crashes
- Service crashed and restarting
- GPU out of memory
- Network misconfiguration
- Too many concurrent requests
Issue: LLM Timeouts
Symptoms:worker_vllm_hard_errors increasing, responses cut off
Debug steps:
- Check LLM service logs:
- Monitor GPU memory:
- Check request context length:
- Review LLM configuration in
docker-compose.yml
- Context window too large for GPU memory
--gpu-memory-utilizationtoo high- Long conversation history exceeding
--max-model-len - Model loading failure
Debugging Tools
1. Audio Debugging
Fromloadtest_client.py:
2. Timing Analysis
Unmute usesPhasesStopwatch for detailed timing:
3. WebSocket Message Inspection
Log all WebSocket messages:4. Metrics Endpoint
Query Prometheus metrics directly:Debug Environment Variables
Fromunmute_handler.py:
Debugging Production
Docker Swarm Debugging
Scaling for Debugging
Force Service Restart
Additional Resources
- Monitoring - Set up metrics collection
- Performance Tuning - Optimize based on debug findings
- Multi-GPU Setup - Debug GPU allocation issues
Getting Help
If you encounter issues:- Check existing GitHub issues
- Review logs and metrics before reporting
- Include reproducible steps and error messages
- Share relevant configuration (docker-compose.yml, etc.)