Skip to main content
The RDPSND channel implements [MS-RDPEA] — Remote Desktop Protocol: Audio Output Virtual Channel Extension. It streams audio from the server to the client. SVC channel name: rdpsnd (RDPSND_CHANNEL_NAME)
DVC channel names: AUDIO_PLAYBACK_DVC, AUDIO_PLAYBACK_LOSSY_DVC
Server header: <freerdp/server/rdpsnd.h>
Client header: <freerdp/client/rdpsnd.h>
Common types: <freerdp/channels/rdpsnd.h> (re-exports <freerdp/codec/audio.h>)

Server API

RdpsndServerContext lifecycle

vcm is the virtual channel manager handle. reset reinitialises the context without freeing, for reuse after a session reconnect.

Helper functions

Use rdpsnd_server_get_event_handle() in a wait-loop and call rdpsnd_server_handle_messages() when signalled to process incoming client PDUs.

RdpsndServerContext fields

void*
Server-defined private pointer.
BOOL
Set to TRUE before Initialize to open via DVC (AUDIO_PLAYBACK_DVC) instead of the legacy SVC.
AUDIO_FORMAT*
Array of AUDIO_FORMAT structs the server supports. Set before calling Initialize.
size_t
Length of server_formats.
AUDIO_FORMAT*
The PCM format of the audio source (sample rate, channels, bits-per-sample). Set before SendSamples.
UINT32
Requested audio buffer / latency in milliseconds.
AUDIO_FORMAT*
Populated by the channel after format negotiation with the client. Read-only for the server.
UINT16
Number of entries in client_formats.
UINT16
Index into client_formats of the currently active format. Set by SelectFormat.

Server API calls

psRdpsndServerInitialize
Opens the channel and begins format negotiation. If ownThread = TRUE the implementation spawns a worker thread; otherwise the caller must drive messages via rdpsnd_server_handle_messages().
psRdpsndServerSelectFormat
Selects the client audio format at client_format_index (index into client_formats). Must be called before SendSamples.
psRdpsndServerSendFormats
Re-sends the server format list and version PDU. Normally called automatically by Initialize; call manually to restart the protocol after Close.
psRdpsndServerSendSamples
Sends PCM audio data in src_format. nframes is the number of audio frames (not bytes). The channel converts to the negotiated client format internally if a DSP is configured.
psRdpsndServerSendSamples2
Sends already-encoded audio via a Wave2 PDU. formatNo is an index into client_formats. Bypasses any internal DSP conversion.
psRdpsndServerSetVolume
Sets the client-side playback volume. Valid range is 0x0000 (mute) to 0xFFFF (full).
psRdpsndServerTraining
Sends a Training PDU used for round-trip time measurement.

Server callbacks

psRdpsndServerActivated
Called (from the worker thread) when the client has completed format negotiation and is ready to receive audio. Start streaming from this callback.
psRdpsndServerTrainingConfirm
Called when the client confirms a Training PDU. Use to calculate round-trip latency.
psRdpsndServerConfirmBlock
Called when the client acknowledges a WaveConfirm PDU. Used for flow control.

Client Device Plugin

The client side uses an rdpsndDevicePlugin (audio output backend — e.g. PulseAudio, ALSA, Windows CoreAudio).
Register a custom backend by implementing freerdp_rdpsnd_client_subsystem_entry (RDPSND_DEVICE_EXPORT_FUNC_NAME) returning a populated rdpsndDevicePlugin.

Audio Codec Support

Always available — built-in codec in WinPR. No extra dependencies.

Minimal Server Usage