Randomly joined peers can not see each other

This problem can be solved by refreshing page several times.And I’ve checked the producer and consumer info. When it occurs

case 1: producer icestate is “new” not “finished” nor “completed”
case 2: consumer can not consume any data (sometimes no audio && video, no video but audio)

image

I’ve checked the server side logging and found some hints may help to diagnose this issue:

mediasoup:Consumer constructor() +239ms
  mediasoup-demo-server:Room WebRtcTransport "sctpstatechange" event [sctpState:connecting] +112ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +486ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +1ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +2ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +3ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +2ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:Consumer resume() +135ms
  mediasoup:Channel request() [method:consumer.resume, id:276] +135ms
  mediasoup:Channel request succeeded [method:consumer.resume, id:276] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +75ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +1ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +1ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:Consumer resume() +115ms
  mediasoup:Channel request() [method:consumer.resume, id:277] +115ms
  mediasoup:Channel request succeeded [method:consumer.resume, id:277] +1ms
  mediasoup-demo-server:Room producer "videoorientationchange" event [producerId:f9bedcde-b135-4d4f-b024-86b41e46c880, videoOrientation:{ camera: false, flip: false, rotation: 0 }] +148ms
  mediasoup-demo-server:Room protoo Peer "request" event [method:produceData, peerId:n2pc8lre] +2ms
  mediasoup:Transport produceData() +259ms
  mediasoup:Channel request() [method:transport.produceData, id:278] +6ms
  mediasoup:Channel request succeeded [method:transport.produceData, id:278] +1ms
  mediasoup:DataProducer constructor() +1s
  mediasoup:Transport consumeData() +1ms
  mediasoup:Channel request() [method:transport.consumeData, id:279] +0ms
  mediasoup:Channel request succeeded [method:transport.consumeData, id:279] +0ms
  mediasoup:DataConsumer constructor() +618ms
  mediasoup-demo-server:Room WebRtcTransport "sctpstatechange" event [sctpState:connected] +6ms
  mediasoup:Consumer resume() +16ms
  mediasoup:Channel request() [method:consumer.resume, id:280] +8ms
  mediasoup:Channel request succeeded [method:consumer.resume, id:280] +0ms
  mediasoup-demo-server:Room protoo Peer "request" event [method:produceData, peerId:n2pc8lre] +33ms
  mediasoup:Transport produceData() +38ms
  mediasoup:Channel request() [method:transport.produceData, id:281] +30ms
  mediasoup:Channel request succeeded [method:transport.produceData, id:281] +0ms
  mediasoup:DataProducer constructor() +38ms
  mediasoup:Transport consumeData() +0ms
  mediasoup:Channel request() [method:transport.consumeData, id:282] +0ms
  mediasoup:Channel request succeeded [method:transport.consumeData, id:282] +1ms
  mediasoup:DataConsumer constructor() +39ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +330ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +1ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +5ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +1ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +5ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +6ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:20819] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2657625553, payloadType:97] +0ms

I’ve checked the source code in Room.js the _createConsumer function:

