WebRTC
WebRTC copied to clipboard
Bandwidth leak on `background: true` cards
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:
- add a camera card to a dashboard
- set
background: true
- navigate to a different dashboard (without pageload)
- go back
- repeat steps 3-4 a few times
- observe an increase in network traffic on the stream source server (or the number of peerConnections in chrome://webrtc-internals, if webrtc is used)
Same in my installation.
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 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.