Commit Graph

32 Commits

Author SHA1 Message Date
Kyle Simpson
f449d4f679 Deps: Bump DiscoRTP version -> 0.3 (#52)
This change increases the version of DiscoRTP, which fixes upstream issues in libpnet and allows additional RTCP types to be added over time without breaking semver. This is a breaking change for users explicitly matching on RTCP packet types, as DiscoRTP is exposed here.

This has been tested using `cargo make ready`.
2021-07-01 11:30:01 +01:00
Kyle Simpson
ebff98e873 Release v0.1.8 2021-07-01 10:27:03 +01:00
Kyle Simpson
d01bef729d Release v0.1.7 2021-06-14 23:07:10 +01:00
Kyle Simpson
9e202f602d Release v0.1.6 2021-04-11 13:33:19 +01:00
Kyle Simpson
a88b185676 Deps: Prevent MSRV breakage via spinning_top (#64)
The upstream crate `spinning_top` used newer elements of rustc's std in a patch release, unknowingly bumping its MSRV to 1.49.0. This patch reverts to the older, compatible, version.

This has been tested by manually building `examples/serenity/voice` using rustc v1.48.0.

Closes #62.
2021-04-10 22:56:30 +01:00
Kyle Simpson
df64ad92e5 Release v0.1.5 2021-03-23 09:09:09 +00:00
Kyle Simpson
f230b41110 Deps: Update async-tungstenite -> 0.13 (#50)
Updates to the latest async-tungstenite version. This was tested by `cargo make ready` and by testing driver/gateway function via `examples/serenity/voice_storage`.
2021-03-23 08:22:38 +00:00
Kyle Simpson
dd49c5d99f Release v0.1.4 2021-02-10 16:53:20 +00:00
Kyle Simpson
a40fac3109 Deps: Update async-tungstenite -> 0.12
This is a non-breaking change, since WsError is private.
2021-02-10 14:00:03 +00:00
Kyle Simpson
fa9de67ac2 Release v0.1.3 2021-02-04 02:46:05 +00:00
Kyle Simpson
1863d39356 Chore + Deps: Add the log feature to tracing 2021-02-04 02:38:09 +00: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
b2453091e7 Fix: hand off process killing to blocking thread, await all children.
This should make dropping `ChildContainer`s and their parent `Input`s safer in async contexts.

It seems like SIGINT is insufficient to make wait terminate, but SIGKILL suffices. This introduced a new problem, namely that we have to remember and wait on *every* pid we create. This should, hopefully, put the issue of zombie processes to bed for good.
2021-02-01 13:43:26 +00:00
Kyle Simpson
7d4891d32c Release v0.1.2 2021-01-26 21:32:02 +00:00
Kyle Simpson
fe2282cfde Input & Driver: Fix zombie processes on Unix (#39)
Linux/Unix requires that processes be waited, which is unfortunate as Windows lets us abandon them to the murderous whims of the OS. This PR adds Unix-specific behaviour to send a SIGINT before waiting on the process, and adds an additional thread per call for asset disposal on all platforms.

Closes #38.

---

* Close processes by SIGINT and wait on Unix

This seems to remedy the Linux-specific zombie processes. Addition of
nix as a dependency *should* be fine on Windows, since I believe it
compiles to an empty crate.

* Dispose of Tracks on auxiliary thread

This adds a mechanism for the mixer threads to perform potentially expensive deallocation/cleanup outside of the main loop, preventing deadline misses etc. This should make misbehaving `wait`s a bit more friendly.
2021-01-26 20:19:51 +00:00
Kyle Simpson
a0e905a83f Gateway: Move from RwLock<HashMap> to DashMap
Moves to the faster dashmap in the Songbird management struct, as the final v4 brought back the `entry` API that I was needing to use it safely.

Also handles some new clippy lints.
2021-01-26 14:23:07 +00:00
Kyle Simpson
21226af43a Release v0.1.1 2021-01-17 23:28:40 +00:00
Kyle Simpson
7d767d2919 Chore: Bump to published twilight. 2021-01-08 10:27:25 +00:00
Kyle Simpson
53ab9dac03 Chore: Bump to published serenity. 2021-01-06 23:12:24 +00:00
Kyle Simpson
f05b7414a0 Songbird: Tokio 1.0 (#36)
Migrates to the new version of tokio, requiring channel and sleep changes in a few locations. Additionally points to the in-tree v0.3 version of twilight.
2021-01-06 13:01:14 +00:00
Kyle Simpson
d42e09f72b Tracks: Add TypeMap to Handles.
Adds a shared TypeMap per TrackHandle. This should greatly simplify the user experience for attaching additional per-track state which the driver does not care for.
2021-01-02 23:43:28 +00:00
Kyle Simpson
03ae0e7628 Input: Allow Restartable sources to be lazy
This change is made with queue users in mind. Since sources
of this kind *know* how to (re)create themselves, they can
avoid being created at all until needed.

This also adds machinery to preload tracks *before* they are
needed, for gapless playback on queues and so on. Queues
make use of the event system to do this.
2020-12-28 17:17:57 +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
2fc88a6ef1 Deps: Patch flume.
Addresses security advisory in downstream nanorand.
2020-12-19 13:18:46 +00:00
Maspenguin
1ada46d24b Fix: Remove serenity default features (#18)
Allows use of songbird without serenity's framework.
2020-11-23 10:43:24 +00:00
Kyle Simpson
de652250d8 TrackQueues: Convenience methods and extension (#7)
* Adds a uuid field to tracks and handles to make it easier to identify and match event sources after the fact.
* Adds optional feature "builtin-queue" to expose a queue on every driver, as a convenience for users who can guarantee they'll need a queue for every driver/call.
* Adds methods to queues to allow access to the currently running track handle, remove a specified queue entry, as well as to mutate the underlying queue from a closure.
2020-11-16 08:57:54 +00:00
( ͡° ͜ʖ ͡°)
6702520b7c Offer youtube-dlc as an alternative to youtube-dl (#1)
* Adds youtube-dlc feature.
2020-11-13 22:27:28 +00:00
Kyle Simpson
a9f8d6c93a Fix: Use correct tokio features for driver-only mode 2020-11-13 19:32:03 +00:00
Alex M. M
4a897a7b76 Remove mentions of versions to Serenity git dependencies 2020-11-13 15:07:29 +01:00
Alex M. M
6724655351 Update Cargo.toml to reflect the separation of songbird from Serenity's repository 2020-11-13 14:55:38 +01:00
Kyle Simpson
868785ba71 Update versions for twilight and serenity-voice-model in songbird (#1075) 2020-11-12 13:34:23 +01:00
Kyle Simpson
7e4392ae68 Voice Rework -- Events, Track Queues (#806)
This implements a proof-of-concept for an improved audio frontend. The largest change is the introduction of events and event handling: both by time elapsed and by track events, such as ending or looping. Following on from this, the library now includes a basic, event-driven track queue system (which people seem to ask for unusually often). A new sample, `examples/13_voice_events`, demonstrates both the `TrackQueue` system and some basic events via the `~queue` and `~play_fade` commands.

Locks are removed from around the control of `Audio` objects, which should allow the backend to be moved to a more granular futures-based backend solution in a cleaner way.
2020-10-31 12:19:07 +01:00