async _createConsumer({ consumerPeer, producerPeer, producer })
	{
		// Optimization:
		// - Create the server-side Consumer in paused mode.
		// - Tell its Peer about it and wait for its response.
		// - Upon receipt of the response, resume the server-side Consumer.
		// - If video, this will mean a single key frame requested by the
		//   server-side Consumer (when resuming it).
		// - If audio (or video), it will avoid that RTP packets are received by the
		//   remote endpoint *before* the Consumer is locally created in the endpoint
		//   (and before the local SDP O/A procedure ends). If that happens (RTP
		//   packets are received before the SDP O/A is done) the PeerConnection may
		//   fail to associate the RTP stream.

		// NOTE: Don't create the Consumer if the remote Peer cannot consume it.
		if (
			!consumerPeer.data.rtpCapabilities ||
			!this._mediasoupRouter.canConsume(
				{
					producerId      : producer.id,
					rtpCapabilities : consumerPeer.data.rtpCapabilities
				})
		)
		{
			return;
		}

		// Must take the Transport the remote Peer is using for consuming.
		const transport = Array.from(consumerPeer.data.transports.values())
			.find((t) => t.appData.consuming);

		// This should not happen.
		if (!transport)
		{
			logger.warn('_createConsumer() | Transport for consuming not found');

			return;
		}

		// Create the Consumer in paused mode.
		let consumer;

		try
		{
			consumer = await transport.consume(
				{
					producerId      : producer.id,
					rtpCapabilities : consumerPeer.data.rtpCapabilities,
					paused          : true
				});
		}
		catch (error)
		{
			logger.warn('_createConsumer() | transport.consume():%o', error);

			return;
		}

		// Store the Consumer into the protoo consumerPeer data Object.
		consumerPeer.data.consumers.set(consumer.id, consumer);

		// Set Consumer events.
		consumer.on('transportclose', () =>
		{
			// Remove from its map.
			consumerPeer.data.consumers.delete(consumer.id);
		});

		consumer.on('producerclose', () =>
		{
			// Remove from its map.
			consumerPeer.data.consumers.delete(consumer.id);

			consumerPeer.notify('consumerClosed', { consumerId: consumer.id })
				.catch(() => {});
		});

		consumer.on('producerpause', () =>
		{
			consumerPeer.notify('consumerPaused', { consumerId: consumer.id })
				.catch(() => {});
		});

		consumer.on('producerresume', () =>
		{
			consumerPeer.notify('consumerResumed', { consumerId: consumer.id })
				.catch(() => {});
		});

		consumer.on('score', (score) =>
		{
			// logger.debug(
			// 	'consumer "score" event [consumerId:%s, score:%o]',
			// 	consumer.id, score);

			consumerPeer.notify('consumerScore', { consumerId: consumer.id, score })
				.catch(() => {});
		});

		consumer.on('layerschange', (layers) =>
		{
			consumerPeer.notify(
				'consumerLayersChanged',
				{
					consumerId    : consumer.id,
					spatialLayer  : layers ? layers.spatialLayer : null,
					temporalLayer : layers ? layers.temporalLayer : null
				})
				.catch(() => {});
		});

		// NOTE: For testing.
		// await consumer.enableTraceEvent([ 'rtp', 'keyframe', 'nack', 'pli', 'fir' ]);
		// await consumer.enableTraceEvent([ 'pli', 'fir' ]);
		// await consumer.enableTraceEvent([ 'keyframe' ]);

		consumer.on('trace', (trace) =>
		{
			logger.debug(
				'consumer "trace" event [producerId:%s, trace.type:%s, trace:%o]',
				consumer.id, trace.type, trace);
		});

		// Send a protoo request to the remote Peer with Consumer parameters.
		try
		{
			await consumerPeer.request(
				'newConsumer',
				{
					peerId         : producerPeer.id,
					producerId     : producer.id,
					id             : consumer.id,
					kind           : consumer.kind,
					rtpParameters  : consumer.rtpParameters,
					type           : consumer.type,
					appData        : producer.appData,
					producerPaused : consumer.producerPaused
				});

			// Now that we got the positive response from the remote endpoint, resume
			// the Consumer so the remote endpoint will receive the a first RTP packet
			// of this new stream once its PeerConnection is already ready to process
			// and associate it.
			await consumer.resume();

			consumerPeer.notify(
				'consumerScore',
				{
					consumerId : consumer.id,
					score      : consumer.score
				})
				.catch(() => {});
		}
		catch (error)
		{
			logger.warn('_createConsumer() | failed:%o', error);
		}
	}

// NOTE: Don’t create the Consumer if the remote Peer cannot consume it.

Those lines of code would return directly without any logging, I don’t know any more details about the logic, maybe all the information above can help diagnose this issue and fix it.

That issue does not happen in the online mediasoup-demo, right?

Not too often as visit the v3demo sometimes With poor connection

I used the KITE framework for auto testing the v3demo also found the issue happened

Even I update the code to the latest the issue is not fixed

And when that happens, have you checked if it’s due to lack of RTP? or lack of video keyframe? or decoding issue? or lack of available downlink bandwidth so mediasoup decides to not send RTP and emits num spatial and temporal layers in that video consumer?

Right now I’ve met this issue again at the first try join in a room with self-hosted demo, and this is the server side logging

