Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(blink): refactor blink and improve call quality #376

Merged
merged 122 commits into from
Dec 4, 2023

Conversation

sdwoodbury
Copy link
Contributor

@sdwoodbury sdwoodbury commented Nov 30, 2023

What this PR does 📖

eliminates the problem where audio cuts out by doing the following

  • increasing the size of the HeapRb used to pass data to/from CPAL
  • increase the delay used by the echo canceller
  • removed the "optimization" which didn't send opus packets which were mostly silent

created a submodule to aid in testing

  • blink-repl can use warp-blink-wrtc with the loopback feature to make it send any received audio back to all connected peers. This program can be run on a cloud device, allowing one person to test a call between two separate locations.

refactored warp-blink-wrtc

  • Improved the host_media module. This was the next logical step after a previous PR improved IPFS signaling. The abstraction over the codec type was removed because it seems that we will always just use opus. The audio sink was split into a decoder task and a receiver task. The audio source was split into an encoder task and a sender task. Opus encoding/decoding is done on dedicated threads. The decoder task decodes in parallel using rayon.

misc fixes

  • updated the AudioDeviceConfig trait to use a oneshot::channel to signal when test_speaker and test_microphone are done. Cpal streams can't be sent safely between threads so these functions, which create said streams, can't use async.
  • fixed a bug in test_speaker where the sound continues to play after the test if the program doesn't drop the AudioDeviceConfigImpl struct.

Which issue(s) this PR fixes 🔨

Special notes for reviewers 🗒️

Additional comments 🎤
The stuff about datachannels isn't used yet and was left in for later. Eventually i'd like to use them to determine round trip time between peers, for detecting poor network conditions. That's what I was thinking of doing when I set out on this refactor.

@sdwoodbury sdwoodbury self-assigned this Nov 30, 2023
dariusc93 and others added 4 commits December 3, 2023 03:24
use Mutex instead of RwLock in host_media controller.
use futures::future::ready instead of async({}) in simple_webrtc
@sdwoodbury sdwoodbury merged commit 535515d into main Dec 4, 2023
1 check passed
@sdwoodbury sdwoodbury deleted the feat/datachannels2 branch December 4, 2023 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants