@voltkit-rtc/client 0.7.3 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +57 -0
- package/README.md +244 -2
- package/dist/cjs/adaptive.d.ts +104 -0
- package/dist/cjs/adaptive.d.ts.map +1 -0
- package/dist/cjs/adaptive.js +263 -0
- package/dist/cjs/adaptive.js.map +1 -0
- package/dist/cjs/devices.d.ts +42 -0
- package/dist/cjs/devices.d.ts.map +1 -0
- package/dist/cjs/devices.js +56 -0
- package/dist/cjs/devices.js.map +1 -0
- package/dist/cjs/diagnostics.d.ts +65 -0
- package/dist/cjs/diagnostics.d.ts.map +1 -0
- package/dist/cjs/diagnostics.js +69 -0
- package/dist/cjs/diagnostics.js.map +1 -0
- package/dist/cjs/fallback.d.ts +81 -0
- package/dist/cjs/fallback.d.ts.map +1 -0
- package/dist/cjs/fallback.js +148 -0
- package/dist/cjs/fallback.js.map +1 -0
- package/dist/cjs/health.d.ts +70 -0
- package/dist/cjs/health.d.ts.map +1 -0
- package/dist/cjs/health.js +116 -0
- package/dist/cjs/health.js.map +1 -0
- package/dist/cjs/index.d.ts +339 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1098 -26
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/link.d.ts +99 -0
- package/dist/cjs/link.d.ts.map +1 -0
- package/dist/cjs/link.js +219 -0
- package/dist/cjs/link.js.map +1 -0
- package/dist/cjs/preflight.d.ts +79 -0
- package/dist/cjs/preflight.d.ts.map +1 -0
- package/dist/cjs/preflight.js +159 -0
- package/dist/cjs/preflight.js.map +1 -0
- package/dist/cjs/speakers.d.ts +34 -0
- package/dist/cjs/speakers.d.ts.map +1 -0
- package/dist/cjs/speakers.js +71 -0
- package/dist/cjs/speakers.js.map +1 -0
- package/dist/esm/adaptive.d.ts +104 -0
- package/dist/esm/adaptive.d.ts.map +1 -0
- package/dist/esm/adaptive.js +256 -0
- package/dist/esm/adaptive.js.map +1 -0
- package/dist/esm/devices.d.ts +42 -0
- package/dist/esm/devices.d.ts.map +1 -0
- package/dist/esm/devices.js +50 -0
- package/dist/esm/devices.js.map +1 -0
- package/dist/esm/diagnostics.d.ts +65 -0
- package/dist/esm/diagnostics.d.ts.map +1 -0
- package/dist/esm/diagnostics.js +65 -0
- package/dist/esm/diagnostics.js.map +1 -0
- package/dist/esm/fallback.d.ts +81 -0
- package/dist/esm/fallback.d.ts.map +1 -0
- package/dist/esm/fallback.js +142 -0
- package/dist/esm/fallback.js.map +1 -0
- package/dist/esm/health.d.ts +70 -0
- package/dist/esm/health.d.ts.map +1 -0
- package/dist/esm/health.js +111 -0
- package/dist/esm/health.js.map +1 -0
- package/dist/esm/index.d.ts +339 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1096 -26
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/link.d.ts +99 -0
- package/dist/esm/link.d.ts.map +1 -0
- package/dist/esm/link.js +214 -0
- package/dist/esm/link.js.map +1 -0
- package/dist/esm/preflight.d.ts +79 -0
- package/dist/esm/preflight.d.ts.map +1 -0
- package/dist/esm/preflight.js +153 -0
- package/dist/esm/preflight.js.map +1 -0
- package/dist/esm/speakers.d.ts +34 -0
- package/dist/esm/speakers.d.ts.map +1 -0
- package/dist/esm/speakers.js +67 -0
- package/dist/esm/speakers.js.map +1 -0
- package/package.json +1 -1
- package/src/adaptive.ts +295 -0
- package/src/devices.ts +70 -0
- package/src/diagnostics.ts +94 -0
- package/src/fallback.ts +169 -0
- package/src/health.ts +127 -0
- package/src/index.ts +1097 -27
- package/src/link.ts +255 -0
- package/src/preflight.ts +191 -0
- package/src/speakers.ts +66 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Audio-only fallback (docs/implementation-progress/RTC_PERF_PROGRESS.md H1).
|
|
3
|
+
*
|
|
4
|
+
* When this viewer's connection is so poor that even the sound breaks up, remote camera videos are paused at the
|
|
5
|
+
* server so what bandwidth there is goes to the audio, and they come back once the connection has recovered.
|
|
6
|
+
*
|
|
7
|
+
* - Agora's `setStreamFallbackOption(uid, AUDIO_ONLY)` drops to the low stream and then to audio only, and reports
|
|
8
|
+
* `stream-fallback` (fallback / recover).
|
|
9
|
+
* - Amazon Chime watches the audio it receives (`UnusableAudioWarningConnectionHealthPolicy`): about half of the
|
|
10
|
+
* expected packets missing over 15 one-second samples suggests stopping video, with a 60 s cool-down.
|
|
11
|
+
*
|
|
12
|
+
* This follows Chime's signal -- the audio actually received -- measured as RTP loss (sequence gaps) rather than
|
|
13
|
+
* packet counts, because Opus DTX sends almost nothing during silence and a count would read silence as loss.
|
|
14
|
+
* Extreme only: {@link FALLBACK_LOSS} of the audio lost over {@link FALLBACK_SAMPLES} samples, with at least
|
|
15
|
+
* {@link MIN_PACKETS} packets to judge by. Back after a hold ({@link FIRST_HOLD_MS}, doubled for each relapse within
|
|
16
|
+
* {@link RELAPSE_MS}, up to {@link MAX_HOLD_MS}) once the loss is under {@link RECOVER_LOSS} -- or nobody spoke
|
|
17
|
+
* enough to tell, in which case video comes back and a still-bad connection falls back again, holding longer.
|
|
18
|
+
*
|
|
19
|
+
* The SFU cutting a video for bandwidth by itself is reported separately, by the server (`reason: 'bandwidth'`).
|
|
20
|
+
* Pure: the decisions take counters and a clock.
|
|
21
|
+
*/
|
|
22
|
+
import type { StatsEntry } from './stats.js';
|
|
23
|
+
/** How often the received audio is sampled while the fallback could be needed. */
|
|
24
|
+
export declare const PROTECT_SAMPLE_MS = 3000;
|
|
25
|
+
/** This share of the audio lost (RTP sequence gaps) over the window: fall back. */
|
|
26
|
+
export declare const FALLBACK_LOSS = 0.25;
|
|
27
|
+
/** Below this share lost over the recovery window: video may come back. */
|
|
28
|
+
export declare const RECOVER_LOSS = 0.05;
|
|
29
|
+
/** Samples judged for falling back (15 s at 3 s) -- at least 3 of them. */
|
|
30
|
+
export declare const FALLBACK_SAMPLES = 5;
|
|
31
|
+
/** Samples judged for coming back (12 s). */
|
|
32
|
+
export declare const RECOVER_SAMPLES = 4;
|
|
33
|
+
/** Fewer audio packets than this over the fallback window are too few to judge. */
|
|
34
|
+
export declare const MIN_PACKETS = 150;
|
|
35
|
+
/** Fewer than this over the recovery window: nobody spoke enough to tell. */
|
|
36
|
+
export declare const MIN_RECOVER_PACKETS = 30;
|
|
37
|
+
/** The first fallback lasts at least this long. */
|
|
38
|
+
export declare const FIRST_HOLD_MS = 20000;
|
|
39
|
+
/** A relapse doubles the hold, up to this. */
|
|
40
|
+
export declare const MAX_HOLD_MS = 160000;
|
|
41
|
+
/** Falling back again within this long of coming back is a relapse. */
|
|
42
|
+
export declare const RELAPSE_MS = 120000;
|
|
43
|
+
export interface AudioCounters {
|
|
44
|
+
received: number;
|
|
45
|
+
lost: number;
|
|
46
|
+
}
|
|
47
|
+
/** The received-audio counters of a receive transport's report, summed over its audio streams. */
|
|
48
|
+
export declare function readInboundAudio(report: Iterable<StatsEntry>): AudioCounters;
|
|
49
|
+
/**
|
|
50
|
+
* The sent-audio counters of a send transport's report: packets sent, and how many of them the server reported
|
|
51
|
+
* lost (its RTCP receiver reports). For the publisher side (Agora's setLocalPublishFallbackOption): `received` is what
|
|
52
|
+
* got through.
|
|
53
|
+
*/
|
|
54
|
+
export declare function readOutboundAudio(report: Iterable<StatsEntry>): AudioCounters;
|
|
55
|
+
/** Decides when to fall back to audio only and when video may come back. */
|
|
56
|
+
export declare class AudioProtection {
|
|
57
|
+
private readonly onChange;
|
|
58
|
+
private readonly now;
|
|
59
|
+
private samples;
|
|
60
|
+
private previous;
|
|
61
|
+
private activeSince;
|
|
62
|
+
private hold;
|
|
63
|
+
private recoveredAt;
|
|
64
|
+
constructor(onChange: (active: boolean) => void, now?: () => number);
|
|
65
|
+
/** Whether remote camera videos are held back now. */
|
|
66
|
+
get active(): boolean;
|
|
67
|
+
/** How long the current (or next first) fallback holds, in ms. */
|
|
68
|
+
get holdMs(): number;
|
|
69
|
+
/**
|
|
70
|
+
* One reading of the cumulative counters. They only go up on one transport; lower ones are a new transport, and
|
|
71
|
+
* judging starts over from them.
|
|
72
|
+
*/
|
|
73
|
+
feed(counters: AudioCounters): void;
|
|
74
|
+
/** Come back now (the app turned the fallback off). */
|
|
75
|
+
release(): void;
|
|
76
|
+
/** The transports went away (reconnect, close): forget everything, without telling. */
|
|
77
|
+
reset(): void;
|
|
78
|
+
private activate;
|
|
79
|
+
private recover;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=fallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fallback.d.ts","sourceRoot":"","sources":["../../src/fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,kFAAkF;AAClF,eAAO,MAAM,iBAAiB,OAAO,CAAC;AACtC,mFAAmF;AACnF,eAAO,MAAM,aAAa,OAAO,CAAC;AAClC,2EAA2E;AAC3E,eAAO,MAAM,YAAY,OAAO,CAAC;AACjC,2EAA2E;AAC3E,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,6CAA6C;AAC7C,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,mFAAmF;AACnF,eAAO,MAAM,WAAW,MAAM,CAAC;AAC/B,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,KAAK,CAAC;AACtC,mDAAmD;AACnD,eAAO,MAAM,aAAa,QAAS,CAAC;AACpC,8CAA8C;AAC9C,eAAO,MAAM,WAAW,SAAU,CAAC;AACnC,uEAAuE;AACvE,eAAO,MAAM,UAAU,SAAU,CAAC;AAElC,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAID,kGAAkG;AAClG,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,aAAa,CAU5E;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,aAAa,CAW7E;AAED,4EAA4E;AAC5E,qBAAa,eAAe;IAQxB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,GAAG;IARtB,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,QAAQ,CAA8B;IAC9C,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,IAAI,CAAiB;IAC7B,OAAO,CAAC,WAAW,CAAuB;gBAGvB,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,EACnC,GAAG,GAAE,MAAM,MAAiB;IAG/C,sDAAsD;IACtD,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,kEAAkE;IAClE,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;OAGG;IACH,IAAI,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAsBnC,uDAAuD;IACvD,OAAO,IAAI,IAAI;IAIf,uFAAuF;IACvF,KAAK,IAAI,IAAI;IAMb,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,OAAO;CAMhB"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/** How often the received audio is sampled while the fallback could be needed. */
|
|
2
|
+
export const PROTECT_SAMPLE_MS = 3000;
|
|
3
|
+
/** This share of the audio lost (RTP sequence gaps) over the window: fall back. */
|
|
4
|
+
export const FALLBACK_LOSS = 0.25;
|
|
5
|
+
/** Below this share lost over the recovery window: video may come back. */
|
|
6
|
+
export const RECOVER_LOSS = 0.05;
|
|
7
|
+
/** Samples judged for falling back (15 s at 3 s) -- at least 3 of them. */
|
|
8
|
+
export const FALLBACK_SAMPLES = 5;
|
|
9
|
+
/** Samples judged for coming back (12 s). */
|
|
10
|
+
export const RECOVER_SAMPLES = 4;
|
|
11
|
+
/** Fewer audio packets than this over the fallback window are too few to judge. */
|
|
12
|
+
export const MIN_PACKETS = 150;
|
|
13
|
+
/** Fewer than this over the recovery window: nobody spoke enough to tell. */
|
|
14
|
+
export const MIN_RECOVER_PACKETS = 30;
|
|
15
|
+
/** The first fallback lasts at least this long. */
|
|
16
|
+
export const FIRST_HOLD_MS = 20_000;
|
|
17
|
+
/** A relapse doubles the hold, up to this. */
|
|
18
|
+
export const MAX_HOLD_MS = 160_000;
|
|
19
|
+
/** Falling back again within this long of coming back is a relapse. */
|
|
20
|
+
export const RELAPSE_MS = 120_000;
|
|
21
|
+
const num = (value) => (typeof value === 'number' && Number.isFinite(value) ? value : 0);
|
|
22
|
+
/** The received-audio counters of a receive transport's report, summed over its audio streams. */
|
|
23
|
+
export function readInboundAudio(report) {
|
|
24
|
+
let received = 0;
|
|
25
|
+
let lost = 0;
|
|
26
|
+
for (const e of report) {
|
|
27
|
+
if (typeof e !== 'object' || e === null || e.type !== 'inbound-rtp')
|
|
28
|
+
continue;
|
|
29
|
+
if (e.kind !== 'audio' && e.mediaType !== 'audio')
|
|
30
|
+
continue;
|
|
31
|
+
received += num(e.packetsReceived);
|
|
32
|
+
lost += Math.max(0, num(e.packetsLost));
|
|
33
|
+
}
|
|
34
|
+
return { received, lost };
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The sent-audio counters of a send transport's report: packets sent, and how many of them the server reported
|
|
38
|
+
* lost (its RTCP receiver reports). For the publisher side (Agora's setLocalPublishFallbackOption): `received` is what
|
|
39
|
+
* got through.
|
|
40
|
+
*/
|
|
41
|
+
export function readOutboundAudio(report) {
|
|
42
|
+
let sent = 0;
|
|
43
|
+
let lost = 0;
|
|
44
|
+
for (const e of report) {
|
|
45
|
+
if (typeof e !== 'object' || e === null)
|
|
46
|
+
continue;
|
|
47
|
+
const audio = e.kind === 'audio' || e.mediaType === 'audio';
|
|
48
|
+
if (!audio)
|
|
49
|
+
continue;
|
|
50
|
+
if (e.type === 'outbound-rtp')
|
|
51
|
+
sent += num(e.packetsSent);
|
|
52
|
+
else if (e.type === 'remote-inbound-rtp')
|
|
53
|
+
lost += Math.max(0, num(e.packetsLost));
|
|
54
|
+
}
|
|
55
|
+
return { received: Math.max(0, sent - lost), lost };
|
|
56
|
+
}
|
|
57
|
+
/** Decides when to fall back to audio only and when video may come back. */
|
|
58
|
+
export class AudioProtection {
|
|
59
|
+
onChange;
|
|
60
|
+
now;
|
|
61
|
+
samples = [];
|
|
62
|
+
previous = null;
|
|
63
|
+
activeSince = null;
|
|
64
|
+
hold = FIRST_HOLD_MS;
|
|
65
|
+
recoveredAt = null;
|
|
66
|
+
constructor(onChange, now = Date.now) {
|
|
67
|
+
this.onChange = onChange;
|
|
68
|
+
this.now = now;
|
|
69
|
+
}
|
|
70
|
+
/** Whether remote camera videos are held back now. */
|
|
71
|
+
get active() {
|
|
72
|
+
return this.activeSince !== null;
|
|
73
|
+
}
|
|
74
|
+
/** How long the current (or next first) fallback holds, in ms. */
|
|
75
|
+
get holdMs() {
|
|
76
|
+
return this.hold;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* One reading of the cumulative counters. They only go up on one transport; lower ones are a new transport, and
|
|
80
|
+
* judging starts over from them.
|
|
81
|
+
*/
|
|
82
|
+
feed(counters) {
|
|
83
|
+
const before = this.previous;
|
|
84
|
+
this.previous = counters;
|
|
85
|
+
if (before === null || counters.received < before.received || counters.lost < before.lost) {
|
|
86
|
+
this.samples = [];
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
this.samples.push({ received: counters.received - before.received, lost: counters.lost - before.lost });
|
|
90
|
+
if (this.samples.length > Math.max(FALLBACK_SAMPLES, RECOVER_SAMPLES))
|
|
91
|
+
this.samples.shift();
|
|
92
|
+
if (this.activeSince === null) {
|
|
93
|
+
const window = this.samples.slice(-FALLBACK_SAMPLES);
|
|
94
|
+
if (window.length < 3)
|
|
95
|
+
return;
|
|
96
|
+
const { total, lost } = sum(window);
|
|
97
|
+
if (total >= MIN_PACKETS && lost / total >= FALLBACK_LOSS)
|
|
98
|
+
this.activate();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (this.now() - this.activeSince < this.hold || this.samples.length < RECOVER_SAMPLES)
|
|
102
|
+
return;
|
|
103
|
+
const { total, lost } = sum(this.samples.slice(-RECOVER_SAMPLES));
|
|
104
|
+
if (total < MIN_RECOVER_PACKETS || lost / total < RECOVER_LOSS)
|
|
105
|
+
this.recover();
|
|
106
|
+
}
|
|
107
|
+
/** Come back now (the app turned the fallback off). */
|
|
108
|
+
release() {
|
|
109
|
+
if (this.activeSince !== null)
|
|
110
|
+
this.recover();
|
|
111
|
+
}
|
|
112
|
+
/** The transports went away (reconnect, close): forget everything, without telling. */
|
|
113
|
+
reset() {
|
|
114
|
+
this.activeSince = null;
|
|
115
|
+
this.samples = [];
|
|
116
|
+
this.previous = null;
|
|
117
|
+
}
|
|
118
|
+
activate() {
|
|
119
|
+
const now = this.now();
|
|
120
|
+
const relapse = this.recoveredAt !== null && now - this.recoveredAt < RELAPSE_MS;
|
|
121
|
+
this.hold = relapse ? Math.min(this.hold * 2, MAX_HOLD_MS) : FIRST_HOLD_MS;
|
|
122
|
+
this.activeSince = now;
|
|
123
|
+
this.samples = [];
|
|
124
|
+
this.onChange(true);
|
|
125
|
+
}
|
|
126
|
+
recover() {
|
|
127
|
+
this.activeSince = null;
|
|
128
|
+
this.recoveredAt = this.now();
|
|
129
|
+
this.samples = [];
|
|
130
|
+
this.onChange(false);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function sum(samples) {
|
|
134
|
+
let total = 0;
|
|
135
|
+
let lost = 0;
|
|
136
|
+
for (const s of samples) {
|
|
137
|
+
total += s.received + s.lost;
|
|
138
|
+
lost += s.lost;
|
|
139
|
+
}
|
|
140
|
+
return { total, lost };
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=fallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fallback.js","sourceRoot":"","sources":["../../src/f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AQ,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAEO,OAAO;QACb,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;CACF;AAED,SAAS,GAAG,CAAC,OAAiC;IAC5C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,KAAK,IAAI,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC;QAC7B,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC;IACjB,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Media health warnings (docs/implementation-progress/RTC_PERF_PROGRESS.md K1).
|
|
3
|
+
*
|
|
4
|
+
* - Agora's `exception` event pairs each problem with its recovery: FRAMERATE_INPUT_TOO_LOW / _RECOVER (the camera
|
|
5
|
+
* delivers too few frames), AUDIO_INPUT_LEVEL_TOO_LOW / _RECOVER, ...
|
|
6
|
+
* - LiveKit's `AudioSilenceDetected`: a microphone that delivers nothing but silence (a hardware mute switch, a
|
|
7
|
+
* broken device) right after it starts.
|
|
8
|
+
* - LiveKit watches the track's `mute` event (the OS took the device: a phone call, another app) and reacts after 5 s.
|
|
9
|
+
*
|
|
10
|
+
* Each warning is reported once when it starts (`active: true`) and once when it clears (`active: false`).
|
|
11
|
+
* Pure: the decisions take samples.
|
|
12
|
+
*/
|
|
13
|
+
export type MediaWarningCode =
|
|
14
|
+
/** The microphone is on but delivers exact digital silence: a mute switch, a broken or wrongly chosen device. */
|
|
15
|
+
'mic-silent'
|
|
16
|
+
/** The camera delivers far fewer frames than asked: usually a dark room (the camera exposes longer), or a busy device. */
|
|
17
|
+
| 'camera-fps-low'
|
|
18
|
+
/** The system took the camera from this page for now (a phone call, another app, a locked screen). */
|
|
19
|
+
| 'camera-interrupted'
|
|
20
|
+
/** The system took the microphone (a phone call, another app). */
|
|
21
|
+
| 'mic-interrupted';
|
|
22
|
+
export interface MediaWarning {
|
|
23
|
+
code: MediaWarningCode;
|
|
24
|
+
/** true when it starts, false when it clears. */
|
|
25
|
+
active: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** How often the published camera and microphone are sampled while someone listens. */
|
|
28
|
+
export declare const HEALTH_SAMPLE_MS = 2000;
|
|
29
|
+
/** Samples of exact silence before mic-silent (6 s). */
|
|
30
|
+
export declare const SILENT_SAMPLES = 3;
|
|
31
|
+
/** Below this the level counts as exact digital silence (a real room's noise floor is well above it). */
|
|
32
|
+
export declare const SILENCE_LEVEL = 0.0001;
|
|
33
|
+
/** Fewer frames than this per second, when 24 or more were asked, is camera-fps-low. */
|
|
34
|
+
export declare const LOW_FPS = 15;
|
|
35
|
+
/** Samples below LOW_FPS before warning (6 s); samples at RECOVERED_FPS or more before clearing. */
|
|
36
|
+
export declare const LOW_FPS_SAMPLES = 3;
|
|
37
|
+
export declare const RECOVERED_FPS = 20;
|
|
38
|
+
export declare const RECOVER_SAMPLES = 2;
|
|
39
|
+
/** A system mute shorter than this is a glitch, not an interruption. */
|
|
40
|
+
export declare const INTERRUPTED_AFTER_MS = 2000;
|
|
41
|
+
/** One reading of the published devices. null: not published (or nothing measured). */
|
|
42
|
+
export interface HealthSample {
|
|
43
|
+
/** The microphone's level, while it is on. */
|
|
44
|
+
micLevel: number | null;
|
|
45
|
+
/** The frames per second the camera delivers, while it is on, and what was asked. */
|
|
46
|
+
cameraFps: number | null;
|
|
47
|
+
askedFps: number;
|
|
48
|
+
}
|
|
49
|
+
/** Decides mic-silent and camera-fps-low from samples. */
|
|
50
|
+
export declare class HealthDecisions {
|
|
51
|
+
private readonly report;
|
|
52
|
+
private silent;
|
|
53
|
+
private lowFps;
|
|
54
|
+
private goodFps;
|
|
55
|
+
private readonly activeNow;
|
|
56
|
+
constructor(report: (warning: MediaWarning) => void);
|
|
57
|
+
isActive(code: MediaWarningCode): boolean;
|
|
58
|
+
feed(sample: HealthSample): void;
|
|
59
|
+
/** A system interruption started or ended (decided by the caller's timer). */
|
|
60
|
+
interrupted(code: 'camera-interrupted' | 'mic-interrupted', active: boolean): void;
|
|
61
|
+
/** Everything clears (unpublished, closed): each active warning is reported cleared. */
|
|
62
|
+
clearAll(): void;
|
|
63
|
+
private set;
|
|
64
|
+
}
|
|
65
|
+
/** The microphone level and camera frame rate from a producer's statistics (media-source). */
|
|
66
|
+
export declare function readMediaSource(report: Iterable<Record<string, unknown>>): {
|
|
67
|
+
level: number | null;
|
|
68
|
+
fps: number | null;
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/health.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,gBAAgB;AAC1B,iHAAiH;AAC/G,YAAY;AACd,0HAA0H;GACxH,gBAAgB;AAClB,sGAAsG;GACpG,oBAAoB;AACtB,kEAAkE;GAChE,iBAAiB,CAAC;AAEtB,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAC;IACvB,iDAAiD;IACjD,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,uFAAuF;AACvF,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,wDAAwD;AACxD,eAAO,MAAM,cAAc,IAAI,CAAC;AAChC,yGAAyG;AACzG,eAAO,MAAM,aAAa,SAAS,CAAC;AACpC,wFAAwF;AACxF,eAAO,MAAM,OAAO,KAAK,CAAC;AAC1B,oGAAoG;AACpG,eAAO,MAAM,eAAe,IAAI,CAAC;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RAMERATE_INPUT_TOO_LOW / _RECOVER (the camera
|
|
5
|
+
* delivers too few frames), AUDIO_INPUT_LEVEL_TOO_LOW / _RECOVER, ...
|
|
6
|
+
* - LiveKit's `AudioSilenceDetected`: a microphone that delivers nothing but silence (a hardware mute switch, a
|
|
7
|
+
* broken device) right after it starts.
|
|
8
|
+
* - LiveKit watches the track's `mute` event (the OS took the device: a phone call, another app) and reacts after 5 s.
|
|
9
|
+
*
|
|
10
|
+
* Each warning is reported once when it starts (`active: true`) and once when it clears (`active: false`).
|
|
11
|
+
* Pure: the decisions take samples.
|
|
12
|
+
*/
|
|
13
|
+
/** How often the published camera and microphone are sampled while someone listens. */
|
|
14
|
+
export const HEALTH_SAMPLE_MS = 2000;
|
|
15
|
+
/** Samples of exact silence before mic-silent (6 s). */
|
|
16
|
+
export const SILENT_SAMPLES = 3;
|
|
17
|
+
/** Below this the level counts as exact digital silence (a real room's noise floor is well above it). */
|
|
18
|
+
export const SILENCE_LEVEL = 0.0001;
|
|
19
|
+
/** Fewer frames than this per second, when 24 or more were asked, is camera-fps-low. */
|
|
20
|
+
export const LOW_FPS = 15;
|
|
21
|
+
/** Samples below LOW_FPS before warning (6 s); samples at RECOVERED_FPS or more before clearing. */
|
|
22
|
+
export const LOW_FPS_SAMPLES = 3;
|
|
23
|
+
export const RECOVERED_FPS = 20;
|
|
24
|
+
export const RECOVER_SAMPLES = 2;
|
|
25
|
+
/** A system mute shorter than this is a glitch, not an interruption. */
|
|
26
|
+
export const INTERRUPTED_AFTER_MS = 2000;
|
|
27
|
+
/** Decides mic-silent and camera-fps-low from samples. */
|
|
28
|
+
export class HealthDecisions {
|
|
29
|
+
report;
|
|
30
|
+
silent = 0;
|
|
31
|
+
lowFps = 0;
|
|
32
|
+
goodFps = 0;
|
|
33
|
+
activeNow = new Set();
|
|
34
|
+
constructor(report) {
|
|
35
|
+
this.report = report;
|
|
36
|
+
}
|
|
37
|
+
isActive(code) {
|
|
38
|
+
return this.activeNow.has(code);
|
|
39
|
+
}
|
|
40
|
+
feed(sample) {
|
|
41
|
+
// mic-silent: exact silence held; any sound clears it. Off or unpublished: not a warning.
|
|
42
|
+
if (sample.micLevel === null) {
|
|
43
|
+
this.silent = 0;
|
|
44
|
+
this.set('mic-silent', false);
|
|
45
|
+
}
|
|
46
|
+
else if (sample.micLevel <= SILENCE_LEVEL) {
|
|
47
|
+
this.silent += 1;
|
|
48
|
+
if (this.silent >= SILENT_SAMPLES)
|
|
49
|
+
this.set('mic-silent', true);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
this.silent = 0;
|
|
53
|
+
this.set('mic-silent', false);
|
|
54
|
+
}
|
|
55
|
+
// camera-fps-low: only when a smooth rate was asked; cleared once it holds again.
|
|
56
|
+
if (sample.cameraFps === null || sample.askedFps < 24) {
|
|
57
|
+
this.lowFps = 0;
|
|
58
|
+
this.goodFps = 0;
|
|
59
|
+
this.set('camera-fps-low', false);
|
|
60
|
+
}
|
|
61
|
+
else if (sample.cameraFps < LOW_FPS) {
|
|
62
|
+
this.goodFps = 0;
|
|
63
|
+
this.lowFps += 1;
|
|
64
|
+
if (this.lowFps >= LOW_FPS_SAMPLES)
|
|
65
|
+
this.set('camera-fps-low', true);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this.lowFps = 0;
|
|
69
|
+
if (sample.cameraFps >= RECOVERED_FPS)
|
|
70
|
+
this.goodFps += 1;
|
|
71
|
+
if (this.goodFps >= RECOVER_SAMPLES)
|
|
72
|
+
this.set('camera-fps-low', false);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** A system interruption started or ended (decided by the caller's timer). */
|
|
76
|
+
interrupted(code, active) {
|
|
77
|
+
this.set(code, active);
|
|
78
|
+
}
|
|
79
|
+
/** Everything clears (unpublished, closed): each active warning is reported cleared. */
|
|
80
|
+
clearAll() {
|
|
81
|
+
for (const code of [...this.activeNow])
|
|
82
|
+
this.set(code, false);
|
|
83
|
+
this.silent = 0;
|
|
84
|
+
this.lowFps = 0;
|
|
85
|
+
this.goodFps = 0;
|
|
86
|
+
}
|
|
87
|
+
set(code, active) {
|
|
88
|
+
if (this.activeNow.has(code) === active)
|
|
89
|
+
return;
|
|
90
|
+
if (active)
|
|
91
|
+
this.activeNow.add(code);
|
|
92
|
+
else
|
|
93
|
+
this.activeNow.delete(code);
|
|
94
|
+
this.report({ code, active });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/** The microphone level and camera frame rate from a producer's statistics (media-source). */
|
|
98
|
+
export function readMediaSource(report) {
|
|
99
|
+
let level = null;
|
|
100
|
+
let fps = null;
|
|
101
|
+
for (const s of report) {
|
|
102
|
+
if (s.type !== 'media-source')
|
|
103
|
+
continue;
|
|
104
|
+
if (typeof s.audioLevel === 'number')
|
|
105
|
+
level = s.audioLevel;
|
|
106
|
+
if (typeof s.framesPerSecond === 'number')
|
|
107
|
+
fps = s.framesPerSecond;
|
|
108
|
+
}
|
|
109
|
+
return { level, fps };
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.js","sourceRoot":"","sources":["../../src/health.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAkBH,uFAAuF;AACvF,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AACrC,wDAAwD;AACxD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAChC,yGAAyG;AACzG,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC;AACpC,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,CAAC;AAC1B,oGAAoG;AACpG,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AACjC,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAChC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AACjC,wEAAwE;AACxE,MAAM,CAAC,MAAM,oBAAoB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