matrix-org / waterfall

A cascading stream forwarding unit for scalable, distributed voice and video conferencing over Matrix
Apache License 2.0
97 stars 5 forks source link

Make each publisher send RTP packets directly to its subscribers #117

Closed daniel-abramov closed 1 year ago

daniel-abramov commented 1 year ago

Currently, each publisher sends incoming RTP packets to the conference. The conference distributes the packets to the subscriptions. The conference does not really do any CPU-bound conferences and merely relays the packets to the subscribers' workers.

However, as it appeared during our demo tests with many participants, this way of sending frames is not very efficient as the frame processing takes over 90% of the whole conference time (if not more). It's not yet clear why (see https://github.com/matrix-org/waterfall/issues/116), but it seems like a good idea to make publishers write to subscribers directly. This would involve sharding the conference state to make subscribers a shared state that is shared between several go-routines / threads.