I updated the iOS native library to 2.7.2 recently...
# sdk-native
b
I updated the iOS native library to 2.7.2 recently and I'm getting a crash every time I try to open my microphone. I'm not doing any customization of Audio managing anymore - any ideas what is going on?
try
await
*self*.room.localParticipant.setMicrophone(enabled: *true*)
r
If you go back to previous version does the crash go away?
I assume you have permissions set properly?
b
yes - i was previously at 2.0.5 and it was working fine
yep, permissions are fine. I did have some custom
customConfigureAudioSessionFunc
, but i even commented out all of that logic and its still crashing every time I unmute
r
I assume you are on actual device and not simulator?
b
actual device (and tested in other devices, even through test flight). Always crashing
šŸ‘€ 1
• According to chatgpt looking at the stack trace, something on LocalParticipant.set(source..).
But I have stripped down to bare basics and still getting the error. Maybe it's my room config or something
r
do you have a symbolicated stacktrace you can share?
b
let me try to get one
šŸ™šŸ¼ 1
testflight_feedback.zip
šŸ™šŸ¼ 1
I'm running Swift5, not sure if thats the difference
stacktrace.txt
r
Do you ave ReplayKit.framework in the project?
b
Nope 😾
r
https://github.com/livekit/client-sdk-swift?tab=readme-ov-file#avoid-crashes-on-macos-catalina Looking to see if that is also needed for iOS but I believe it is
šŸ‘€ 1
b
Just tested this, still didnt get it
I'm going to try to run on the example app to see if it works there, so i can try to trace back
r
Ok, I am checking with our client team to see if they have any hints on this.
a
Hi @best-rainbow-62401 thank you for a detailed report šŸ™‚ I'm a Swift client dev, let's try to extract the root cause. First of all, there's a big gap between
2.0.5
and the current version. Unfortunately, we had no similar reports. It looks like memory corruption/double resume 😢 If we can reproduce it locally, I'd suggest the following plan: • use the following branch of the SDK to remove
Unsafe
part - trying to get more runtime info • I also see some
Debounce
and user-initiated actions happening in the meantime - so in the worst case I'll be asking for a minimal example (e.g. just the "connect" part that's crashing) Let's get an updated stacktrace from this branch ā¬†ļø and then repeat the investigation. Let me know if you've got any further questions.
āœ… 1
Added some extra logging, would be nice to collect SDK logs as well šŸ™‚
Copy code
AsyncCompleter<()>.resume(with:) Data channel open already resolved
b
Thank you! I am going to try it out with that branch. I'm also testing with the minimal SDK example to see if it happens there. I'll come back when I have more information
šŸ™šŸ¼ 1
šŸ™ 1
šŸ’Æ 1
Hey! Just coming back to say I'm still stuck. I pinpointed the start of the crash to when the library updated to Swift 6 - my project is in Swift5, but that shouldn't be a reason to crash. The sample project works well on Swift5. I stripped down to the bare basics of calling setMicrophone to true directly on the UI button and still got issues. I tried the stacktrace on the branch @able-flag-12349 send me but I'm not sure if that is useful, it seems like exactly the same reason.
image.png
image.png
Creating a LocalAudioTrack and publishing works, setMicrophone does not. I'm using that as a workaround for now šŸ™‚ Still have no idea wtf is happening
a
Hey @best-rainbow-62401 thank you for the updated stacktrace, was there a runtime 🟣 warning for the double resume?
Also, what is the console output (especially [LiveKit] part here)
@best-rainbow-62401 did you manage to re-test this scenario?