element-hq / element-x-ios

Next generation Matrix client for iOS built with SwiftUI on top of matrix-rust-sdk.
https://element.io/labs/element-x
GNU Affero General Public License v3.0
397 stars 88 forks source link

[Element-Call] iPhone getting hot / high battery drain during call #3195

Closed jacotec closed 4 days ago

jacotec commented 3 weeks ago

Steps to reproduce

After switching from the legacy app to EX-IOS and using this also for video calls with Element-Call, users are complaining about their iPhones getting pretty hot during the call. Battery drains faster also.

This did not happen in legacy Element using direct WebRTC 1:1 call nor using the Jitsi widget. Does not happen doing the call on Nextcloud Talk or any other platform (Facetime) either.

EX-IOS seems to use excess CPU when doing video calls.

Outcome

What did you expect?

Heat dissipation and battery drain should not ecxeed what users see with legacy Element-IOS, Jitsi, Nextcloud Talk or Facetime

What happened instead?

iPhones getting too hot, battery drains too fast during a video call.

Your phone model

iPhone 14 Pro Max

Operating system version

iOS 17.6.1

Application version

1.7.3 (119)

Homeserver

Synapse 1.113.0

Will you send logs?

No

jacotec commented 2 weeks ago

Underlying issue is basically Element-Call using the unsupported codec VP8 which has zero hardware support in IOS/iPadOS. All must be done in software, causing high CPU load, temperature dissipation and battery drain.

Filed an issue in call: https://github.com/element-hq/element-call/issues/2579

Leaving this open unless resolved.

jacotec commented 2 weeks ago

Workaround for self-hosted Element-Call deployments (Docker):

In element-call/volumes/elementcall/backend/livekit.yaml add this section:

room:
  enabled_codecs:
    - mime: video/h264
    - mime: audio/opus

This will force livekit to use H.264 and all is back to normal in the Apple world, iPhones not getting hot anymore, battery use for 15 minutes video call on an iPhone 14 is down to 3% now.

ara4n commented 2 weeks ago

I second this - i actually had my phone go into thermal lockdown about 10m into a matrixrtc call the other day while outside:

image

cc @fkwp in order to get this issue on the radar of the EC team, if it isn’t already, so the codec can be changed if the team thinks it makes sense…

thanks @jacotec for doing the research on this :)

pixlwave commented 4 days ago

I'm going to close this issue in favour of the EC one as this is about the deployment and not EX itself: https://github.com/element-hq/element-call/issues/2579