ethand91 / mediasoup-ios-client

Mediasoup 3 iOS Client
ISC License
130 stars 64 forks source link

Failed to set local answer sdp: Failed to process the bundled m= section. #87

Closed LucasDang closed 3 years ago

LucasDang commented 3 years ago

またお邪魔して申し訳ありません

Encountered a very strange problem,

When I receive consumers and handle them in a serial Dispatch Queue, the following sequence will crash with message Failed to set local answer sdp: Failed to process the bundled m= section. 1.peerA.audio——peerA.video——peerB.audio 2.peerA.audio——peerA.video——peerB.audio——peerB.video

But following sequence is OK. 3.peerA.audio——peerB.audio 4.peerA.audio——peerA.video——peerB.video——peerB.audio

Can you tell me where the problem is?

Thanks anyway!

LucasDang commented 3 years ago

Found the reason, I send response to server is too early.

qaz1991815 commented 3 years ago

I also met the same problem. How did you solve it?

LucasDang commented 3 years ago

I also met the same problem. How did you solve it?

When you receive newConsumer request, you need create local consumer first, and then send response to server.

qaz1991815 commented 3 years ago

目前流程就是按照这个逻辑的,1对1通话没问题,但是如果3人或者以上还是会有这个问题。

LucasDang commented 3 years ago

目前流程就是按照这个逻辑的,1对1通话没问题,但是如果3人或者以上还是会有这个问题。

你确定你是在一个队列中同步操作的么?你得创建完成consumer之后在发送response给服务端。

qaz1991815 commented 3 years ago

没有使用队列,不过从打印信息来看,是创建完成后,通过resumeConsumer恢复音视频的。你能分享你的代码片段吗,这个问题困扰我好久了,非常感谢!

截屏2021-02-22 下午6 26 09 截屏2021-02-22 下午6 34 40 截屏2021-02-22 下午6 34 58
LucasDang commented 3 years ago

没有使用队列,不过从打印信息来看,是创建完成后,通过resumeConsumer恢复音视频的。你能分享你的代码片段吗,这个问题困扰我好久了,非常感谢!

截屏2021-02-22 下午6 26 09 截屏2021-02-22 下午6 34 40 截屏2021-02-22 下午6 34 58

不是手动的resumeConsumer,你在接收到websocketrequest,是否返回了response074E4C15-F1C7-49FA-966F-106E39993EB3 我这里接收到newConsumer,通过transport创建完成之后,使用闭包回调去发送response的信令

qaz1991815 commented 3 years ago

没有返回response,这个response信令内容是啥?有格式要求吗?

LucasDang commented 3 years ago

没有返回response,这个response信令内容是啥?有格式要求吗?

每个人 写法 不一样,我这里是通过回给服务端response,服务端对此consumer进行resume 。 这个你可能需要和你服务端联调一下。 https://mediasoup.discourse.group/t/create-server-side-consumers-with-paused-true/244 要做的就是接收到第二个audioConsumer的时候必须要在本地创建完成相应的consumer之后,才能开启音频数据的传输。

qaz1991815 commented 3 years ago

好的,非常感谢