Skip to main content

Overview

This guide covers common issues, their causes, and solutions based on actual implementation details from the CloudGaming source code.

Connection Issues

Symptoms:
  • WebSocket connection fails
  • Browser console shows connection refused
  • No WebSocket upgrade occurring
Common Causes:
  1. Wrong URL or port
  2. CORS blocking connection
    Verify CORS headers are present in response.
  3. WSS required in production
    Use wss:// URL in production, not ws://.
  4. Invalid roomId
    Room IDs must be alphanumeric with _, -, :, . only.
Solutions:
Logs to Check:
Symptoms:
  • ICE connection state stuck in checking
  • No ICE candidates generated
  • Connection timeout after 30 seconds
Common Causes:
  1. TURN server not configured
  2. Firewall blocking UDP
  3. STUN timeout
    Try alternative STUN servers if Google STUN is blocked.
  4. Symmetric NAT
    • Requires TURN relay
    • Host/srflx candidates won’t work
Solutions:
Debug ICE candidates:
Expected types:
  • host - Direct connection (best)
  • srflx - Server reflexive via STUN (good)
  • relay - Via TURN relay (fallback)
Verify ICE gathering:
Symptoms:
  • Signaling server shows Redis errors
  • Circuit breaker opens
  • 503 Service Unavailable responses
Common Causes:
  1. Redis server not running
  2. Connection string incorrect
  3. Circuit breaker triggered
    Circuit opens after threshold failures.
Solutions:
Restart with fresh connection:
Check circuit breaker status:

Audio Issues

Symptoms:
  • Video works but no audio
  • Audio track present but silent
  • No audio RTP packets received
Common Causes:
  1. Audio track not added to peer connection
  2. Opus codec not negotiated
  3. Audio capture not enabled
  4. WASAPI initialization failure
    • Audio device not found
    • Exclusive mode failed
    • Format not supported
Solutions:
Verify audio track:
Check audio RTP state:
Debug WASAPI:
Symptoms:
  • Audio lags behind video
  • Echo or delay in audio
  • Latency > 100ms
Common Causes:
  1. Large frame size
  2. Buffering enabled
  3. Audio queue congestion
Solutions:
Monitor queue health:
Check bitrate adaptation:
Symptoms:
  • Popping or clicking sounds
  • Robotic audio
  • Intermittent audio gaps
Common Causes:
  1. Buffer underruns
    • Frame size too small
    • CPU overload
    • Packet loss
  2. FEC disabled with high loss
  3. Opus complexity too high
Solutions:
Check packet loss:
Increase frame size if crackling:

Video Issues

Symptoms:
  • Black screen
  • Video element not playing
  • No video track received
Common Causes:
  1. Codec mismatch
  2. Track not attached to video element
  3. NVENC initialization failed
    • NVIDIA GPU not found
    • Driver too old
    • NVENC not supported on GPU
  4. Capture source not available
    • Game process not running
    • Window not found
    • Desktop capture failed
Solutions:
Check video packets:
Verify NVENC:
Debug capture:
Symptoms:
  • Glass-to-glass latency > 100ms
  • Noticeable input lag
  • Video feels sluggish
Common Causes:
  1. Encoder preset too slow
  2. B-frames enabled
  3. Queue depth too high
  4. Network congestion
Solutions:
Monitor encoder latency:
Check pacer queue:
Symptoms:
  • Blocky video
  • Compression artifacts
  • Blurry motion
  • Pixelation
Common Causes:
  1. Bitrate too low
  2. Preset too fast
  3. Packet loss
  4. PLI (Picture Loss Indication) threshold too low
Solutions:
Enable FEC for video (if supported):
Check bitrate adaptation:

Host Registration Issues

Symptoms:
  • Host shows as offline in matchmaker
  • Clients can’t find host
  • 401/403 errors on heartbeat
Common Causes:
  1. Invalid or missing host secret
  2. Incorrect heartbeat payload
  3. Redis disconnected
  4. Heartbeat interval too slow
Solutions:
Test heartbeat manually:
Check host TTL:
Monitor stale host pruning:
Symptoms:
  • Match API returns 404
  • “No hosts available” message
  • Hosts registered but not discoverable
Common Causes:
  1. Host status not ‘idle’
  2. Region mismatch
  3. Hosts expired (TTL reached)
  4. Race condition in allocation
Solutions:
Verify host configuration:
Test match without region:
Check idle_hosts set:
Monitor allocation races:

Performance Issues

Symptoms:
  • CPU usage > 80% sustained
  • Frame drops
  • System unresponsive
Common Causes:
  1. Opus complexity too high
  2. Small audio frames
  3. Video preset too slow
  4. GC pressure from buffer churn
Solutions:
Disable unused features:
Monitor buffer pool:
Symptoms:
  • Memory usage growing over time
  • Out of memory errors
  • System swapping
Common Causes:
  1. Buffer pool leaks
  2. GC not aggressive enough
  3. Large video frame buffers
Solutions:
Monitor memory:

Diagnostic Commands

Quick Health Check

Log Analysis

Network Diagnostics

Next Steps