Skip to content

Commit ab26f19

Browse files
SimonBrandneranoadragon453richvdh
authored
MSC3291: Muting in VoIP calls (#3291)
* MSC: Muting in VoIP calls Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Update MSC number Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Missing : Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Fix MSC number in prefix Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Fix unstable prefix table Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Reword pottential issues Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Add an Alternatives section Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Remove trailing comma Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> * Fix a typo Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> * Fix missing word Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Link to MSC for holding Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Update unstable prefixes Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Simplify things Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Be explicit about deps Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Be clearer about how things work Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Update proposals/3291-muting.md Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> * `disabled` -> `enabled` Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Fix client mention Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Improve explaination Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Be more precise Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> * Fix negation Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> * Don't refer to something that doesn't exist Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --------- Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
1 parent ddad150 commit ab26f19

File tree

1 file changed

+130
-0
lines changed

1 file changed

+130
-0
lines changed

proposals/3291-muting.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# MSC3291: Muting in VoIP calls
2+
3+
During VoIP calls, it is common for a user to mute their microphone/camera.
4+
Ideally, the other side should be able to see that the opponent's camera is
5+
muted, so that it could reflect this in the UI (e.g. show the user's avatar
6+
instead of their camera feed). We would also want the changes in the mutes state
7+
to be quick.
8+
9+
Using pure WebRTC there are two ways to do muting and both have their issues:
10+
11+
+ Disabling the corresponding track
12+
+ Setting the corresponding track as `recvonly`/`inactive`
13+
14+
The Alternatives section describes the issues with using these alone.
15+
16+
## Proposal
17+
18+
This MSC proposes extending the `sdp_stream_metadata` object (see
19+
[MSC3077](https://github.com/matrix-org/matrix-doc/pull/3077)) to allow
20+
indicating the mute state to the other side using the following fields:
21+
22+
+ `audio_muted` - a boolean indicating the current audio mute state
23+
+ `video_muted` - a boolean indicating the current video mute state
24+
25+
This MSC also adds a new call event `m.call.sdp_stream_metadata_changed`, which
26+
has the common VoIP fields as specified in
27+
[MSC2746](https://github.com/matrix-org/matrix-doc/pull/2746) (`version`,
28+
`call_id`, `party_id`) and a `sdp_stream_metadata` object which is the same
29+
thing as `sdp_stream_metadata` in `m.call.negotiate`, `m.call.invite` and
30+
`m.call.answer`. The client sends this event when the `sdp_stream_metadata` has
31+
changed but no negotiation is required (e.g. the user mutes their
32+
camera/microphone).
33+
34+
All tracks should be assumed unmuted unless specified otherwise.
35+
36+
Clients are recommended to not mute the audio of WebRTC tracks locally when a
37+
incoming stream has the `audio_muted` field set to `true`. This is because when the
38+
other user unmutes themselves, there may be a slight delay between their client
39+
sending audio and the `m.call.sdp_stream_metadata_changed` event arriving. If
40+
`enabled` is set to `false`, then any audio sent in between those two events
41+
will not be heard. The other user will still stop transmitting audio once they
42+
mute on their side, so no audio is sent without the user's knowledge.
43+
44+
The same suggestion does not apply to `video_muted` - there clients _should_
45+
mute video locally, so that the receiving side doesn't see black video.
46+
47+
### Example
48+
49+
```JSON
50+
{
51+
"type": "m.call.sdp_stream_metadata_changed",
52+
"room_id": "!roomId",
53+
"content": {
54+
"version": "1",
55+
"call_id": "1414213562373095",
56+
"party_id": "1732050807568877",
57+
"sdp_stream_metadata": {
58+
"2311546231": {
59+
"purpose": "m.usermedia",
60+
"audio_muted:": true,
61+
"video_muted": true
62+
}
63+
}
64+
}
65+
}
66+
```
67+
68+
This event indicates that both audio and video are muted. It is suggested the
69+
video track of stream `2311546231` should be hidden in the UI (probably replaced
70+
by an avatar). It also suggests the UI should show an indication that the audio
71+
track is muted but the client should not mute the audio on the receiving side.
72+
73+
## Potential issues
74+
75+
When the user mutes their camera, some browsers may keep sending meaningless data
76+
which will waste bandwidth.
77+
78+
## Alternatives
79+
80+
### Only disabling the corresponding track
81+
82+
This is the solution that some clients (e.g. Element Android) use at the moment.
83+
While this is almost instantaneous, it doesn't allow the other side to know the
84+
opponent's mute state. This leads to the opponent showing a black screen for a
85+
muted video track and not doing anything for a muted audio track which is bad
86+
for UX.
87+
88+
### Setting the corresponding track as `recvonly`/`inactive`
89+
90+
While this would be beneficial for low bandwidth connections, it takes time. The
91+
delay might be acceptable for video but isn't for audio (with which you would
92+
assume an instantaneous mute state change). This is also problematic since there
93+
could be a confusion with holding (as defined in
94+
[MSC2746](https://github.com/matrix-org/matrix-doc/pull/2746)).
95+
96+
### Using a separate event for muting
97+
98+
While this might feel clearer initially, it doesn't have much real benefit. The
99+
mute state is in fact a meta information about the stream and using
100+
`sdp_stream_metadata` is also more flexible for cases where the user joins a
101+
call already muted. It is also more flexible in general and would be useful if
102+
we ever decided to do what is described in the next section.
103+
104+
### A combination of disabling tracks, `sdp_stream_metadata` and SDP
105+
106+
An option would be using the current method in combination with setting the
107+
corresponding track as `recvonly`/`inactive`. Along with this clients would need
108+
to set the mute state in `sdp_stream_metadata` to avoid conflicts with holding
109+
(as defined in [MSC2746](https://github.com/matrix-org/matrix-doc/pull/2746)).
110+
While this solution might be the most flexible solution as it would allow
111+
clients to choose between bandwidth and a mute state change delay for each
112+
track, it would be harder to implement and feels generally disjointed.
113+
114+
## Security considerations
115+
116+
None that I can think of.
117+
118+
## Dependencies
119+
120+
+ [MSC3077](https://github.com/matrix-org/matrix-doc/pull/3077)
121+
122+
## Unstable prefix
123+
124+
|Release |Development |
125+
|------------------------------------|---------------------------------------------|
126+
|`m.call.sdp_stream_metadata_changed`|`org.matrix.call.sdp_stream_metadata_changed`|
127+
|`sdp_stream_metadata` |`org.matrix.msc3077.sdp_stream_metadata` |
128+
129+
We use an unstable prefix for `sdp_stream_metadata` to match
130+
[MSC3077](https://github.com/matrix-org/matrix-doc/pull/3077).

0 commit comments

Comments
 (0)