Skip to content

Conversation

lukehb
Copy link
Contributor

@lukehb lukehb commented Sep 11, 2025

Relevant components:

  • Frontend library

Problem statement:

In some instances Pixel Streaming/WebRTC will fail to make a network connection even if the relevant ICE candidates are present. This behaviour manifests with certain connections (often Windows UE running on a slow machine where srflx is required on both sides) and if the connection is repeatedly retried it will intermittently connect. See: #692

Solution

Through investigation it was found that:

  • The Pixel Streaming plugin (in all versions) will send ICE candidates with sdpMid and sdpMLineIndex
  • sdpMid and sdpMLineIndex are not required if using bundle mode (where media is multiplexed over one transport)
  • bundle is Pixel Streaming's default (and only supported mode) for WebRTC connections
  • sdpMid can be set to an empty string "" and sdpMLineIndex can be omitted and the connection can proceed normally

While the WebRTC spec says candidates can be trickled in any order, we observed that if a candidate containing sdpMid:n (where n is any value other than the master bundle, e.g. 0 in our case) was received before the candidate containing sdpMid:m (where m is the master bundle, e.g. 0) then the connection would fail. The fix was simply to remove this unnecessary information and the connection proceeds as it should and is able to connect.

Documentation

N/A - though it should be noted with this change we explicitly are making the assumption now that Pixel Streaming must use bundle - which has always been an implicit assumption anyway.

Test Plan and Compatibility

I tested this PR on the following browsers/devices:

Chrome + Windows
Firefox + Windows
Chrome + iPhone
Chrome + Mac
Chrome + iPad
Safari + iPhone
Safari + Mac
Safari + iPad
Chrome + Android
Android Browser + Android

…ections to fail, these can be safely dropped as we use bundle by default and therefore these attributes are not used.
Copy link

changeset-bot bot commented Sep 11, 2025

🦋 Changeset detected

Latest commit: 41bfea8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@epicgames-ps/lib-pixelstreamingfrontend-ue5.6 Minor
@epicgames-ps/lib-pixelstreamingfrontend-ui-ue5.6 Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lukehb lukehb added auto-backport Used to specify we want a PR to auto backport to a branch, must be paired with auto-backport-to-UEX. auto-backport-to-UE5.5 auto-backport-to-UE5.6 auto-backport-to-UE5.4 Auto backport to UE 5.4 labels Sep 11, 2025
Comment on lines +1492 to +1495
const remoteIceCandidate = new RTCIceCandidate({
candidate: iceCandidateInit.candidate,
sdpMid: ''
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are the important lines of this fix

@lukehb lukehb removed the auto-backport-to-UE5.4 Auto backport to UE 5.4 label Sep 11, 2025
Copy link
Collaborator

@Belchy06 Belchy06 left a comment

Choose a reason for hiding this comment

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

LGTM!

@lukehb lukehb merged commit cbec432 into master Sep 11, 2025
6 checks passed
github-actions bot pushed a commit that referenced this pull request Sep 11, 2025
… even with correct ICE candidates (#694)

* Fix connectivity issue where sdpMid and sdpMLineIdx were causing connections to fail, these can be safely dropped as we use bundle by default and therefore these attributes are not used.

(cherry picked from commit cbec432)
github-actions bot pushed a commit that referenced this pull request Sep 11, 2025
… even with correct ICE candidates (#694)

* Fix connectivity issue where sdpMid and sdpMLineIdx were causing connections to fail, these can be safely dropped as we use bundle by default and therefore these attributes are not used.

(cherry picked from commit cbec432)
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
UE5.5
UE5.6

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

lukehb pushed a commit that referenced this pull request Sep 11, 2025
…nnection even with correct ICE candidates (#694) (#696)

* Fix Pixel Streaming intermittently fails to make a network connection even with correct ICE candidates (#694)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Used to specify we want a PR to auto backport to a branch, must be paired with auto-backport-to-UEX. auto-backport-to-UE5.5 auto-backport-to-UE5.6
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Intermittent ICE candidate failure when correct candidates are present
2 participants