Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When custom audio renderers are added, app would crash if not removed before disconnecting #442

Open
davidzhao opened this issue Jul 26, 2024 · 3 comments
Assignees
Labels
bug Something isn't working Swift

Comments

@davidzhao
Copy link
Member

This relates to the use of custom audio renderers:

    nonisolated
    func participant(_ participant: RemoteParticipant, didSubscribeTrack publication: RemoteTrackPublication) {
        if let audioTrack = publication.track as? RemoteAudioTrack {
            audioTrack.add(audioRenderer: audioRenderer)
        }
    }

When this is added and the session is disconnected, this would crash fairly frequently.

@davidzhao davidzhao added the bug Something isn't working label Jul 26, 2024
@davidzhao davidzhao added the Swift label Jul 30, 2024 — with Linear
@dfed
Copy link

dfed commented Sep 19, 2024

I'm able to work around this in the majority case by removing the custom renderer before disconnect happens, but sometimes there's a race I can't avoid and we end up crashing. This is quickly becoming one of our top crashers. Crash is easy to reproduce in the simple case at least. Let me know if I can provide more info here.

@hiroshihorie
Copy link
Member

I have a fix here, but it needs more testing. Also it will expose AVAudioPCMBuffer instead of CMSampleBuffer. If you still need CMSampleBuffer I might write a helper func in the SDK.
webrtc-sdk/webrtc#144

@dfed
Copy link

dfed commented Sep 19, 2024

Great!! AVAudioPCMBuffer is easier for me to work with anyways 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Swift
Projects
None yet
Development

No branches or pull requests

3 participants