mediasoup:WARN:Channel [pid:14106] webrtc::FieldTrialParser::ParseFieldTrial() | Failed to read empty key field with value: 'Enabled' in trial: "Enabled,100" +340ms
  mediasoup-demo-server:Room transport "trace" event [transportId:a4f3a985-879e-4ca4-85fe-60026ec40516, trace.type:bwe, trace:{ direction: 'out', info: { availableBitrate: 512000, desiredBitrate: 0, effectiveDesiredBitrate: 0, maxBitrate: 512000, maxPaddingBitrate: 0, minBitrate: 30000, startBitrate: 512000, type: 'transport-cc' }, timestamp: 921418544, type: 'bwe' }] +6ms
  mediasoup:Consumer resume() +6ms
  mediasoup:Channel request() [method:consumer.resume, id:36] +6ms
  mediasoup:Channel request succeeded [method:consumer.resume, id:36] +0ms
  mediasoup-demo-server:Room WebRtcTransport "sctpstatechange" event [sctpState:connecting] +136ms
  mediasoup-demo-server:Room WebRtcTransport "sctpstatechange" event [sctpState:connecting] +45ms
  mediasoup-demo-server:Room WebRtcTransport "sctpstatechange" event [sctpState:connected] +12ms
  mediasoup:WARN:Channel [pid:14106] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:1537644616, payloadType:97] +199ms
  mediasoup:WARN:Channel [pid:14106] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:1537644616, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:14106] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:1537644616, payloadType:97] +0ms
  mediasoup:Consumer resume() +198ms
  mediasoup:Channel request() [method:consumer.resume, id:37] +198ms
  mediasoup-demo-server:Room producer "videoorientationchange" event [producerId:15f06066-354c-4c63-b936-885c81a2efc9, videoOrientation:{ camera: false, flip: false, rotation: 0 }] +11ms
  mediasoup:Channel request succeeded [method:consumer.resume, id:37] +1ms
  mediasoup-demo-server:Room protoo Peer "request" event [method:produceData, peerId:jtn0hlzg] +91ms
  mediasoup:Transport produceData() +299ms
  mediasoup:Channel request() [method:transport.produceData, id:38] +91ms
  mediasoup:Channel request succeeded [method:transport.produceData, id:38] +0ms
  mediasoup:DataProducer constructor() +10s
  mediasoup:Transport consumeData() +1ms
  mediasoup:Channel request() [method:transport.consumeData, id:39] +1ms
  mediasoup:Channel request succeeded [method:transport.consumeData, id:39] +1ms
  mediasoup:DataConsumer constructor() +634ms
  mediasoup-demo-server:Room WebRtcTransport "sctpstatechange" event [sctpState:connected] +25ms
  mediasoup-demo-server:Room protoo Peer "request" event [method:produceData, peerId:jtn0hlzg] +4ms
  mediasoup:Transport produceData() +28ms
  mediasoup:Channel request() [method:transport.produceData, id:40] +28ms
  mediasoup:Channel request succeeded [method:transport.produceData, id:40] +0ms
  mediasoup:DataProducer constructor() +29ms
  mediasoup:Transport consumeData() +1ms
  mediasoup:Channel request() [method:transport.consumeData, id:41] +1ms
  mediasoup:Channel request succeeded [method:transport.consumeData, id:41] +0ms
  mediasoup:DataConsumer constructor() +29ms
  mediasoup:WARN:Channel [pid:14106] webrtc::ProbeController::Process() | kWaitingForProbingResult: timeout +476ms
  mediasoup:WARN:Channel [pid:14106] webrtc::ProbeController::Process() | kWaitingForProbingResult: timeout +347ms
  mediasoup:WARN:Channel [pid:14106] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:1001807043, payloadType:97] +191ms
  mediasoup:WARN:Channel [pid:14106] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:1001807043, payloadType:97] +0ms
  mediasoup:WARN:Channel [pid:14106] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:1001807043, payloadType:97] +28ms
  mediasoup:WARN:Channel [pid:14106] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:1001807043, payloadType:97] +6ms
  mediasoup:WARN:Channel [pid:14106] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:1001807043, payloadType:97] +0ms

the warning log is the hint

mediasoup:WARN:Channel [pid:14106] webrtc::FieldTrialParser::ParseFieldTrial() | Failed to read empty key field with value: 'Enabled' in trial: "Enabled,100" +340ms

I’ll check the C++ source code for some extra information, may it helps

