webrtc-sdk / webrtc

BSD 3-Clause "New" or "Revised" License
225 stars 89 forks source link

Problems when muting local tracks in the background (ios) #97

Open danjenkins opened 11 months ago

danjenkins commented 11 months ago

We're having an issue where the audio processing audio unit gets stopped when all the tracks are muted. This is a change to libwebrtc done here - https://github.com/webrtc-sdk/webrtc/commit/272127d457ab48e36241e82549870405864851f6#diff-96494536ec12249ed599120315bbc5df4ca4b7612c4098e5fdce65e72065328dR101

Normally this would be a great addition, stop accessing the mic, stop showing the mic access bar/dot when users think the mic shouldn't be "listening". In our case, it's not great because once you stop an audio unit in the background, you can't restart it unless you're in the foreground or your app is using callkit (as far as I'm aware anyway)

I believe this functionality should have an opt out - libwebrtc allows for the use of feature flags to enable and disable a lot of functionality so I think this should definitely be enabled by default but allow users who need to, the ability to opt out of this behaviour.

cc @davidzhao

davidzhao commented 11 months ago

CC: @hiroshihorie this is an unfortunate side effect of the way we are automatically managing the audio session.