Commit 78dc1ca
authored
Improve connection reliability (#18)
* Create minimal example
* Wip
* Connect signal
* Signal refactor
* Connect primary peer
* Remove dead code
* Use event queue approach
* Introduce timer
* Proper cleanup
* Implement reconnecting state
* Remove disconnecting state
* Reintroduce all features
* Add additional transitions
* Docs and organization
* Remove any state handler
* Change event memory model
* Store local participant ID
* Consolidate event detail cases
* Cleanup session state
* Engine refactor
- Handle all signal responses in state machine
- Helper functions for protocol messages
* Simplify state machine memory model
Always discard events
* Helper methods for data packets
* Allow engine to take ownership of data packet
* Process data packets via state machine
* Notify of engine state change
* Add documentation
* Allow handlers to take ownership of events
* Exponential backoff
* Create helper to enqueue events
* Zero initialize protobuf structs
* Ignore non-binary messages silently
* Make engine state internal
* Document
* Handle and expose failure reason
- Do not retry for client errors
- Expose failure reason through public API
* Extract into helpers
* Unify peer state change handling
* Free event if cannot enqueue
* URL build options struct
* Map disconnect reason to failure reason
* Send leave on user-initiated close
* Separate session state
* Reenable track subscription
* Decode tag on fail
* Ignore proto messages
* Add markers
* Fix state reporting bug
Optimizer causes issue where enum return value cannot be -1
* Improve signal state handling
- Signal state enum with failure reason
- Handle normal WS closure
* Remove unneeded includes
* Retry on peer disconnect in addition to fail
* Remove unneeded config
* Refactor signal client
- Handle ping timeout
- Use FreeRTOS timer instead of esp_timer (ms accuracy is sufficient)
- Ensure cleanup under abnormal closure conditions (e.g. WiFi disconnect)
* Cleanup signal client init
* Cleanup engine init
* Use protocol helper for encoding requests
* Use protocol helpers for encoding data packets
* Inline remaining protocol helpers
* Use consistent naming convention
* Make nanopb encode/decode includes private
* Simplify internal API
* Send data packets
* Zero only
* Remove state guards for sub audio
Audio stream can begin while still in connecting state
* Handle room and participant update in connecting state
Early participant update messages are necessary to subscribe to remote track
* Cleanup previous connection in backoff
Perform same cleanup steps when entering both disconnected and backoff
* Handle ICE servers
Reintroduce support for dynamically setting ICE servers, use hardcoded for now.
* Use SAFE_FREE macro
* Remove dead code
* Do not handle data packets in FSM
* Add basic connection time benchmarking
* Queue peer SDP messages
* Clean up
* Increase timer stack depth
* Fix typo
* Document how to get failure reason
* Data packet optimization
- Ignore types that are not supported yet
- Fixed length sender SID
* Signal response optimization
- Ignore types that are not supported yet
* Fix incorrect field type
* Fix voice agent example agent join
* Demonstrate getting failure reason in all examples
* Consistent sdkconfig defaults between examples
* Bump version1 parent 550bec8 commit 78dc1ca
File tree
37 files changed
+2254
-909
lines changed- components/livekit
- core
- include
- protocol
- protobufs
- examples
- minimal
- main
- voice_agent
- main
37 files changed
+2254
-909
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
0 commit comments