Commit Graph

124 Commits

Author SHA1 Message Date
Kyle Simpson
f05b262dfe Driver: Remove legacy encryption algorithms.
There is probably some followup cleanup which can be done, but keeping
the general structure intact might help if there are future changes on
available (non-E2EE) algorithms.
2025-02-21 16:02:16 +00:00
Kyle Simpson
5d320a394b Chore: Bump rubato->0.16 2025-02-21 13:54:37 +00:00
Kyle Simpson
b39ab98223 Chore: Bump rand->0.9, tokio-tungstenite->0.26 2025-02-21 13:48:56 +00:00
Erk
b46a568fb5 Support for Twilight 0.16 (#227) 2025-02-21 12:41:44 +00:00
Vamplay
1c52e6ebc0 Update tokio-tungstenite dependency to 0.24 (#267) 2025-02-21 12:41:44 +00:00
Gnome!
9a244ba4c2 Update to DashMap 6 (#253) 2025-02-21 12:41:44 +00:00
Gnome!
e9b2243b83 Bump dependencies (#237) 2025-02-21 12:41:44 +00:00
Carson M
3bc132faaf Chore: Update tokio-websockets to v0.7 (#229) 2025-02-21 12:41:44 +00:00
Erk
c81f2a9578 Remove Simd-json (#228)
This mirrors the serenity pr https://github.com/serenity-rs/serenity/pull/2735.
2025-02-21 12:40:49 +00:00
Carson M
c4331c451f Driver: Support tokio-websockets (#226)
* Driver: Support `tokio-websockets`

* Fix bad feature flag

* Fix CI & examples features

* Use tungstenite in twilight example

* Error if none or both ws features are enabled

* Match `twilight-gateway` features
2025-02-21 12:40:49 +00:00
Gnome!
0d6a226910 Tracks: Replace RwLock<TypeMap> data store with Arc<dyn Any> (#219) 2025-02-21 12:40:49 +00:00
Gnome!
2bcc5223fe Allow borrowed strings for YoutubeDl (#215) 2025-02-21 12:40:49 +00:00
Gnome!
743a1d262e Deps: Replace OnceCell with std::sync::OnceLock (#207) 2025-02-21 12:40:49 +00:00
Kyle Simpson
2146846df4 Chore: Release v0.4.6 2024-12-04 09:54:53 +00:00
Kyle Simpson
fe46da6b0d Chore: Release v0.4.5 2024-11-22 13:28:24 +00:00
Kyle Simpson
8eace22e25 Chore: Release v0.4.4 2024-11-11 12:41:02 +00:00
tig
10ce458456 feat: v8 encryption modes (#264)
This PR adds support for the new AEAD cryptosystems advertised by Discord, AES256-GCM and XChaCha20Poly1305. These schemes will shortly become mandatory, and provider stronger integrity/authentication guarantees over the cleartext portions of any voice packet by correctly specifying additional authenticated data.

To provide smooth switchover, we've added basic negotiation over the `CryptoMode`. This ensures that any clients who are manually specifying one of the legacy modes will automatically migrate to `Aes256Gcm` when Discord cease to advertise their original preference.

Closes #246.

---------

Co-authored-by: Kyle Simpson <kyleandrew.simpson@gmail.com>
2024-11-11 12:30:15 +00:00
Kyle Simpson
530286c6a6 Fix(receive): Handle sleds of identical RTP timestamps (#249)
Bots joining calls with users seem to provoke large runs of packets
with identical timestamps -- the existing logic was intended to handle this catchup case in addition to the normal (+=960) at all
times.

However, we were checking that a packet was modulo greater-than
the next ts, rather than modulo less-than. Simple enough to fix.
2024-08-24 22:38:09 +01:00
Kyle Simpson
2b76eb9923 Chore: Release v0.4.3 2024-07-17 11:35:19 +01:00
Kyle Simpson
6a9335628c Revert bbc9e03, update tracing-subscriber in examples
Tokio-tungstenite have made some runtime-breaking changes to how
crypto setup is init'd -- i.e., users must do it themselves.
Reverting due to the huge (breaking) inconvenience this poses.
2024-07-17 11:31:12 +01:00
Erk
2dc812bd6a fix(dependecies): don't use default features for stream_lib (#244)
stream_lib would always pull in native-tls, this was changed in 0.4.2
which contains a backport of https://github.com/Erk-/rsget/pull/45.
2024-07-09 17:33:48 +01:00
Kyle Simpson
25d59a6956 chore: Release v0.4.2 2024-07-08 12:03:02 +01:00
Kyle Simpson
bbc9e03e47 chore(deps): Update tokio-tungstenite -> 0.23 2024-07-08 11:58:23 +01:00
Kyle Simpson
169d527e54 chore(deps): Update rubato -> 0.15 2024-07-08 11:49:46 +01:00
Kyle Simpson
93f2e0b636 chore(deps): Update ringbuf -> 0.4 2024-07-08 11:46:08 +01:00
Erk
8e92c49b2b feat(input): Support HLS streams (#242)
This patch adds support for yt-dl streams with the protocol m3u8_native which includes sites like Soundcloud.

Closes: #241
2024-07-07 19:37:25 +02:00
Kyle Simpson
b07e9b4178 Chore: Release v0.4.1 2024-02-29 23:07:04 +00:00
Kyle Simpson
4d67a73851 Chore: update tokio-tungstenite 2024-02-24 20:58:27 +00:00
Kyle Simpson
22ceb175b6 Chore: Fixup examples, bump version pre-push
Takes the chance to bring shared deps into the example workspace while we're here. Release notes, tags etc will follow in time.
2023-11-27 21:16:53 +00:00
Kyle Simpson
1f616daee6 Chore: Release v0.4.0-rc-2 2023-11-23 12:21:33 +00:00
Kyle Simpson
cc53312569 Deps: Re-disable default Serenity features 2023-11-23 12:01:24 +00:00
Kyle Simpson
38096163ab Chore: Release v0.4.0-rc 2023-11-20 02:53:33 +00:00
Kyle Simpson
1487da175c Chore: Upgrade serenity to 0.12.0-rc 2023-11-20 00:03:53 +00:00
Kyle Simpson
0ef0e4fc82 Chore: Bump DiscoRTP version 2023-11-20 00:02:58 +00:00
Gnome!
63d48ee597 Update simd-json to 0.13 (#203) 2023-11-20 00:02:58 +00:00
Kyle Simpson
67b3b3ec50 Chore: Update Rubato -> 0.14.1 2023-11-20 00:02:58 +00:00
Kyle Simpson
4220c1ffe5 Chore: Update (most) dependencies
Updates all bar rubato, which I fear may take a little more work...
2023-11-20 00:02:58 +00:00
Kyle Simpson
6f801563e5 Chore: Rust 1.72.0 Clippy lints, adjust MSRV
MSRV was bumped by serenity-next, and so we too must follow suit.
2023-11-20 00:02:58 +00:00
Sebbl0508
77a9b4626c Driver: Replace xsalsa20poly1305 with crypto_secretbox (#198)
As of v0.9.1, `xsalsa20poly1305` has been deprecated. This is a mostly seamless replacement, as it appears to be the same crate authors / code / etc.

Co-authored-by: Kyle Simpson <kyleandrew.simpson@gmail.com>
2023-11-20 00:02:57 +00:00
Kyle Simpson
1bf17d128e Chore: Update dependencies, MSRV.
Tested using `cargo make ready`.
2023-11-20 00:02:57 +00:00
Kyle Simpson
3daf11f5d1 Driver: Implement audio scheduler (#179)
This PR implements a custom scheduler for audio threads, which reduces thread use and (often) memory consumption.

To save threads and memory (e.g., packet buffer allocations), Songbird parks Mixer tasks which do not have any live Tracks.
These are now all co-located on a single async 'Idle' task.
This task is responsible for managing UDP keepalive messages for each task, maintaining event state, and executing any Mixer task messages.
Whenever any message arrives which adds a `Track`, the mixer task is moved to a live thread.
The Idle task inspects task counts and execution time on each thread, choosing the first live thread with room, and creating a new one if needed.

Each live thread is responsible for running as many live mixers as it can in a single tick every 20ms: this currently defaults to 16 mixers per thread, but is user-configurable.
A live thread also stores RTP packet blocks to be written into by each sub-task.
Each live thread has a conservative limit of 18ms that it will aim to stay under: if all work takes longer than this, it will offload the task with the highest mixing cost once per tick onto another (possibly new) live worker thread.
2023-11-20 00:02:57 +00:00
Kyle Simpson
a5f7d3f488 Chore: Update dependencies.
Updates simd-json -> 0.8, socket2 -> 0.5.

Tested using `cargo make ready`.
2023-11-20 00:02:56 +00:00
Alex M. M
7f519d0503 Chore: Release v0.3.2 2023-11-20 00:02:56 +00:00
Kyle Simpson
5eeeee4f37 Chore: Release v0.3.1 2023-11-20 00:02:56 +00:00
Erk
b2507f34f1 Gateway: Twilight 0.15 support (#171)
This patch changes around quite a few things.
The main entrypoint for twilight besides process will now be the
TwilightMap which concists of command senders for each shard.

This simplifies parts of the code as there is not any difference
between shards and clusters anymore.
2023-11-20 00:02:56 +00:00
Kyle Simpson
fdd0d830c7 Deps: Move to published symphonia v0.5.2 from git
Symphonia v0.5.2 has all the API changes and fixes we were depending on, which leaves next one step closer to publishable.

Tested using `cargo make ready`.
2023-11-20 00:02:56 +00:00
Kyle Simpson
5d06a429a8 Chore: Update tokio-tungstenite, typemap_rev 2023-11-20 00:02:55 +00:00
Kyle Simpson
c60c454cf5 Driver/receive: Implement audio reorder/jitter buffer (#156)
This PR Introduces a new `VoiceTick` event which collects and reorders all RTP packets to smooth over network instability, as well as to synchronise user audio streams. Raw packet events have been moved to `RtpPacket`, while `SpeakingUpdate`s have been removed as they can be easily computed using the `silent`/`speaking` audio maps included in each event.

Closes #146.
2023-11-20 00:02:55 +00:00
Kyle Simpson
b7e40ab5e4 Deps: Move symphonia back to mainline repo.
Temporary measure until symphonia 0.5.2 is released. Should allow us to merge #143 now that all our API additions and fixes are in.
2023-11-20 00:02:55 +00:00
Kyle Simpson
f72175b799 Deps: Update dev-dependencies 2023-11-20 00:02:55 +00:00