ethand91 / mediasoup-ios-client-sample

Sample iOS mediasoup client sample
38 stars 13 forks source link

The Demo collapse - Failed to set remote offer sdp: Duplicate a=mid value '1'. #11

Closed Elsonfeng closed 4 years ago

Elsonfeng commented 4 years ago

### Part of the log: RecvTransport::onConnect handleLocalTransportConnectEvent() id =8d392763-690a-4573-8fd5-c758a4f429eb websocketDisReceiveMessage {"action":"connectWebRtcTransport"} Unknown event connectWebRtcTransport RecvTransport::onConnectionStateChange newState = checking RecvTransport::onConnectionStateChange newState = connected RecvTransport::onConnectionStateChange newState = completed RecvTransport::onConnectionStateChange newState = disconnected websocketDisReceiveMessage {"action":"score","userId":1,"consumerId":{"producerScore":10,"score":10}} Unknown event score RecvTransport::onConnectionStateChange newState = checking RecvTransport::onConnectionStateChange newState = connected RecvTransport::onConnectionStateChange newState = completed consumeTrack() consuming id =dc8b946a-ab94-4dda-bfcb-3913bdda7119 RoomListener::onNewConsumer kind=video websocketDisReceiveMessage {"action":"resumeConsumer"} Unknown event resumeConsumer websocketDisReceiveMessage {"action":"newconsumer","consumerData":{"consumerUserId":1,"producerUserId":2,"producerId":"d9b90c29-4ac1-4051-af00-cfa212710486","id":"03713c5c-703c-4ae7-baa4-a21b42ba944d","kind":"audio","rtpParameters":{"codecs":[{"mimeType":"audio/opus","payloadType":100,"clockRate":48000,"channels":2,"parameters":{"useinbandfec":1,"minptime":10},"rtcpFeedback":[]}],"headerExtensions":[{"uri":"urn:ietf:params:rtp-hdrext:sdes:mid","id":1,"encrypt":false,"parameters":{}},{"uri":"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time","id":4,"encrypt":false,"parameters":{}},{"uri":"urn:ietf:params:rtp-hdrext:ssrc-audio-level","id":10,"encrypt":false,"parameters":{}}],"encodings":[{"ssrc":309019743}],"rtcp":{"cname":"b318841a","reducedSize":true,"mux":true},"mid":"1"},"type":"simple","producerPaused":false}} NEW_CONSUMER data={ "consumerData" : { "rtpParameters" : { "encodings" : [ { "ssrc" : 309019743 } ], "rtcp" : { "mux" : true, "cname" : "b318841a", "reducedSize" : true }, "mid" : "1", "headerExtensions" : [ { "encrypt" : false, "parameters" : {

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

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

      },
      "id" : 10,
      "uri" : "urn:ietf:params:rtp-hdrext:ssrc-audio-level"
    }
  ],
  "codecs" : [
    {
      "clockRate" : 48000,
      "channels" : 2,
      "mimeType" : "audio\/opus",
      "payloadType" : 100,
      "rtcpFeedback" : [

      ],
      "parameters" : {
        "useinbandfec" : 1,
        "minptime" : 10
      }
    }
  ]
},
"type" : "simple",
"id" : "03713c5c-703c-4ae7-baa4-a21b42ba944d",
"kind" : "audio",
"producerUserId" : 2,
"consumerUserId" : 1,
"producerPaused" : false,
"producerId" : "d9b90c29-4ac1-4051-af00-cfa212710486"

}, "action" : "newconsumer" } handleNewConsumerEvent info = { "rtpParameters" : { "encodings" : [ { "ssrc" : 309019743 } ], "rtcp" : { "mux" : true, "cname" : "b318841a", "reducedSize" : true }, "mid" : "1", "headerExtensions" : [ { "encrypt" : false, "parameters" : {

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

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

    },
    "id" : 10,
    "uri" : "urn:ietf:params:rtp-hdrext:ssrc-audio-level"
  }
],
"codecs" : [
  {
    "clockRate" : 48000,
    "channels" : 2,
    "mimeType" : "audio\/opus",
    "payloadType" : 100,
    "rtcpFeedback" : [

    ],
    "parameters" : {
      "useinbandfec" : 1,
      "minptime" : 10
    }
  }
]

}, "type" : "simple", "id" : "03713c5c-703c-4ae7-baa4-a21b42ba944d", "kind" : "audio", "producerUserId" : 2, "consumerUserId" : 1, "producerPaused" : false, "producerId" : "d9b90c29-4ac1-4051-af00-cfa212710486" } consumeTrack() rtpParameters { "encodings" : [ { "ssrc" : 309019743 } ], "rtcp" : { "mux" : true, "cname" : "b318841a", "reducedSize" : true }, "mid" : "1", "headerExtensions" : [ { "encrypt" : false, "parameters" : {

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

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

  },
  "id" : 10,
  "uri" : "urn:ietf:params:rtp-hdrext:ssrc-audio-level"
}

], "codecs" : [ { "clockRate" : 48000, "channels" : 2, "mimeType" : "audio\/opus", "payloadType" : 100, "rtcpFeedback" : [

  ],
  "parameters" : {
    "useinbandfec" : 1,
    "minptime" : 10
  }
}

] } websocketDisReceiveMessage {"action":"score","userId":1,"consumerId":{"producerScore":10,"score":10}} Unknown event score [WARN] PeerConnection::OnFailure() | webtc::SetSessionDescriptionObserver failure [INVALID_PARAMETER:Failed to set remote offer sdp: Duplicate a=mid value '1'.] [ERROR] transport_wrapper::+[TransportWrapper nativeConsume:listener:id:producerId:kind:rtpParameters:appData:]() | Failed to set remote offer sdp: Duplicate a=mid value '1'. 2020-07-09 19:01:00.271754+0800 mediasoup-ios-cient-sample[2952:822544] Terminating app due to uncaught exception 'RuntimeException', reason: 'Failed to set remote offer sdp: Duplicate a=mid value '1'.' First throw call stack: (0x1c0357180 0x1bf52f9f8 0x100c306ac 0x100c1f6d8 0x101d74c78 0x101d835e8 0x101d74c78 0x101d826fc 0x1c02e8b20 0x1c02e3a58 0x1c02e2fb4 0x1c24e479c 0x1ec98ac38 0x100030584 0x1bfda68e0) libc++abi.dylib: terminating with uncaught exception of type NSException

Elsonfeng commented 4 years ago

Two iOS devices will flash back, one iOS and one Android device will be able to work, and android will be able to communicate with Android. How can I solve this problem?

DenisDemyanko commented 3 years ago

Hi @Elsonfeng, have you solved this problem? Could you please share an example of a solution.