Commit Graph

48 Commits

Author SHA1 Message Date
prlanzarin
8feb934169 feat(audio): add experimental transparent listen only mode
This is an initial, experimental implementation of the feature proposed in
https://github.com/bigbluebutton/bigbluebutton/issues/14021.

The intention is to phase out the explicit listen only mode with two
overarching goals:
  - Reduce UX friction and increase familiarity: the existence of a separate
  listen only mode is a source of confusion for the majority of users
  Reduce average server-side CPU usage while also making it possible for
  having full audio-only meetings.

The proof-of-concept works based on the assumption that a "many
concurrent active talkers" scenario is both rare and not useful. With
that in mind, this including two server-side triggers:
 - On microphone inactivity (currently mute action that is sustained for
   4 seconds, configurable): FreeSWITCH channels are held (which translates
   to much lower CPU usage, virtually 0%). Receiving channels are switched,
   server side, to a listening mode (SFU, mediasoup).
   * This required an extension to mediasoup two allow re-assigning producers
     to already established consumers. No re-negotiation is done.
 - On microphone activity (currently unmute action, immediate):
   FreeSWITCH channels are unheld, listening mode is deactivated and the
   mute state is updated accordingly (in this order).

This is *off by default*. It needs to be enabled in two places:
  - `/etc/bigbluebutton/bbb-webrtc-sfu/production.yml` ->
    `transparentListenOnly: true`
  - End users:
    * Server wide: `/etc/bigbluebutton/bbb-html5.yml` ->
      `public.media.transparentListenOnly: true`
    * Per user: `userdata-bbb_transparent_listen_only=true`
2023-08-07 19:43:18 -03:00
Arthurk12
e902f2ee27 feat(screenshare): add contentType field
This commit adds a contentType field in the back-end components of the
screenshare feature in order to accomodate the new 'camera as content'
feature.
2023-05-09 17:21:47 -03:00
Anton Georgiev
e2dc7da98a
Merge pull request #16828 from prlanzarin/u27/fix/ss-cam-reconn
fix: re-connection improvements for cameras and screen sharing
2023-04-05 16:13:01 -04:00
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
5ee0ff9af2 fix(screenshare): add proper signaling heartbeat, +
Same rationale as in video-provider's commit
(34fa37ae4f092af4a5aef0cf01d96c033d97473c).

This commit does the following:
  - Implement actual heartbeat checks to trigger reconnects when
    necessary
  - Properly catch and log WebSocket.send errors
2023-03-08 15:46:55 -03:00
Daniel Schreiber
4347ff2e3b Re-add option to disable enforce relay webrtc traffic for Firefox
There may be other bridges may not need to force relay traffic on
firefox as @prlanzarin pointed out. So set the default to a
configuration that works out of the box but leave other choices for the
operator.

The option is moved from kurento namespace to media next to the general
forceRelay option.
2023-01-03 23:21:25 +01:00
Daniel Schreiber
74f37db4fa Get rid of forceRelayOnFirefox
Firefox has a buggy ICE implementation and needs WebRTC media traffic to
be routed through a turn server to work reliably with mediasoup.

Use the information fetched by the STUN API to determine if the operator
has configured a turn server. If there is one force firefox to use it.

Closes #16164
2022-12-18 23:17:14 +01:00
prlanzarin
0f24e5634d fix(audio): bypass overconstrained errors in SFU-based audio 2022-09-15 20:42:43 +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
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
1d860d64d0 fix(audio): remove deprecated getLocalStreams usage
Use the built-in getLocalStream from the peer wrapper instead (which
relies on getSenders - the proper, spec-compliant way).

Two different issues are addressed:
  - RTCPeerConnection.getLocalStreams is a pre-1.0 WebRTC spec which is
    deprecated and not recommended.
  - Fixed an issue where a switch from full audio to listen only could
  cause the latter to be rejected with an error 1004 in rare scenarios.
