ssssam / boucle Goto Github PK
View Code? Open in Web Editor NEWBoucle disaster looper
License: GNU General Public License v3.0
Boucle disaster looper
License: GNU General Public License v3.0
Unit tests for organelle should exist.
I started, but hit a problem: I want a function that iterates the main loop. For that I want to store the jack AsyncClient struct somewhere once the audio starts.
At the moment its a local variable with auto type:
let _active_client = client.activate_async(
JackNotifications,
jack::ClosureProcessHandler::new(process_callback),
).unwrap();
This works!
If I give a type (needed to return it to caller):
let _active_client: jack::AsyncClient<jack::NotificationHandler, jack::ProcessHandler> = client.activate_async(
JackNotifications,
jack::ClosureProcessHandler::new(process_callback),
).unwrap();
This fails:
arning: trait objects without an explicit `dyn` are deprecated
--> organelle/src/main.rs:301:47
|
301 | let _active_client: jack::AsyncClient<jack::NotificationHandler, jack::ProcessHandler> = client.activate_async(
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn jack::NotificationHandler`
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: trait objects without an explicit `dyn` are deprecated
--> organelle/src/main.rs:301:74
|
301 | let _active_client: jack::AsyncClient<jack::NotificationHandler, jack::ProcessHandler> = client.activate_async(
| ^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn jack::ProcessHandler`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error[E0277]: the size for values of type `dyn NotificationHandler` cannot be known at compilation time
--> organelle/src/main.rs:301:29
|
301 | let _active_client: jack::AsyncClient<jack::NotificationHandler, jack::ProcessHandler> = client.activate_async(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `dyn NotificationHandler`
note: required by a bound in `AsyncClient`
--> /home/sam/.cargo/registry/src/github.com-1ecc6299db9ec823/jack-0.8.2/src/client/async_client.rs:33:24
|
33 | pub struct AsyncClient<N, P> {
| ^ required by this bound in `AsyncClient`
error[E0277]: the size for values of type `dyn ProcessHandler` cannot be known at compilation time
--> organelle/src/main.rs:301:29
|
301 | let _active_client: jack::AsyncClient<jack::NotificationHandler, jack::ProcessHandler> = client.activate_async(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `dyn ProcessHandler`
note: required by a bound in `AsyncClient`
--> /home/sam/.cargo/registry/src/github.com-1ecc6299db9ec823/jack-0.8.2/src/client/async_client.rs:33:27
|
33 | pub struct AsyncClient<N, P> {
| ^ required by this bound in `AsyncClient`
error[E0308]: mismatched types
--> organelle/src/main.rs:301:98
|
216 | let process_callback = move |_: &jack::Client, ps: &jack::ProcessScope| -> jack::Control {
| ________________________________-
217 | | let mut boucle = boucle_rc.lock().unwrap();
218 | | let mut buffers = buffers_rc.lock().unwrap();
219 | | let mut play_clock = buffers.play_clock.clone();
... |
298 | | jack::Control::Continue
299 | | };
| |_________- the found closure
300 |
301 | let _active_client: jack::AsyncClient<jack::NotificationHandler, jack::ProcessHandler> = client.activate_async(
| _____________________________------------------------------------------------------------------___^
| | |
| | expected due to this
302 | | dynJackNotifications,
303 | | jack::ClosureProcessHandler::new(process_callback),
304 | | ).unwrap();
| |__________________^ expected trait object `dyn ProcessHandler`, found struct `ClosureProcessHandler`
|
= note: expected struct `AsyncClient<dyn NotificationHandler, dyn ProcessHandler>`
found struct `AsyncClient<_, ClosureProcessHandler<[closure@organelle/src/main.rs:216:32: 299:10]>>`
I have no idea what types to pass for the generic parameters N
and P
so that this code would compile.
We could do some nice ASCII art in the CLI as well, perhaps ...
Idea being:
+---------+
| p r |
| |
+---------+
Where p is play, r is record.
2 lines to show buffer A and B.
Currently audio on Organelle using 'cpal' does not work.
The issue seems to be that audio_host.input_devices()
returns an empty list; even though arecord -L
does not.
Can we function as a USB audio host, so audio out can be recorded direct into smartphone?
That would be nice :-)
Like how OP1 works.
Each MR should build and run tests, before merging.
Best approach might be migrate to Gitlab and use Gitlab CI.
I want to build for ARM devices, initially targetting Organelle 1.
Ideal approach might be to use rust-embedded/cross tool, which uses prebuilt Ubuntu containers to run Rust toolchain.
As of cross 0.2.1 (15/11/2021), the default command cross build --target armv7-unknown-linux-musleabihf
fails to build 'alsa-sys' crate because the sysroot doesn't contain libasound headers. Related issues:
The workaround is to use custom Docker images as a build base instead of the default ones, so we might build our own image and add this in Cross.toml:
[target.aarch64-unknown-linux-gnu]
image = "my/image:tag"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.