I modfied C++ source code adding verbose logging for extra information, and find that SCTP connection
complete too slow

  mediasoup-demo-server:Room WebRtcTransport "sctpstatechange" event [sctpState:connecting] +16ms
  mediasoup-demo-server:Room protoo Peer "request" event [method:produceData, peerId:vebcv78a] +12ms
  mediasoup:Transport produceData() +27ms
  mediasoup:Channel request() [method:transport.produceData, id:40] +26ms
  mediasoup:Channel request succeeded [method:transport.produceData, id:40] +1ms
  mediasoup:DataProducer constructor() +28ms
  mediasoup:Transport consumeData() +1ms
  mediasoup:Channel request() [method:transport.consumeData, id:41] +0ms
  mediasoup:Channel request succeeded [method:transport.consumeData, id:41] +1ms
  mediasoup:DataConsumer constructor() +28ms
  mediasoup:WARN:Channel [pid:31139] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2950418613, payloadType:97] +285ms
  mediasoup:WARN:Channel [pid:31139] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2950418613, payloadType:97] +1ms
  mediasoup:WARN:Channel [pid:31139] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2950418613, payloadType:97] +0ms
  mediasoup-demo-server:Room WebRtcTransport "sctpstatechange" event [sctpState:connected] +17ms

And another information is this RTP packet’s ssrc is changed!

  mediasoup:WARN:Channel [pid:31139] RTC::RtpListener::AddProducer() | encoding ssrc [ssrc:2573681749] +0ms
  mediasoup:WARN:Channel [pid:31139] RTC::RtpListener::AddProducer() | mid [mid:0] +1ms
  mediasoup:Channel request succeeded [method:transport.produce, id:15] +1ms
  mediasoup:Producer constructor() +0ms
  mediasoup:RtpObserver addProducer() +275ms
  mediasoup:Channel request() [method:rtpObserver.addProducer, id:16] +1ms
  mediasoup:Channel request succeeded [method:rtpObserver.addProducer, id:16] +0ms
  mediasoup-demo-server:Room protoo Peer "request" event [method:produce, peerId:6kugobud] +672ms
  mediasoup:Transport produce() +672ms
  mediasoup:Channel request() [method:transport.produce, id:17] +668ms
  mediasoup:WARN:Channel [pid:31139] RTC::RtpListener::AddProducer() | mid [mid:1] +671ms
  mediasoup:WARN:Channel [pid:31139] RTC::RtpListener::AddProducer() | rid [rid:r0] +1ms
  mediasoup:WARN:Channel [pid:31139] RTC::RtpListener::AddProducer() | rid [rid:r1] +0ms
  mediasoup:WARN:Channel [pid:31139] RTC::RtpListener::AddProducer() | rid [rid:r2] +0ms

...

  mediasoup:WARN:Channel [pid:31139] RTC::RtpListener::AddProducer() | encoding ssrc [ssrc:863474370] +208ms
  mediasoup:WARN:Channel [pid:31139] RTC::RtpListener::AddProducer() | mid [mid:0] +0ms
  mediasoup:Channel request succeeded [method:transport.produce, id:30] +1ms
  mediasoup:Producer constructor() +1s
  mediasoup:Transport consume() +2ms
  mediasoup:Channel request() [method:transport.consume, id:31] +0ms
  mediasoup:RtpObserver addProducer() +2s
  mediasoup:Channel request() [method:rtpObserver.addProducer, id:32] +1ms
  mediasoup:Channel request succeeded [method:transport.consume, id:31] +0ms
  mediasoup:Consumer constructor() +111ms
  mediasoup:Channel request succeeded [method:rtpObserver.addProducer, id:32] +1ms
  mediasoup-demo-server:Room protoo Peer "request" event [method:produce, peerId:vebcv78a] +161ms
  mediasoup:Transport produce() +160ms
  mediasoup:Channel request() [method:transport.produce, id:33] +158ms
  mediasoup:WARN:Channel [pid:31139] RTC::RtpListener::AddProducer() | mid [mid:1] +162ms
  mediasoup:WARN:Channel [pid:31139] RTC::RtpListener::AddProducer() | rid [rid:r0] +0ms
  mediasoup:WARN:Channel [pid:31139] RTC::RtpListener::AddProducer() | rid [rid:r1] +0ms
  mediasoup:WARN:Channel [pid:31139] RTC::RtpListener::AddProducer() | rid [rid:r2] +0ms

...

  mediasoup:WARN:Channel [pid:31139] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2950418613, payloadType:97] +285ms
  mediasoup:WARN:Channel [pid:31139] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2950418613, payloadType:97] +1ms
  mediasoup:WARN:Channel [pid:31139] RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:2950418613, payloadType:97] +0ms

The first one is 2573681749 and second one is 863474370 but last one is 2950418613 in warning log

This is screenshot first one:

The second one:

