client-sdk-flutter icon indicating copy to clipboard operation
client-sdk-flutter copied to clipboard

[bug] AudioSenderStats with null parameters (round trip time, jitter, packets lost).

Open hmirza1 opened this issue 1 year ago • 0 comments

Describe the bug As per the title, the AudioSenderStats class has define parameters that are null. I am particularly interested in round trip time, jitter and packets lost. Meanwhile the timestamp() and bytesSent() methods seem to be working fine.

To Reproduce Assuming a room variable is defined and room is connected. Devlog is my shorthand function for developer.log.

final audioTrack = room.localParticipant!.audioTrackPublications
            .firstWhere((track) => track.kind == TrackType.AUDIO)
            .track;

final stats = await audioTrack!.getSenderStats();
devLog(stats?.timestamp, 'TIME');
devLog(stats?.roundTripTime, 'RTT');
devLog(stats?.bytesSent, 'Bytes Sent');
devLog(stats?.jitter, 'JITTER');
devLog(stats?.packetsLost, 'PL');

I have placed the above code inside a periodic timer:

_pingTimer = Timer.periodic(const Duration(seconds: 5), (_) async {
        [ABOVE CODE HERE]
});

One of the print statements is as follows:

[TIME] 1720569791305377.0
[RTT] null
[Bytes Sent] 6189
[JITTER] null
[PL] null

Expected behavior It was expected that the round trip time, jitter and packets lost fields would be populated with values. I need these values to essentially quantify the quality of connection.

[TIME] 1720569791305377.0
[RTT] **non-null value**
[Bytes Sent] 6189
[JITTER] **non-null value**
[PL] **non-null value**

Platform information iOS simulator iPhone 14 Pro iOS 16.4 iOS simulator iPhone 15 Pro Max iOS 17.4 and iOS 17.5 Real device iPhone 15 Pro Max iOS 17.1.1

  • Flutter version: Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.22.1, on macOS 14.5 23F79 darwin-arm64, locale en-GB) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.4) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] VS Code (version 1.89.1) [✓] Connected device (6 available)
    [✓] Network resources

• No issues found!

  • Plugin version: livekit_client: ^2.2.0

hmirza1 avatar Jul 10 '24 00:07 hmirza1