Skip to main content
The ironrdp-rdpsnd crate implements the RDPSND static virtual channel for audio output redirection as specified in MS-RDPEA. This channel enables playback of remote audio on the local machine.

Overview

The RDPSND channel handles audio format negotiation, volume control, and streaming audio data from server to client. It supports multiple audio formats including PCM, ADPCM, and OPUS.

Architecture

The crate provides both client and server implementations:
  • Client (client module): Receives and plays audio from remote server
  • Server (server module): Sends audio to remote client

Client API

Rdpsnd

The client-side RDPSND processor.
Constructor:
See: ironrdp-rdpsnd/src/client.rs:58

RdpsndClientHandler

Trait for handling audio output operations:
See: ironrdp-rdpsnd/src/client.rs:13 Methods:
  • get_flags() - Returns supported capability flags (e.g., VOLUME, PITCH)
  • get_formats() - Returns list of supported audio formats
  • wave() - Called when audio data arrives for playback
  • set_volume() - Called when volume change is requested
  • set_pitch() - Called when pitch change is requested
  • close() - Called when audio channel is closed

Server API

RdpsndServer

The server-side RDPSND processor.
Constructor:
See: ironrdp-rdpsnd/src/server.rs:50 Key Methods:
  • wave(data: Vec<u8>, ts: u32) - Sends audio data to client
  • set_volume(volume_left: u16, volume_right: u16) - Sets client volume
  • close() - Closes the audio channel

RdpsndServerHandler

Trait for handling server-side audio operations:
See: ironrdp-rdpsnd/src/server.rs:31

Audio Formats

Usage Examples

Client Implementation

Server Implementation

Protocol Flow

Initialization (Client)

  1. Server sends ServerAudioFormatPdu with supported formats
  2. Client responds with ClientAudioFormatPdu containing intersected formats
  3. If version >= V6, client sends QualityModePdu
  4. Server sends TrainingPdu with test audio
  5. Client responds with TrainingConfirmPdu
  6. Channel enters Ready state

Audio Streaming

  1. Server sends Wave2Pdu (v8+) or WavePdu (v7-) with audio data
  2. Client handler receives data via wave() callback
  3. Client sends WaveConfirmPdu to acknowledge receipt
  4. Server continues streaming subsequent blocks

Version-Specific Behavior

  • Version 2-5: Basic audio streaming
  • Version 6+: Adds quality mode support
  • Version 8+: Uses Wave2Pdu format with audio timestamp

PDU Types

Key protocol data units:
  • ServerAudioFormatPdu - Server’s supported audio formats
  • ClientAudioFormatPdu - Client’s supported audio formats
  • WavePdu / Wave2Pdu - Audio data packets
  • WaveConfirmPdu - Acknowledgment from client
  • TrainingPdu / TrainingConfirmPdu - Audio latency testing
  • VolumePdu - Volume control
  • PitchPdu - Pitch control
  • QualityModePdu - Audio quality settings

Quality Modes

  • ironrdp-rdpsnd-native: Platform-specific audio output implementations
  • ironrdp-svc: Static virtual channel infrastructure
  • ironrdp-pdu: Protocol data unit encoding/decoding

References