discord.py icon indicating copy to clipboard operation
discord.py copied to clipboard

Is it possible to determine the outbound packet loss (in voice channels)?

Open KowalskiThomas opened this issue 5 years ago • 1 comments

I asked about that in the discord.py Discord yesterday, and got an "I think not" answer, so I figured I'd ask here, just to be sure.

I'd like to find out the outbound packet loss for my bot when it is connected to a voice channel. I haven't found anything in the docs for that, though, so I was wondering if there was something implemented for that and, if not, if there was a way to do it without reinventing the wheel.

Thanks for your awesome work!

KowalskiThomas avatar Jun 17 '19 07:06 KowalskiThomas

Good news, you actually can. Bad news, its part of voice receive. The one type of RTC control packet discord sends (as far as I can tell) is the ReceiverReport type, which has some statistics for the data you send. They look like this:

<ReceiverReportPacket report_count: 1, ssrc: 13, reports: (RReport(ssrc=13, perc_loss=0, total_lost=0, last_seq=453, jitter=3, lsr=0, dlsr=2432705982),), extension: None>

Checking this has also made me notice that currently (in my voice recv fork) that to receive packets about your send statistics you need to have a listener attached, even if it does nothing. This is obvious from a logical perspective but backwards from a library usage perspective. I suppose i'll have to design this in as some sort of special sink or something.

imayhaveborkedit avatar Jul 06 '19 06:07 imayhaveborkedit