WebRTC icon indicating copy to clipboard operation
WebRTC copied to clipboard

Bandwidth leak on `background: true` cards

Open d3relict opened this issue 1 year ago • 3 comments

I noticed with webrtc cards, that if i enable background: true, the peerConnections do not get disconnected (which is fine), but when i reopen the page which has the cameras, they get reestablished again (instead of using existing connections), causing incremental bandwidth consumption on my server. Once i disabled the background feature, everything went back to normal.

I'm running HomeAssistant 2023.3 with WebRTC-Camera 3.1.0, the issue was observed on Chrome 111.0.5563.147 (Official Build) (64-bit)

Reproduction:

  1. add a camera card to a dashboard
  2. set background: true
  3. navigate to a different dashboard (without pageload)
  4. go back
  5. repeat steps 3-4 a few times
  6. observe an increase in network traffic on the stream source server (or the number of peerConnections in chrome://webrtc-internals, if webrtc is used)

d3relict avatar Apr 05 '23 09:04 d3relict

Same in my installation.

luzik avatar Apr 17 '23 16:04 luzik

I can't confirm that switching tabs or dashboards causes the problem. But "Edit Dashbord" function does create new cards all the time when you change the card list.

Complicated bug. Need to save background IDs and stop old cards if new cards are created with the same ID.

AlexxIT avatar Jul 06 '23 14:07 AlexxIT

@AlexxIT i can reproduce this on MSE (webrtc no longer works for me because some config changed) by adding a few background: true panels on a dashboard, and navigating back and forth between that dashboard and some others. in case i only navigate between tabs on the same dashboard, i have not seen the rise of bandwidth usage.

d3relict avatar Jul 10 '23 11:07 d3relict