@universeroc with all respects, this is the Leeryver Symptom (in Spanish “Leer-y-ver”, in English: “Read-and-see”):

“I never check the logs when things go ok so, when things are not ok I check the logs for first time and assume that the first warning/error log is the cause of the problem.”

All the logs you have pasted above also happen when video works. So instead of looking at random logs and suspecting from them, please try to focus on the questions I did (you did not check any of them in your last two comments):

And when that happens, have you checked if it’s due to lack of RTP? or lack of video keyframe? or decoding issue? or lack of available downlink bandwidth so mediasoup decides to not send RTP and emits num spatial and temporal layers in that video consumer?

The mediasoup-demo app comes with a interactive terminal in server side. Run the demo server with:

$ MEDIASOUP_LISTEN_IP=YOUR_BINDING_IP INTERACTIVE=true DEBUG="*WARN* *ERROR*" ./server.js

then get the video Consumer id of the failing video (you can see it over the peer view in the web app), goto the server interactive console, run terminal, then type dumpConsumer ID and statsConsumer ID and paste the output.

Also try clicking into Request keyframe in the failing received video to see if that fixes the issue and video comes in.

OK, I’ll do it, later reply you

consumer.getStats():
[
  {
    "bitrate": 0,
    "byteCount": 0,
    "firCount": 0,
    "fractionLost": 0,
    "kind": "video",
    "mimeType": "video/VP8",
    "nackCount": 0,
    "nackPacketCount": 0,
    "packetCount": 0,
    "packetsDiscarded": 0,
    "packetsLost": 0,
    "packetsRepaired": 0,
    "packetsRetransmitted": 0,
    "pliCount": 0,
    "rtxSsrc": 269986030,
    "score": 10,
    "ssrc": 652440482,
    "timestamp": 944588885,
    "type": "outbound-rtp"
  }
]

And

consumer.dump():
{
  "consumableRtpEncodings": [
    {
      "ksvc": false,
      "scalabilityMode": "S1T3",
      "spatialLayers": 1,
      "ssrc": 169594914,
      "temporalLayers": 3
    },
    {
      "ksvc": false,
      "scalabilityMode": "S1T3",
      "spatialLayers": 1,
      "ssrc": 169594915,
      "temporalLayers": 3
    },
    {
      "ksvc": false,
      "scalabilityMode": "S1T3",
      "spatialLayers": 1,
      "ssrc": 169594916,
      "temporalLayers": 3
    }
  ],
  "currentSpatialLayer": -1,
  "currentTemporalLayer": -1,
  "id": "24039038-247a-4228-9b63-1618720b0802",
  "kind": "video",
  "paused": false,
  "preferredSpatialLayer": 2,
  "preferredTemporalLayer": 2,
  "priority": 1,
  "producerId": "4ef683eb-7a89-4cb0-8667-fdf3810018db",
  "producerPaused": false,
  "rtpParameters": {
    "codecs": [
      {
        "clockRate": 90000,
        "mimeType": "video/VP8",
        "parameters": {},
        "payloadType": 101,
        "rtcpFeedback": [
          {
            "type": "transport-cc"
          },
          {
            "parameter": "fir",
            "type": "ccm"
          },
          {
            "type": "nack"
          },
          {
            "parameter": "pli",
            "type": "nack"
          }
        ]
      },
      {
        "clockRate": 90000,
        "mimeType": "video/rtx",
        "parameters": {
          "apt": 101
        },
        "payloadType": 102,
        "rtcpFeedback": []
      }
    ],
    "encodings": [
      {
        "codecPayloadType": 101,
        "ksvc": false,
        "rtx": {
          "ssrc": 269986030
        },
        "scalabilityMode": "S3T3",
        "spatialLayers": 3,
        "ssrc": 652440482,
        "temporalLayers": 3
      }
    ],
    "headerExtensions": [
      {
        "encrypt": false,
        "id": 1,
        "parameters": {},
        "uri": "urn:ietf:params:rtp-hdrext:sdes:mid"
      },
      {
        "encrypt": false,
        "id": 4,
        "parameters": {},
        "uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"
      },
      {
        "encrypt": false,
        "id": 5,
        "parameters": {},
        "uri": "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"
      },
      {
        "encrypt": false,
        "id": 6,
        "parameters": {},
        "uri": "http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07"
      },
      {
        "encrypt": false,
        "id": 11,
        "parameters": {},
        "uri": "urn:3gpp:video-orientation"
      },
      {
        "encrypt": false,
        "id": 12,
        "parameters": {},
        "uri": "urn:ietf:params:rtp-hdrext:toffset"
      }
    ],
    "mid": "3",
    "rtcp": {
      "cname": "AHqskOEnuKD/Q6zz",
      "reducedSize": true
    }
  },
  "rtpStream": {
    "params": {
      "clockRate": 90000,
      "cname": "AHqskOEnuKD/Q6zz",
      "mimeType": "video/VP8",
      "payloadType": 101,
      "rtxPayloadType": 102,
      "rtxSsrc": 269986030,
      "spatialLayers": 3,
      "ssrc": 652440482,
      "temporalLayers": 3,
      "useDtx": false,
      "useFir": true,
      "useInBandFec": false,
      "useNack": true,
      "usePli": true
    },
    "rtxStream": {
      "params": {
        "clockRate": 90000,
        "cname": "AHqskOEnuKD/Q6zz",
        "mimeType": "video/rtx",
        "payloadType": 102,
        "ssrc": 269986030
      }
    },
    "score": 10
  },
  "supportedCodecPayloadTypes": [
    101
  ],
  "targetSpatialLayer": -1,
  "targetTemporalLayer": -1,
  "traceEventTypes": "",
  "type": "simulcast"
}

