Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions livekit-ffi/protocol/room.proto
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ message TrackPublishOptions {
// Controls how the encoder trades off between resolution and framerate
// when bandwidth is constrained. Default is MAINTAIN_RESOLUTION.
optional DegradationPreference degradation_preference = 13;
// Publish an audio track as stereo. Required for the server to signal
// stereo=1 to the publisher and sprop-stereo=1 to subscribers.
optional bool stereo = 14;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Regenerate the Node FFI protobuf bindings

Adding this FFI proto field is not enough for the checked-in Node package: livekit-ffi-node-bindings/proto/room_pb.js still defines TrackPublishOptions only through field 13, and the .d.ts type likewise has no stereo property. In contexts using the committed @livekit/rtc-ffi-bindings package, a Node caller cannot serialize tag 14 from new TrackPublishOptions({ stereo: true }), so the FFI conversion here never sees opts.stereo and Node still cannot opt into stereo until those generated bindings are updated.

Useful? React with 👍 / 👎.

}

enum VideoEncoderBackend {
Expand Down
1 change: 1 addition & 0 deletions livekit-ffi/src/conversion/room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ impl From<proto::TrackPublishOptions> for TrackPublishOptions {
preconnect_buffer: opts
.preconnect_buffer
.unwrap_or(default_publish_options.preconnect_buffer),
stereo: opts.stereo.unwrap_or(default_publish_options.stereo),
frame_metadata_features: frame_metadata_features_from_proto(
opts.frame_metadata_features,
),
Expand Down
5 changes: 5 additions & 0 deletions livekit/src/room/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ pub struct TrackPublishOptions {
pub video_codec: VideoCodec,
pub dtx: bool,
pub red: bool,
/// Publish the audio track as stereo. The server only signals `stereo=1;maxaveragebitrate=510000`
/// to the publisher (and `sprop-stereo=1` to subscribers) when the track carries the
/// `TF_STEREO` audio feature, so stereo sources are otherwise downmixed to mono by the encoder.
pub stereo: bool,
Comment on lines +124 to +127

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Release notes entry missing for the new publishing option

The repository requires every pull request to include a changeset file describing the change and the crates to bump, but this change adds a new public publishing option (stereo at livekit/src/room/options.rs:127) without adding one, so the release notes and version bumps will be missing this feature.
Impact: The new stereo option ships without documentation in release notes and the affected crates may not be version-bumped.

Missing /.changeset entry required by AGENTS.md

AGENTS.md ("Documenting changes") states: "Every PR needs a changeset" and "Changeset must list any crates which need to be bumped stemming from the change". The current /.changeset directory only contains add_caching_to_livekit_token_source_crate.md and automatically_retry_webrtc_build_downloads.md from previous PRs; no file was added for this change, which touches livekit (new public field on TrackPublishOptions) and livekit-ffi (new proto field and conversion).

Prompt for agents
AGENTS.md requires a changeset for every PR, listing the crates that need to be bumped. Add a markdown changeset file under /.changeset (following the format of the existing files there, e.g. add_caching_to_livekit_token_source_crate.md) describing the new TrackPublishOptions::stereo option and the corresponding FFI proto field, and listing both the livekit and livekit-ffi crates for version bumps.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

pub simulcast: bool,
/// Custom simulcast layer presets (low, mid). When set, these override the
/// SDK's built-in defaults which reduce fps on lower layers.
Expand Down Expand Up @@ -161,6 +165,7 @@ impl Default for TrackPublishOptions {
video_codec: VideoCodec::VP8,
dtx: true,
red: true,
stereo: false,
simulcast: true,
simulcast_layers: None,
source: TrackSource::Unknown,
Expand Down
5 changes: 5 additions & 0 deletions livekit/src/room/participant/local_participant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,11 @@ impl LocalParticipant {
req.audio_features.push(proto::AudioTrackFeature::TfPreconnectBuffer as i32);
}

if options.stereo && matches!(track, LocalTrack::Audio(_)) {
req.stereo = true;
req.audio_features.push(proto::AudioTrackFeature::TfStereo as i32);
}

req.packet_trailer_features =
options.frame_metadata_features.to_proto().into_iter().map(|f| f as i32).collect();

Expand Down
Loading