transport.enableTraceEvent([ 'bwe' ]) not working

Hi,

So I read the documentation and I see that there’s an event “bwe” on the transport that gives us a bandwidth estimation. I’ve added it in my code after looking at how it has been implemented in mediasoup-demo.

Before moving on, my code is a fork of the actual mediasoup-demo the only difference is that I have different skin on it, and I’ve disabled some unwanted features like chat etc. So

Here’s my code:

				await transport.enableTraceEvent([ 'bwe' ]);

				transport.on('trace', (trace) =>
				{
					logger.info(
						'transport "trace" event [transportId:%s, trace.type:%s, trace:%o]',
						transport.id, trace.type, trace);

					if (trace.type === 'bwe' && trace.direction === 'out')
					{
						peer.notify(
							'downlinkBwe',
							{
								desiredBitrate          : trace.info.desiredBitrate,
								effectiveDesiredBitrate : trace.info.effectiveDesiredBitrate,
								availableBitrate        : trace.info.availableBitrate
							})
							.catch(() => {});
					}
				});

I am not getting any logs on the server, or any events on the client side WebSocket messages. When are the ‘bwe’ events supposed to fire? The documentation is quite straight forward and I’ve replicated it to my best but no logs. Any help would be really appreciated. :slight_smile:

Thanks.

Ok. So It was my bad. I was running the server as well as the client on the localhost. And I think because of that there were no events for bandwidth estimation, still I don’t know why that’s the case but maybe its because of the loopback address.

However when I deployed on a remote machine I started getting logs. But now my question would be what is the meaning of:

* desiredBitrate.
* effectiveDesiredBitrate.
and
* availableBitrate

Thanks

I’m afraid this is too low level info and we do not plan to provide proper documentation yet.

  • availableBitrate means the bitrate that mediasoup has estimated that it can send to the remote endpoint.
  • desiredBitrate is the bitrate that mediasoup wants to send to the rmeote endpoint (based on the producers it’s consuming for that endpoint).
1 Like

Thank you loads. This was great help.