Commit Graph

13 Commits

Author SHA1 Message Date
prlanzarin
be6a23a003 feat: add option to force/extend gathering window in SFU components
There's an edge case in finnicky networks where ALG-like firewalls
tamper with USE-CANDIDATE STUN packets and, consequently, bork ICE-lite
connectivity establishment. The odd part is that client-side gathering
seems to complete if intermediate STUN bindings work (before the final
USE-CANDIDATE), which may cause the peer not to generate relay
candidates == connectivity fails.

This adds the `public.kurento.gatheringTimeout` option to forcefully extend
the candidate gathering window in peers that act as offerers. The
behavior is as follows: if the flag is set (ms), the peer will wait
either the gathering completed stage or, _at most_,
public.kurento.gatheringTimeout ms before proceeding with calls chained
to setLocalDescription.

This option is disabled by default and intentionally ommited from the
base settings.yml file as to not encourage its use. Don't use it unless
you know what you're doing :).
2023-04-05 13:22:38 -03:00
prlanzarin
0f24e5634d fix(audio): bypass overconstrained errors in SFU-based audio 2022-09-15 20:42:43 +00:00
prlanzarin
b3eebbb926 fix(audio): retry gUM without pre-set deviceIds on OverconstrainedError(s)
There are some situations where previously set deviceIds (
local/session storage) may become stale. This causes an unexpected
behavior where audio is temporarily borked until the user clears their
local storage.
This issue has been seen more recently on Safari endpoints when switching
back-and-forth breakout rooms in environments running under iframes.
Also seen randomly on endpoints with virtual input devices.

This centralizes audio gUM calling into a single method that retries the
gUM procedure without pre-set deviceIds only if the initial call fails
due with an OverconstrainedError - hopefully circumventing the issue.
2022-09-15 19:25:30 +00:00
prlanzarin
89e814d570 fix(audio): centralize device change code, add rollbacks, surface errors
There's no rollback procedure in case a device switch fails right now,
nor does the code entrypoints that call the switching procedures wait
for resolution or failure before marking the new device as chosen. That
may cause inconsistent states in a couple of ways:
  - No rollback: switch fails, audio is still on but no actual
    microphone input is being transmitted
  - Not waiting for resolutions: inconsistent chosen devices on failures
Device switching errors are also not surfaced to the end user

This commit:
  - Adds device rollback and proper resolution/failure response
    awaits to try and make the state a bit more consistent.
  - Centralizes the input device switching code to be reused between
    different bridges
  - Centralizes device ID state management in audio-manager to try and
    mantain them a bit more consistent across the board
  - Surface device switching failures to the end user
  - Guarantee device IDs are set to the session storage on all
    appropriate scenarios
2022-08-24 13:28:27 +00:00
prlanzarin
0e162f1cda feat: configurable DSCP marking for WebRTC media
RTCRTPSender exposes DSCP marking via `networkPriority` in the encodings
configuration dictionaries. That should allow us to control
QoS priorities for different media streams, eg audio with higher network
priority than video. The only browser that implements that right
now is Chromium.

To use this, the public.app.media.networkPriorities configuration in
settings.yml. Audio, camera and screenshare priorities can be controlled
separately. For further info on the possible values, see:
  - https://www.w3.org/TR/webrtc-priority/
  - https://datatracker.ietf.org/doc/html/rfc8837#section-5
2022-08-15 21:24:05 +00:00
prlanzarin
45049cbd65 refactor: swap kurento-utils for new peer wrapper in screen sharing and audio 2022-07-15 14:00:12 +00:00
Paulo Lanzarin
240bb9e1cb
Merge pull request #15292 from prlanzarin/u26/fix/audio-undef-broker-onstop
fix(audio): check if broker exists before trying to stop
2022-06-29 15:42:05 -03:00
prlanzarin
f026c397d9 fix(audio): check if broker exists before trying to stop
There are scenarios where the full audio broker (SFU) stop  procedure
may be called multiple times in a very short timestamp - eg a concurrent
stop + connection failure; a timeout in the transfer procedure + a
reconnect attempt, [...]. When that happens, calls to exitAudio may throw
errors if the broker was already released - and that's not the expected
behavior.
2022-06-29 17:44:52 +00:00
prlanzarin
602238b84e refactor(audio): remove caller ID from fullaudio bridge start request
The callerId is assembled server-side as of bbb-webrtc-sfu
v2.9.0-alpha.3 based on the work done in commit
d940bff541b6fe3c4976428ca471457bc67ac97e.
2022-06-28 20:33:36 +00:00
prlanzarin
6a0e0a87c2 fix(audio): abide to signalCandidates configuration flag 2022-05-02 13:49:47 +00:00
prlanzarin
ccc95583ee refactor(audio): restore trickle candidate filtering in new audio bridge
+ better error handling, log messages for that code
2022-04-25 16:45:18 +00:00
prlanzarin
1decc5d343 fix(audio): respect public.media.listenOnlyOffering in new audio bridge 2022-04-25 16:22:49 +00:00
prlanzarin
459e1a9514 refactor(audio): remove old listen only bridge (kurento.js)
- Remove the old listen only bridge (kurento.js), superseded by the equivalent
  and equally stable (AS FAR AS LISTEN ONLY IS CONCERNED) sfu-audio-bridge
  - Rename FullAudioBridge.js -> sfu-audio-bridge.js
    * A more generic name that better represents the capabilities and
      the nature of the bridge
    * The bridge name identifier in configuration is still the same
      ('fullaudio')
  - Remove the FreeSWITCH listen only fallback
  - Temporarily disable the "trickle ICE" pair gathering feature used
    in SIP.js (which was always experimental, nonstandard and disabled
    by default)
  - Updates to settings.yml keys in places where relevant
2022-04-20 20:46:32 +00:00