16 Commits

Author SHA1 Message Date
Kyle Simpson
d0b7fbb911 Docs: remove unused link. 2025-02-21 16:14:49 +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
Jonathan
5ddc8f4448 Chore(ci): Update rust, cargo and cache actions (#177)
* chore(ci): Update rust setup and cache action
* chore(ci): Remove legacy-tokio from test matrix

This was removed as it doesn't seem to be used any more.
2023-11-20 00:02:57 +00:00
Jonathan
4eadeb6834 chore(docs): Update rust setup action and cache (#176)
This PR changes the following things in the docs workflow:
- Move from the deprecated actions-rs action to the maintained alternative of dtolnay https://github.com/dtolnay/rust-toolchain
- Instead of manually defining the cache paths and the cache keys, I moved to an action that handles this for us: https://github.com/Swatinem/rust-cache
- As github decided at some point that the generated `GITHUB_TOKEN` secret will only have read-only permissions (for new repos), unless you tell them to be different, I added the `permissions` key to the job. This will not affect this repository, but will affect e.g. new forks (the workflow will not throw an permissions error any more - Read more here: https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/ )
2023-11-20 00:02:57 +00:00
Jonathan
841224ee7a chore(workflows): Update checkout action to v3 (#175)
This change was done as the v2 version still used the node v12 runtime.
This runtime is deprecated by github. There are no other breaking
changes done by the action. With the update to v3 now node v16 is used
as runtime.

You can read more about the changes from v2 to v3 here:
https://github.com/actions/checkout/releases/tag/v3.0.0
2023-11-20 00:02:57 +00:00
Kyle Simpson
6cd3097da0 Repo: Update issue templates 2023-11-20 00:02:56 +00:00
Kyle Simpson
2de071f921 CI: Disable Windows, MacOS Testing
Windows CI runners appear to be very slow wrt. the time limits we've set for many of the tests, so fail for tests involving longer files. At the same time, MacOS tests aren't likely to add much value over Linux.

This commit disables *test* runners for these environments to remove a lot of commit/PR noise. Builds are still run on these platforms.
2023-11-20 00:02:56 +00:00
Kyle Simpson
d8061d5029 Chore: Rework crate features (#139)
All dependencies have been moved to the new "dep:x" and "x?/feature" syntax to remove the bloat from the docs.rs/crates.io/lib.rs feature panes.

Accordingly, this lets us break "rustls" and "native" out from annoying hybrids like "serenity-rustls" or "twilight-native" -- specify your library and your backend, and it should just work.

The complete list of features is now: driver, gateway, serenity, twilight, rustls, native, builtin-queue, simd-json, internals (plus "default" and "full-doc").
2023-11-20 00:02:54 +00:00
Victoria Casasampere Fernandez
cb0a74f511 Support simd_json (#105)
This PR adds support for the simd-json library whenever decoding or encoding JSON responses. This may be enabled independently of serenity and twilight support for SIMD acceleration.

Co-authored-by: Kyle Simpson <kyleandrew.simpson@gmail.com>
2023-11-19 23:58:34 +00:00
Kyle Simpson
8cc7a22b0b Driver/Input: Migrate audio backend to Symphonia (#89)
This extensive PR rewrites the internal mixing logic of the driver to use symphonia for parsing and decoding audio data, and rubato to resample audio. Existing logic to decode DCA and Opus formats/data have been reworked as plugins for symphonia. The main benefit is that we no longer need to keep yt-dlp and ffmpeg processes alive, saving a lot of memory and CPU: all decoding can be done in Rust! In exchange, we now need to do a lot of the HTTP handling and resumption ourselves, but this is still a huge net positive.

`Input`s have been completely reworked such that all default (non-cached) sources are lazy by default, and are no longer covered by a special-case `Restartable`. These now span a gamut from a `Compose` (lazy), to a live source, to a fully `Parsed` source. As mixing is still sync, this includes adapters for `AsyncRead`/`AsyncSeek`, and HTTP streams.

`Track`s have been reworked so that they only contain initialisation state for each track. `TrackHandles` are only created once a `Track`/`Input` has been handed over to the driver, replacing `create_player` and related functions. `TrackHandle::action` now acts on a `View` of (im)mutable state, and can request seeks/readying via `Action`.

Per-track event handling has also been improved -- we can now determine and propagate the reason behind individual track errors due to the new backend. Some `TrackHandle` commands (seek etc.) benefit from this, and now use internal callbacks to signal completion.

Due to associated PRs on felixmcfelix/songbird from avid testers, this includes general clippy tweaks, API additions, and other repo-wide cleanup. Thanks go out to the below co-authors.

Co-authored-by: Gnome! <45660393+GnomedDev@users.noreply.github.com>
Co-authored-by: Alakh <36898190+alakhpc@users.noreply.github.com>
2023-11-19 23:58:34 +00:00
Gnome!
f2cd8a0b6a Driver, Gateway: Remove tokio 0.2 support (#118)
* Remove tokio 0.2 compat
* Remove tokio 0.2 test
* Remove tokio 0.2 CI
2022-07-22 15:41:18 +01:00
Kyle Simpson
aaab97511d Library: Add compatibility for legacy Tokio 0.2 (#40)
Adds support to the library for tokio 0.2 backward-compatibility. This should hopefully benefit, and prevent lavalink-rs from being blocked on this feature.

These can be reached using, e.g., `gateway-tokio-02`, `driver-tokio-02`, `serenity-rustls-tokio-02`, and `serenity-native-tokio-02` features.

Naturally, this requires some jiggering about with features and the underlying CI, which has been taken care of. Twilight can't be handled in this way, as their last tokio 0.2 version uses the deprecated Discord Gateway v6.
2021-02-04 02:34:07 +00:00
Kyle Simpson
504b8dfaef Driver, Input: Performance & Benchmarks (#27)
* Driver Benchmarks

Benchmarks driver use cases for single packet send,
multiple packet send, float vs opus, and the cost of
head-of-queue track removal.

Mix costs for large packet counts are also included.

This is a prelude to the optimisations discussed in
#21.

* Typo in benchmark

* Place Opus packet directly into packet buffer

Cleans up some other logic surrounding this, too. Gets a 16.9% perf improvement on opus packet passthrough (sub 5us here).

* Better track removal

In theory this should be faster, but it aint. Keeping in case
reducing struct sizes down the line magically makes this
faster.

* Reduce size of Input, TrackHandle

Metadata is now boxed away. Similarly, TrackHandles are neatly Arc'd to reduce their size to pointer length (and mitigate the impact of copies if we add in more fields).
2020-12-26 23:08:35 +00:00
Kyle Simpson
35d262d946 CI round 2 2020-11-13 19:15:33 +00:00
Kyle Simpson
c5ce107d55 Attempt CI similar to serenity 2020-11-13 18:56:18 +00:00