Error "Failed to set remote offer sdp: Duplicate a=mid value '2'"

It happen whem i’m trying to receive 2 and more consumers!
"
Receive: message
SocketNotificationResponse(method: EBSWebRTCiOS.Methods.newConsumer, payload: Optional({
“kind” : “audio”,
“appData” : {
“peerId” : “5e900aad9373cc2d9546806d”,
“source” : “mic”
},
“type” : “simple”,
“peerId” : “5e900aad9373cc2d9546806d”,
“id” : “a8c5c217-f7d4-4896-8732-97617679c52b”,
“producerPaused” : false,
“producerId” : “2daec80e-721e-4113-97e6-79084fce3a11”,
“rtpParameters” : {
“codecs” : [
{
“channels” : 2,
“payloadType” : 100,
“rtcpFeedback” : [

    ],
    "mimeType" : "audio\/opus",
    "parameters" : {
      "sprop-stereo" : 1,
      "usedtx" : 1,
      "useinbandfec" : 1,
      "minptime" : 10
    },
    "clockRate" : 48000
  }
],
"headerExtensions" : [
  {
    "parameters" : {

    },
    "encrypt" : false,
    "uri" : "urn:ietf:params:rtp-hdrext:sdes:mid",
    "id" : 1
  },
  {
    "id" : 4,
    "parameters" : {

    },
    "encrypt" : false,
    "uri" : "http:\/\/www.webrtc.org\/experiments\/rtp-hdrext\/abs-send-time"
  },
  {
    "parameters" : {

    },
    "encrypt" : false,
    "uri" : "urn:ietf:params:rtp-hdrext:ssrc-audio-level",
    "id" : 10
  }
],
"encodings" : [
  {
    "ssrc" : 608869349
  }
],
"rtcp" : {
  "reducedSize" : true,
  "mux" : true,
  "cname" : "iaBbtBsUsI5\/yaN\/"
},
"mid" : "2"

}
}))
consumeTrack(consumerInfo:)
Optional("{\n “peerId” : “5e900aad9373cc2d9546806d”,\n “source” : “mic”\n}")
2020-06-01 13:22:11.186960+0300 EBSWebRTCiOS_Example[371:42689] *** Terminating app due to uncaught exception ‘RuntimeException’, reason: ‘Failed to set remote offer sdp: Duplicate a=mid value ‘2’.’"

You are calling transport.consume() in mediasoup-client twice with same mid in RtpParameters. Check your code to know why. Looks like you are consuming the same Producer twice.

Which mediasoup library are you using?

I use this lib

“EBSWebRTCiOS.Methods.newConsumer, payload: Optional” this is my debug string of response on signal server event newConsumer

Yes the producerId is different and it isn’t call ‘transport.consume()’ twice

Please open an issue in the mediasoup-ios-client project.

Please report the issue in that library. It’s an external library and we don’t maintain it.

ok, Butt it recommended by official mediasoup site

Let me know where exactly, please.

Issue is probably because the version of libmediasoupclient being used is old.

As stated in the github issue, this should be resolved by updating the inner libmediasoupclient library.

Let me know where exactly, please.

I think his mistaking the info on the below page.

2 Likes