many-printer-46539
12/16/2025, 1:09 PMtall-airline-16756
12/16/2025, 1:09 PMtall-airline-16756
12/16/2025, 1:09 PMmany-printer-46539
12/16/2025, 1:16 PMtall-airline-16756
12/16/2025, 1:17 PMGetStats() for the room and check inbound audio bytesReceived / packetsReceived.
◦ If bytes increase, the remote audio is arriving over RTP and the problem is rendering (native→managed path). If bytes do not increase, signaling/RTP is the issue.
1. Add explicit AudioStream event logging (verify callback registration)
◦ Immediately after creating AudioStream(audioTrack, audioSource), attach a handler that logs every event and a timestamp.
◦ If the handler never logs on the device but logs in Editor, native callbacks are not being invoked.
1. Try the SDK’s minimal example on the same device
◦ Build and run the official LiveKit Unity demo/example with your same iOS/Xcode settings.
◦ If the example works, the problem is in your app or build settings. If it fails, it’s SDK + environment related.
1. Bypass custom audio probe/path (isolate Unity rendering)
◦ Temporarily stop using `AudioProbe`/OnAudioFilterRead and AudioStream. Try the SDK’s simplest attach/render path (or attach track to an AudioSource if supported).
◦ If that plays audio, the issue is in the custom audio processing or ring buffer usage.
1. Check IL2CPP/stripping and plugin linking settings
◦ Player Settings (iOS): set Managed Stripping Level = Disabled/Low, Disable Engine Code Stripping, ensure Architecture = ARM64, Target SDK = Device.
◦ Build with Development and Script Debugging enabled.
◦ Re-run — a high stripping level can remove pinvoke glue or cause delegate GC issues.
1. Confirm native callback pinning / GC safety
◦ Ensure the managed delegate passed to native is stored/pinned so the GC cannot collect it. (Log when you register/unregister.)
◦ On iOS/IL2CPP, delegate lifetimes and AOT differences can break callbacks.
1. Validate AVAudioSession activity at runtime
◦ In Xcode console, log any AVAudioSession activation calls. Confirm category/mode set to PlayAndRecord/VoiceChat and session is Active when subscribing to audio.
◦ If SDK should manage it, confirm it actually calls setActive on the device.
1. Try Unity LTS (quick compatibility test)
◦ Create a tiny project in Unity 2022 LTS with LiveKit SDK 1.2.4 and test the same device/build.
◦ If audio works there, Unity 6 likely introduces an incompatibility with the native plugin or IL2CPP behavior.
1. Inspect Xcode logs for native callback traces and thread context
◦ Filter logs for webrtc, audio, or your plugin symbol names to see whether the native path is producing frames or failing to call the managed entrypoint.
◦ Note whether callbacks appear on non-main threads (threading/marshaling issues).
What I can help next if you report results:
• If stats show inbound bytes increasing but no AudioStream events: I’ll provide exact debug logging snippets and a minimal repro checklist to isolate native callback registration and delegate pinning.
• If stats show no inbound bytes: I’ll guide further network/RTP/signaling traces.
• If the example works but your app fails: I’ll suggest targeted build setting diffs to check.
Which step can you run first and share results for?