원클릭으로
protocol-debug
Use Wireshark/tcpdump capture scripts to debug Miracast/WFD/RTSP/HDCP protocol issues with LG TVs and other sinks.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use Wireshark/tcpdump capture scripts to debug Miracast/WFD/RTSP/HDCP protocol issues with LG TVs and other sinks.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | protocol-debug |
| description | Use Wireshark/tcpdump capture scripts to debug Miracast/WFD/RTSP/HDCP protocol issues with LG TVs and other sinks. |
Provide fast, evidence-based protocol debugging using packet capture to identify exact message sequences, timing issues, and protocol mismatches when connecting swaybeam to Miracast sinks (especially LG webOS TVs).
Use this skill when:
Logs show what we think happened. Packet capture shows what actually happened:
This is especially critical for LG webOS TVs which:
All scripts are in scripts/ directory and are executable.
Purpose: Monitor for P2P interface creation, automatically start capture.
Usage:
# Terminal 1: Start capture (will wait for P2P interface)
./scripts/capture-p2p.sh [output-file]
# Terminal 2: Run swaybeam daemon
cargo run -p swaybeam-cli --bin swaybeam -- daemon --sink "22:28:BC:A8:6C:FE" --client
What it does:
p2p-wlp2s0-7)Output: pcap file for Wireshark analysis
Best for: Full session capture when you don't know interface name
Purpose: Capture specific protocol ports (RTSP, HDCP, RTP).
Usage:
./scripts/capture-protocols.sh [interface] [output-file]
# Example:
./scripts/capture-protocols.sh p2p-wlp2s0-7 swaybeam-protocols.pcap
What it captures:
Best for: Focused capture on known interface, excludes unrelated traffic
Purpose: Capture with full hex output for byte-level analysis.
Usage:
./scripts/capture-verbose.sh [interface] [output-file]
What it does:
-vv -XX flagsBest for: Analyzing exact message structure, debugging malformed packets
Purpose: Extract key protocol info from captured pcap without opening Wireshark.
Usage:
./scripts/analyze-pcap.sh [pcap-file]
# Example:
./scripts/analyze-pcap.sh swaybeam-session.pcap
What it shows:
Best for: Quick diagnosis without full Wireshark analysis
Purpose: Watch RTSP messages in real-time as ASCII text.
Usage:
./scripts/capture-rtsp-live.sh
What it shows:
Best for: Live debugging, seeing RTSP messages as they happen
Purpose: Watch HDCP messages as hex dump in real-time.
Usage:
./scripts/capture-hdcp-live.sh
What it shows:
Best for: Live HDCP debugging, seeing handshake progression
Expected sequence:
LG Reverse Mode: TV connects to us on port 7236, we act as server. SETUP is skipped, PLAY sent directly to /stream.
Expected sequence:
Key insight: We currently reach step 5 (AKE_Receiver_Info) but may be missing steps 6-8 before PLAY.
HDCP message IDs (first byte of each message):
# Step 1: Start capture
./scripts/capture-p2p.sh
# Step 2: Run swaybeam (in another terminal)
cargo run -p swaybeam-cli --bin swaybeam -- daemon --sink "22:28:BC:A8:6C:FE" --client
# Step 3: Let it fail, stop capture (Ctrl+C)
# Step 4: Quick analysis
./scripts/analyze-pcap.sh swaybeam-session.pcap
# Step 5: Deep analysis
wireshark swaybeam-session.pcap
# Terminal 1: Watch RTSP
./scripts/capture-rtsp-live.sh
# Terminal 2: Watch HDCP
./scripts/capture-hdcp-live.sh
# Terminal 3: Run swaybeam
cargo run -p swaybeam-cli --bin swaybeam -- daemon --sink "22:28:BC:A8:6C:FE" --client
# Watch messages appear in real-time
# Step 1: Find interface name (run swaybeam first, note interface from logs)
# Interface will be something like: p2p-wlp2s0-7, p2p-wlan0-5, or p2p0
# Step 2: Capture specific ports
./scripts/capture-protocols.sh p2p-wlp2s0-7 session.pcap
# Step 3: Run swaybeam in another terminal
# Step 4: Analyze
./scripts/analyze-pcap.sh session.pcap
wireshark session.pcap
tcp.port == 7236 # RTSP traffic
tcp.port == 53002 # HDCP traffic
udp.port >= 53000 # RTP traffic
tcp.analysis.flags # Connection issues (reset, retransmit)
tcp.analysis.reset # Just connection resets
tcp.stream == 0 # First TCP stream (usually RTSP)
tcp.stream == 1 # Second stream (usually HDCP)
RTSP Analysis:
HDCP Analysis:
RTP Analysis:
Connection Issues:
Symptom: PLAY rejected after AKE_Receiver_Info
Analysis:
Symptom: PLAY sent before HDCP handshake completes
Analysis:
Symptom: LG rejects specific HDCP message
Analysis:
Symptom: RTSP negotiation behaves unexpectedly
Analysis:
After running capture workflow, you should have:
If possible, capture traffic from a working Miracast source (GNOME, Windows) connecting to the same TV:
# Capture GNOME session
./scripts/capture-p2p.sh gnome-reference.pcap
# Run gnome-network-displays or similar
# Compare
wireshark gnome-reference.pcap
wireshark swaybeam-session.pcap
# Look for differences in:
# - Message sequence
# - Message timing
# - Message structure
# - Number of messages
This shows exactly what a working source does differently.
| Task | Command |
|---|---|
| Auto-capture session | ./scripts/capture-p2p.sh |
| Capture specific ports | ./scripts/capture-protocols.sh <iface> |
| Verbose hex capture | ./scripts/capture-verbose.sh <iface> |
| Quick analysis | ./scripts/analyze-pcap.sh <file> |
| Live RTSP monitor | ./scripts/capture-rtsp-live.sh |
| Live HDCP monitor | ./scripts/capture-hdcp-live.sh |
| Open in Wireshark | wireshark <file> |
After capture analysis:
# User: "PLAY is being rejected, debug faster"
# AI: "Let me start a packet capture to see exactly what's happening"
# Terminal 1
$ ./scripts/capture-p2p.sh
Monitoring for P2P interface creation...
Found P2P interface: p2p-wlp2s0-7
Local IP: 192.168.49.10
Starting capture...
[Waiting for swaybeam]
# Terminal 2
$ cargo run -p swaybeam-cli --bin swaybeam -- daemon --sink "22:28:BC:A8:6C:FE" --client
[swaybeam runs and fails]
# Terminal 1
[Ctrl+C to stop capture]
Capture saved to swaybeam-session.pcap
# Terminal 1
$ ./scripts/analyze-pcap.sh swaybeam-session.pcap
=== RTSP Traffic ===
OPTIONS -> GET_PARAMETER -> SET_PARAMETER -> PLAY -> [RESET]
=== HDCP Traffic ===
AKE_Init (2) -> AKE_Send_Cert (3) -> AKE_Transmitter_Info (20) ->
AKE_No_Stored_km (4) -> AKE_Receiver_Info (14) -> [no further messages]
=== Connection Analysis ===
TCP reset from 192.168.49.1 after PLAY
# AI: "Analysis shows HDCP stops at AKE_Receiver_Info. LG likely expects
AKE_Send_H_prime (msg_id=7) before accepting PLAY. Need to wait for
additional HDCP messages."
# Terminal 1
$ wireshark swaybeam-session.pcap
[Deep analysis confirms timing race]