Error: MID already exists in RTP listener

(node:6725) UnhandledPromiseRejectionWarning: Error: MID already exists in RTP listener [mid:0]
    at Channel._processMessage (/home/sinapsis/sfu/node_modules/mediasoup/lib/Channel.js:206:37)
    at Socket.Channel._consumerSocket.on (/home/sinapsis/sfu/node_modules/mediasoup/lib/Channel.js:68:34)
    at Socket.emit (events.js:197:13)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:269:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:145:17)

Hola. Tengo este error y no consigo saber la razón que lo produce. Podrían ayudarme por favor

In English, please :slight_smile:

So you are calling twice transport.produce() in server side with same parameters (for instance, with same audio parameters).

To connect multiple peers, only a transport to send and a transport to receive is needed on the server side? Can each transport have only one producer or one consumer for audio and one for video?

This is explained in the doc:

From what I can understand, I must validate if any of the peers have already created both the shipping and receiving transport and the producer and the consumer respectively, is that correct?

Why “just a consumer”?

I strongly recommend you read the documentation in deep. I cannot explain everything here from scratch, sorry.

Ok, sorry, I didn’t know how to explain. One consumer per kind. Audio, Video and sharescreen. I have reviewed the documentation but I am trying to understand the architecture, so I decided to ask about the error and know if I am understanding correctly.

One consumer per kind? May I know where do you read that?

Please, read this and this:

Sorry. I understood that from your answer.

I already solved the error !!!. What happens is that a peer was running the same producer more than twice for some reason. I did a validation so it would only run once and it works.