Xamarin.AzureCommunicationCalling icon indicating copy to clipboard operation
Xamarin.AzureCommunicationCalling copied to clipboard

Re-Joining same meeting issue.

Open BK-83 opened this issue 6 months ago • 37 comments

Hii

I am using the latest stable version for MAUI-iOS app and am having problem in rejoining the same meeting.

Image

It seems that upon rejoining the process cannot proceed beyond the initial state and it does not even throw any error.

Can anyone help me on this. @tompi

Do you guys have any plans to release a new version for the MAUI-iOS platform? Please let me know,

Thank you.

BK-83 avatar May 20 '25 05:05 BK-83

Hey, was just trying to update this the other day, but never managed to test it...(issues with our apple developer account...). If you have a minute you could check the attached version? (totally untested though...)

Laerdal.Maui.AzureCommunicationCalling.iOS.2.16.0-beta.1.0.nupkg.zip

tompi avatar May 21 '25 10:05 tompi

Hi @tompi

I tried with adding nuget locally but it doesn't compile to load the reference files. And the error occurs which is mentioned as follows.

Image

BK-83 avatar May 22 '25 06:05 BK-83

Hii @tompi

Can you please share the update on this, I really need to update this as soon as possible.

Thank you.

BK-83 avatar May 27 '25 09:05 BK-83

Working on it right now... Sorry about the delay, these binding libraries are not super fun and easy to work with...

tompi avatar May 27 '25 11:05 tompi

Okay, @tompi Thank you very much

BK-83 avatar May 27 '25 12:05 BK-83

Hey, sorry to report im still stuck after spending a day on this...

Currently able to bind(using sharpie) and compile the nuget, but it crashes runtime when using it on:

Termination Reason: DYLD 4 Symbol missing
Symbol not found: _OBJC_CLASS_$_ACSAcceptTeamsCallOptions
Referenced from: <3FE8939B-EA46-32A2-9733-A18EE47F510F> /Volumes/VOLUME/*/TCPRLink.app/TCPRLink
Expected in:     <A9446873-736B-363B-A280-60BBEF275416> /Volumes/VOLUME/*/TCPRLink.app/Frameworks/AzureCommunicationCalling.framework/AzureCommunicationCalling

Tomorrow is not a working day here, but will make another attempt on friday

tompi avatar May 28 '25 15:05 tompi

Hii @tompi

Did you get any update?

BK-83 avatar Jun 03 '25 09:06 BK-83

Believe it or not, I think I JUST managed to update to latest beta...

Could you test if attached nuget works for you as well?