2022-05-27 14:02:10 +00:00
prlanzarin
83e26b7f63 fix(screenshare): race condition - local stream ends while broker stars
There could be a race condition where the local getDisplayMedia stream ends
(eg via Chrome`s stop sharing toast) while the broker hasn't finished starting.
That would lead to a scenario where the broker wouldn't emit an end event,
causing screen sharing to be flagged as started with a blank/invalid stream.
2022-05-09 18:00:30 +00:00
prlanzarin
6a0e0a87c2 fix(audio): abide to signalCandidates configuration flag 2022-05-02 13:49:47 +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
prlanzarin
6fd6a52d47 fix(audio): prevent uncaught rejections in the experimental audio bridge startup 2022-04-20 17:40:06 +00:00
prlanzarin
1e80d050b7 refactor(audio): generic use of sfu audio broker to cover mic and listen only 2022-04-20 17:26:52 +00:00
prlanzarin
2eaf96ae95 refactor(audio): address linter warnings in fullaudio-broker.js 2022-04-20 13:52:16 +00:00
prlanzarin
f4ba6dd9a2 refactor(audio): use preloaded audio stream if provided
Avoids a surplus gUM with local echo test et al
2022-04-11 22:29:20 +00:00
Paulo Lanzarin
5fa7c18b43
Merge pull request #14621 from prlanzarin/u25-victorio-fuzz
fix(audio): clean up sfu broker, guarantee peer exists in getLocalStream
2022-03-17 14:39:41 -03:00
prlanzarin
13c6b12f89 fix(audio): clean up sfu broker, guarantee peer exists in getLocalStream 2022-03-17 11:20:19 -03:00
Paulo Lanzarin
e9c400e61b
Merge pull request #14211 from prlanzarin/u25-victorio-fuzz
feat(fullaudio): implement echo test, device change and audio filters (new bridge)
2022-03-16 12:36:50 -03:00
prlanzarin
d9c329df27 refactor(fullaudio): remove server-provided RPC parameters 2022-03-10 14:59:43 -03:00
prlanzarin
b9f9043d9c feat(fullaudio): handle forceRelayOnFirefox flag 2022-03-10 14:31:42 -03:00
prlanzarin
53115ccaa2 fix: missing import in load-play util script (webrtc) 2022-03-03 19:49:53 -03:00
prlanzarin
ed89f6e4a5 feat(fullaudio): implement input/output device change in new bridge 2022-02-01 17:19:50 -03:00
prlanzarin
cb84e34833 feat(fullaudio): implement echo test in new full audio bridge
Partially addresses https://github.com/bigbluebutton/bigbluebutton/issues/14191
2022-01-26 11:03:27 -03:00
prlanzarin
93b5f4c93d feat(bbb-html5): add a general forceRelay flag
public.media.forceRelay forces relay usage on all browsers, environments and media modules

If true, overrides public.kurento.[4~forceRelayOnFirefox
2021-12-09 11:35:56 +00:00
prlanzarin
da6ab02122 chore: add forceRelayOnFirefox option (false by default)
- forceRelayOnFirefox: whether TURN/relay usage should be forced to work
around Firefox's lack of support for regular nomination when dealing with
ICE-litee peers (e.g.: mediasoup).
  * See: https://bugzilla.mozilla.org/show_bug.cgi?id=1034964
- iOS endpoints are ignored from the trigger because _all_ iOS browsers
  are either native WebKit or WKWebView based (so they shouldn't be affected)
2021-11-30 20:31:12 +00:00
Mario Jr
a719f8f5e4 fix(audio): update fullaudio bridge according to sonar's checks 2021-11-09 12:10:44 -03:00
Mario Jr
f9dbefe764 feat(audio): basic funcionality for fullaudio bridge
This commit allows user to join/leave audio using the fullaudio bridge.
This is still under development, but to use this now we must set values of
skipCheck to false, and defaultFullAudioBridge to fullaudio. This
depends on newest version of bbb-webrtc-sfu
2021-11-09 12:09:18 -03:00
Mario Jr
42778adeaf feat(audio): add base code for fullaudio bridge
This bridge will work with bbb-webrtc-sfu to handle microphone audio.
2021-11-09 12:08:45 -03:00
prlanzarin
1cb412529d feat(webrtc): add EXPERIMENTAL option to disable ICE candidate signaling
ICE lite servers (eg mediasoup) dont need candidates signaled out-of-band; neither does KMS in certain scenarios

Disable their signaling saves us some ticks in bbb-webrtc-sfu and some bandwidth all around
2021-09-24 17:24:06 +00:00
prlanzarin
c57fb0b388 feat(audio): add media server adapter config for listen only in bbb-html5
Allows configuring, via bbb-html5, which media server adapter will be used by listen only; server wide
2021-08-31 00:24:41 +00:00
prlanzarin
86a715dc15 feat(screenshare): add media server adapter config in bbb-html5
Allows configuring, via bbb-html5, which media server adapter will be used by screen sharing; server wide
2021-08-31 00:19:51 +00:00
prlanzarin
54d04fdb77 refactor(listen-only): let the server generate subscriber offers 2021-08-12 13:45:18 +00:00
prlanzarin
387c453076 refactor(screnshare): let the server generate subscriber offers 2021-08-12 13:45:04 +00:00
prlanzarin
455fb8426f feat(sfu): add both ways negotiation to SFU broker 2021-08-11 19:35:16 +00:00
prlanzarin
84cbda75a3 feat(screenshare): add screen bitrate config in bbb-html5 2021-04-24 19:12:59 +00:00
prlanzarin
e0e22733dd video-provider,screenshare: consider a stream unhealthy only when the peer fails
Done to avoid false positives where the stream would transition to the unhealthy UI state (or flicker between states) due to disconnected also triggering it, which is not fatal. Disconnected has to be used alongside getStats heuristics, which I removed due to issues with it, so I´m hardening the transition to fatal states only
2021-02-05 19:54:05 -03:00
prlanzarin
9a916878f9 sfu: split broker errors into different classes
Will be used in subsequent changes to allow us to compose them into error normalization procedures
2021-01-13 09:05:12 -03:00
prlanzarin
6f16154035 screenshare: logging/trailing lines cleanup 2021-01-13 09:04:46 -03:00
prlanzarin
569ace358b screenshare: improve reconnection procedures and error logging in kurento/sfu bridge 2020-12-15 17:45:20 +00:00
prlanzarin
e57daf55db [screenshare] Add new SFU screen sharing negotiation broker
A replacement to the old kurento-extension script which is to be considered legacy code
2020-12-09 18:46:30 +00:00
prlanzarin
d6fdd79412 sfu-base-broker: add beforeunload listener to avoid logging false positive errors 2020-12-08 20:19:03 +00:00
prlanzarin
0077a83ef5 [html5/webrtc] Add a centralized util to load and play a media element with proper error handling
To be used with bbb-webrtc-sfu based media brokers
2020-12-01 18:10:17 +00:00
prlanzarin
a7559a6b7d [listenonly] Add new SFU listen only negotiation broker
A replacement to the old kurento-extension script which is to be considered legacy code
2020-12-01 18:09:10 +00:00
prlanzarin
a49aa0a1ca [html5/webrtc] Added proper error handling in bbb-webrtc-sfu base broker
Moved bbb-webrtc-sfu utilitaries to properly named folder

Logging improvements to base broker

Added onerror/onstart/onended callback interfaces to base broker
2020-12-01 18:06:50 +00:00