Well, I think I should explain how simulcast and bandwidth estimation works. We don’t send everything to remote endpoints. If videos use simulcast/SVC we just send the layers that fit into the downlink bandwidth that mediasoup has currently estimated for that endpoint (which changes dynamically). And this includes the possibility of not sending any layer of a specific video because there is no bandwidth for it.

  • How many simulcast videos are you consuming at the same time? or in other words, how many peers with webcam enabled are there already in the meet?
  • Which spatial/temporal layers are other working videos being receiving while others fail?
  • Does the “Request keyframe” button work for failing videos? (I asked this before).

Sorry to bother you again, but I’m new to mediasoup and don’t know the direction of the issue so I tried to give you more information what I thought useful for you.

for your question:

  1. In general 8, sometimes 16
  2. Anyone is OK
  3. NO, I’ve been tried

There is an initialAvailableOutgoingBitrate in WebRtcTransportOptions to mitigate that. Everything is documented. I’m afraid that the demo app cannot just be taken as the “mediasoup reference app”. It’s not ready for all scenarios.

I know and I read some posts about the demo.
Right now I’m doing some tests on the demo for example how many streams it can hold on a 4Core server.

This issue prevents me to continue, mediasoup is a great project as using C++ and JavaScript both I love and code has high quality but its API is too low to start quickly as it’s only a library.

Your demo is amazing to launch and to experience the mediasoup, more examples would be welcome. I’d like to contribute to this project after I master the basic usage.

I’ll try something else to solve this issue, it’ll be solved saving more time under your help.

Thank you for your patient and your reply :slight_smile:

Here’s my config.js about the initialAvailableOutgoingBitrate

    // initialAvailableOutgoingBitrate : 1000000,
    initialAvailableOutgoingBitrate : 512000,
    // minimumAvailableOutgoingBitrate : 600000,
    minimumAvailableOutgoingBitrate : 128000,
    maxSctpMessageSize              : 262144,
    // Additional options that are not part of WebRtcTransportOptions.
    // maxIncomingBitrate              : 1500000
    maxIncomingBitrate              : 512000

The thing is: you assume there is an issue. I said that there may not be any issue. Please try using a higher initialAvailableOutgoingBitrate, use something like 20000000 (20 mbps) just to confirm that everything is about BWE.

You’re right, it’s not an issue before it’s confirmed.

This morning I checked the client log and found the transport diconnected after connecting, dived into mediasoup-client code and saw the event source is from ICE.

Doing another experiment and found that UDP port is not work, the final source is the network policy. I changed the MEDIASOUP_MIN_PORT, MEDIASOUP_MAX_PORT to be in the valid range then everything is OK. :smiley:

Thank you @ibc and sorry for wasting your time and attention.

BTW: all your advice I’ve taken and modified.

1 Like

Glad to hear that! BTW you didn’t waste my time at all. It’s always nice to have people doing tests and learning. Now I encourage you to go deeper into the API and docs so you don’t depend on the demo code.

5 Likes

Yes, I’m doing it

Do you have any new progress about this log?
I met the same problem.

[Another user joins the room without seeing each other’s videos]