(I disabled everything AOT/trimming related while testing, not sure its trim/aot safe, try with this in csproj if it fails during linking:

        <RunAOTCompilation>False</RunAOTCompilation>
        <EnableAOTCompilation>False</EnableAOTCompilation>
        <AotAssemblies>False</AotAssemblies>
        <TrimMode>partial</TrimMode>

Laerdal.Maui.AzureCommunicationCalling.iOS.2.16.0-beta.1.25.zip

tompi avatar Jun 03 '25 11:06 tompi

There were some minor backwards breakage i think(so they probably should have upped the major...

_callAgent.JoinWithMeetingLocator(locator and options);

became

_callAgent.JoinWithMeetingLocatorWithOptions(locator and options);

tompi avatar Jun 03 '25 12:06 tompi

OK, @tompi

Thanks for updating, I'll try with the above attached version and let you know is it working or not.

BK-83 avatar Jun 03 '25 12:06 BK-83

Hello @tompi

I checked feature with below mentioned versions.

  1. Laerdal.Maui.AzureCommunicationCalling.iOS 2.16.0-beta.1.25 => Which you provided to check locally.

  2. Laerdal.Maui.AzureCommunicationCalling.iOS 2.16.0-beta.1.31 => that you guys released in the nugget source.

The issue I faced is app crashing every time when trying to rejoin the ACS meeting.

Steps that I followed:

  1. Started ACS meeting from Android version.
  2. Joined the same meeting from the iOS app.
  3. Hung up the call from iOS app.
  4. Tried to rejoin the same meeting from the iOS app.

After the fourth point, the application crashes immediately and does not show any errors. I think it happens from the initialization state of ACS service. Everything goes well on the first try.

In versions lower than "2.16.0-beta.1.25", the reconnection process does not work but it does not crash the app on iOS.

Could you please take a look at it?

BK-83 avatar Jun 11 '25 10:06 BK-83

Hey. This sounds a bit strange.

Did you try to kill the app, can you join the same meeting then? If so its probably some resource you Are not cleaning up?

Might also be an acs bug, but seems unlikely...

If disposing all acs resources does not help, Could you get the iOS crash log?(xcode->devices->your phone->logs)

tompi avatar Jun 11 '25 21:06 tompi

Hello @tompi

This issue is occurring on a second attempt to join the same meeting in a running application. Killing app and join again, it's working like joining the meeting 1st time which all works fine.

I checked scenario and found that the process was crashing when invoking the method shown below on the second attempt.

"_callClient.CreateCallAgentWithOptions(credentials, aCSCallAgentOptions, OnCallAgenttCreated);"

Please let me know if anything more required from my side.

Thank you.

BK-83 avatar Jun 18 '25 07:06 BK-83

I think it would be useful to get the crash logs from iOS like i described, you will usually get some indications there on what goes wrong.

You didnt get a stack trace from dotnet on the crash?

tompi avatar Jun 18 '25 07:06 tompi

And hmm, you might already have a callAgent maybe? Could you not just re-use that on second join?

tompi avatar Jun 18 '25 07:06 tompi

And hmm, you might already have a callAgent maybe? Could you not just re-use that on second join?

Yes, but on hang up I reset all the objects so it setup again whenever user trying to join the meeting.

BK-83 avatar Jun 18 '25 08:06 BK-83

What do you mean "reset"? Disposing?

Might be a bug in the dispose function of the callagent? Is it working if you keep the callagent and use the same on re-join?

tompi avatar Jun 18 '25 08:06 tompi

What do you mean "reset"? Disposing?

Yes Disposing the objects.

BK-83 avatar Jun 18 '25 08:06 BK-83

OK, could you post the iOS crash log?

And possibly test with reusing the call-agent?

tompi avatar Jun 18 '25 09:06 tompi

And possibly test with reusing the call-agent?

Hey @tompi

I try with reusing the Call-agent but the result is still same. Here the crash log what I found from Mac.

HealthTeamsConnect-2025-06-18-114125.txt

BK-83 avatar Jun 18 '25 12:06 BK-83

Thnx, you are on an ipad 5 from 2017 with ios 15? I guess that should not matter, even though it is old...

"Segmentation fault: 11" seems to indicate a pointer to released mem... Really not sure what is happening, but I suspect its related to missing cleanup...

Are you de-attaching all event handlers before you dispose? (i think lingering eventhandlers pointing to disposed objects MIGHT trigger seg-fault...)

tompi avatar Jun 18 '25 13:06 tompi

For full transparency, I get these warnings when binding ACS on ios, which MIGHT be related, but not sure how to get rid of them..

  Laerdal.Maui.AzureCommunicationCalling.iOS succeeded with 65 warning(s) (5.6s) → bin/Release/net8.0-ios/Laerdal.Maui.AzureCommunicationCalling.iOS.dll
    /Users/tompi/src/Xamarin.AzureCommunicationCalling/Bindings/Laerdal.Maui.AzureCommunicationCalling.iOS/obj/Release/net8.0-ios/iOS/Laerdal.Maui.AzureCommunicationCalling.iOS/ACSRawAudioBuffer.g.cs(157,23): warning CS0108: 'ACSRawAudioBuffer.Dispose()' hides inherited member 'NSObject.Dispose()'. Use the new keyword if hiding was intended.
    /Users/tompi/src/Xamarin.AzureCommunicationCalling/Bindings/Laerdal.Maui.AzureCommunicationCalling.iOS/obj/Release/net8.0-ios/iOS/Laerdal.Maui.AzureCommunicationCalling.iOS/ACSCommonCall.g.cs(143,23): warning CS0108: 'ACSCommonCall.Dispose()' hides inherited member 'NSObject.Dispose()'. Use the new keyword if hiding was intended.
    /Users/tompi/src/Xamarin.AzureCommunicationCalling/Bindings/Laerdal.Maui.AzureCommunicationCalling.iOS/obj/Release/net8.0-ios/iOS/Laerdal.Maui.AzureCommunicationCalling.iOS/ACSVideoStreamRenderer.g.cs(192,23): warning CS0108: 'ACSVideoStreamRenderer.Dispose()' hides inherited member 'NSObject.Dispose()'. Use the new keyword if hiding was intended.
    /Users/tompi/src/Xamarin.AzureCommunicationCalling/Bindings/Laerdal.Maui.AzureCommunicationCalling.iOS/obj/Release/net8.0-ios/iOS/Laerdal.Maui.AzureCommunicationCalling.iOS/ACSCommonCallAgent.g.cs(143,23): warning CS0108: 'ACSCommonCallAgent.Dispose()' hides inherited member 'NSObject.Dispose()'. Use the new keyword if hiding was intended.
    /Users/tompi/src/Xamarin.AzureCommunicationCalling/Bindings/Laerdal.Maui.AzureCommunicationCalling.iOS/obj/Release/net8.0-ios/iOS/Laerdal.Maui.AzureCommunicationCalling.iOS/ACSVideoStreamRendererView.g.cs(154,23): warning CS0108: 'ACSVideoStreamRendererView.Dispose()' hides inherited member 'NSObject.Dispose()'. Use the new keyword if hiding was intended.
    /Users/tompi/src/Xamarin.AzureCommunicationCalling/Bindings/Laerdal.Maui.AzureCommunicationCalling.iOS/obj/Release/net8.0-ios/iOS/Laerdal.Maui.AzureCommunicationCalling.iOS/ACSCallClient.g.cs(232,23): warning CS0108: 'ACSCallClient.Dispose()' hides inherited member 'NSObject.Dispose()'. Use the new keyword if hiding was intended.
    /Users/tompi/src/Xamarin.AzureCommunicationCalling/Bindings/Laerdal.Maui.AzureCommunicationCalling.iOS/obj/Release/net8.0-ios/iOS/Laerdal.Maui.AzureCommunicationCalling.iOS/ACSRawVideoFrame.g.cs(143,23): warning CS0108: 'ACSRawVideoFrame.Dispose()' hides inherited member 'NSObject.Dispose()'. Use the new keyword if hiding was intended.

Does it work if you dont dispose anything(not callAgent, and not callClient?)

tompi avatar Jun 18 '25 13:06 tompi

Hey @tompi If I doesn't dispose the objects manually, on 2nd attempt it throws an error like "Initialization of SDK failed".

Image

BK-83 avatar Jun 19 '25 07:06 BK-83

What we do is we tear down EVERYTHING between calls... So I actually generate a new ACS token each time.

Could this be a workaround for you? (I realize its not optimal, but if it works...)

tompi avatar Jun 19 '25 07:06 tompi

Okay, I'll check and let you know how it responds.

BK-83 avatar Jun 19 '25 07:06 BK-83

Hii @tompi

I couldn't generate a new ACS token every time because we kept that view at the server level.

I try with following scenarios but still result won't change.

  1. Not disposing all the ACS objects on "Hang Up".
  2. Setup structure to reuse the objects including "CallAgent, CallClient & Credentials" for same meeting.
  3. Disposing objects and make them null as well on "Hang Up".

Is all about services which not disposing after hung up the meeting. Can you guys resolve this from the SDK because when I not disposing objects manually and on next join, SDK thrown an error like "Initialization of SDK failed" which I already mention yesterday.

Please let me know if things are possible from your end. Waiting for your response.

In addition, I de-attach all the event handlers which I maintain manually but what about the action which required when creating call agent or joining meetings.

I couldn't find any source to de-attached that handlers which I need to setup inside the calling methods (Please check the attached images)

Image

Image

BK-83 avatar Jun 20 '25 10:06 BK-83

Hello @tompi

Did you find anything that could help us solve the issue?

BK-83 avatar Jun 23 '25 10:06 BK-83

No, sorry. I still suspect this might be related to missing/erroneous cleanup: https://stackoverflow.com/questions/12386769/handling-ios-crash-report-exc-crash-sigsegv

We are not really using teams meetings and group calls seems to work fine, also re-joining...

Do you have a reproducible bug I can test and debug? (dont know if your code is proprietary? maybe you can make a minimal app with the bug present?)

tompi avatar Jun 24 '25 07:06 tompi

Ok, I'll try to create separate app which has the same issue.

Can you please share the project from where this nuget was created, might help something from it.

BK-83 avatar Jun 24 '25 11:06 BK-83

This is the source for the binding library nuget:

https://github.com/Laerdal/Xamarin.AzureCommunicationCalling/tree/maui-beta

tompi avatar Jun 24 '25 11:06 tompi