From 1b57e40afc8d1e028977241cf4caf257a3611010 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 2 Nov 2024 19:17:28 -0400 Subject: [PATCH 1/5] refactor --- ladspa/src/lib.rs | 131 +++++++++++++++++----------------------------- 1 file changed, 49 insertions(+), 82 deletions(-) diff --git a/ladspa/src/lib.rs b/ladspa/src/lib.rs index d05ad31d5..8ae0ad841 100644 --- a/ladspa/src/lib.rs +++ b/ladspa/src/lib.rs @@ -53,10 +53,7 @@ struct DfPlugin { control_tx: ControlProd, id: String, ch: usize, - sr: usize, frame_size: usize, - proc_delay: usize, - t_proc_change: usize, sleep_duration: Duration, control_hist: DfControlHistory, _h: JoinHandle<()>, // Worker thread handle @@ -112,9 +109,12 @@ fn get_worker_fn( ) -> impl FnMut() { move || { let mut df = unsafe { MODEL.clone().unwrap() }; - let mut inframe = Array2::zeros((df.ch, df.hop_size)); + let mut outframe = Array2::zeros((df.ch, df.hop_size)); let t_audio_ms = df.hop_size as f32 / df.sr as f32 * 1000.; + + let mut inframe_bufs = vec![]; + loop { if let Ok((c, v)) = controls.try_recv() { log::info!("DF {} | Setting '{}' to {:.1}", id, c, v); @@ -127,28 +127,59 @@ fn get_worker_fn( _ => (), } } - let got_samples = { + + let inframes = { let mut q = inqueue.lock().unwrap(); - if q[0].len() >= df.hop_size { + let mut inframes = vec![]; + while q[0].len() >= df.hop_size { + let mut inframe = + inframe_bufs.pop().unwrap_or_else(|| Array2::zeros((df.ch, df.hop_size))); + for (i_q_ch, mut i_ch) in q.iter_mut().zip(inframe.outer_iter_mut()) { for i in i_ch.iter_mut() { *i = i_q_ch.pop_front().unwrap(); } } - true - } else { - false + + inframes.push(inframe); } + inframes }; - if !got_samples { + + if inframes.is_empty() { sleep(sleep_duration); continue; } - let t0 = Instant::now(); - let lsnr = df - .process(inframe.view(), outframe.view_mut()) - .expect("Error during df::process"); - { + + for (i, inframe) in inframes.into_iter().enumerate() { + let t0 = Instant::now(); + + if i < 5 { + let lsnr = df + .process(inframe.view(), outframe.view_mut()) + .expect("Error during df::process"); + + let td_ms = t0.elapsed().as_secs_f32() * 1000.; + + log::debug!( + "DF {} | Enhanced {:.1}ms frame. SNR: {:>5.1}, Processing time: {:>4.1}ms, RTF: {:.2}", + id, + t_audio_ms, + lsnr, + td_ms, + td_ms / t_audio_ms + ); + } else { + log::info!( + "DF {} | Processing overloaded! Dropping {} samples", + id, + outframe.len_of(Axis(1)) + ); + outframe.fill(0.0); + } + + inframe_bufs.push(inframe); + let mut o_q = outqueue.lock().unwrap(); for (o_ch, o_q_ch) in outframe.outer_iter().zip(o_q.iter_mut()) { for &o in o_ch.iter() { @@ -156,15 +187,6 @@ fn get_worker_fn( } } } - let td_ms = t0.elapsed().as_secs_f32() * 1000.; - log::debug!( - "DF {} | Enhanced {:.1}ms frame. SNR: {:>5.1}, Processing time: {:>4.1}ms, RTF: {:.2}", - id, - t_audio_ms, - lsnr, - td_ms, - td_ms / t_audio_ms - ); } } } @@ -241,11 +263,8 @@ fn get_new_df(channels: usize) -> impl Fn(&PluginDescriptor, u64) -> DfPlugin { o_rx, control_tx, ch: channels, - sr: m_sr, id, frame_size, - proc_delay, - t_proc_change: 0, sleep_duration, control_hist: hist, _h: worker_handle, @@ -378,8 +397,6 @@ impl Plugin for DfPlugin { } } fn run<'a>(&mut self, sample_count: usize, ports: &[&'a PortConnection<'a>]) { - let t0 = Instant::now(); - let mut i = 0; let mut inputs = Vec::with_capacity(self.ch); let mut outputs = Vec::with_capacity(self.ch); @@ -431,61 +448,11 @@ impl Plugin for DfPlugin { sleep(self.sleep_duration); } - let td = t0.elapsed(); - let t_audio = sample_count as f32 / self.sr as f32; - let rtf = td.as_secs_f32() / t_audio; - if rtf >= 1. { - log::warn!( - "DF {} | Underrun detected (RTF: {:.2}). Processing too slow!", - self.id, - rtf - ); - if self.proc_delay >= self.sr { - panic!( - "DF {} | Processing too slow! Please upgrade your CPU. Try to decrease 'Max DF processing threshold (dB)'.", - self.id, - ); - } - self.proc_delay += self.frame_size; - self.t_proc_change = 0; - log::info!( - "DF {} | Increasing processing latency to {:.1}ms", - self.id, - self.proc_delay as f32 * 1000. / self.sr as f32 - ); - for o_ch in self.o_rx.lock().unwrap().iter_mut() { - for _ in 0..self.frame_size { - o_ch.push_back(0f32) - } - } - } else if self.t_proc_change > 10 * self.sr / self.frame_size - && rtf < 0.5 - && self.proc_delay - >= self.frame_size * (1 + self.control_hist.min_buffer_frames as usize) - { - // Reduce delay again - let dropped_samples = { - let o_q = &mut self.o_rx.lock().unwrap(); - if o_q[0].len() < self.frame_size { - false - } else { - for o_q_ch in o_q.iter_mut().take(self.frame_size) { - o_q_ch.pop_front().unwrap(); - } - true - } - }; - if dropped_samples { - self.proc_delay -= self.frame_size; - self.t_proc_change = 0; - log::info!( - "DF {} | Decreasing processing latency to {:.1}ms", - self.id, - self.proc_delay as f32 * 1000. / self.sr as f32 - ); + for o_ch in self.o_rx.lock().unwrap().iter_mut() { + for _ in 0..self.frame_size { + o_ch.push_back(0f32) } } - self.t_proc_change += 1; } } From e1df3516309f14b85c46ab10143f6c8e87234511 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 3 Nov 2024 23:09:17 -0500 Subject: [PATCH 2/5] fix memory leak --- Cargo.lock | 1319 ++++++++++++++++++++++----------------------- ladspa/src/lib.rs | 31 +- 2 files changed, 666 insertions(+), 684 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 886c82549..f7a82c868 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -62,6 +62,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", + "getrandom", "once_cell", "version_check", "zerocopy", @@ -111,20 +112,23 @@ dependencies = [ [[package]] name = "android-activity" -version = "0.4.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64529721f27c2314ced0890ce45e469574a73e5e6fdd6e9da1860eb29285f5e0" +checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289" dependencies = [ "android-properties", - "bitflags 1.3.2", + "bitflags 2.5.0", "cc", + "cesu8", + "jni", "jni-sys", "libc", "log", - "ndk 0.7.0", + "ndk", "ndk-context", - "ndk-sys 0.4.1+23.1.7779620", - "num_enum 0.6.1", + "ndk-sys", + "num_enum", + "thiserror", ] [[package]] @@ -227,6 +231,12 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "as-raw-xcb-connection" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" + [[package]] name = "ascii" version = "1.1.0" @@ -515,21 +525,30 @@ dependencies = [ [[package]] name = "block-sys" -version = "0.1.0-beta.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146" +checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" dependencies = [ "objc-sys", ] [[package]] name = "block2" -version = "0.2.0-alpha.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42" +checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68" dependencies = [ "block-sys", - "objc2-encode", + "objc2 0.4.1", +] + +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2 0.5.2", ] [[package]] @@ -590,20 +609,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" -[[package]] -name = "calloop" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e0d00eb1ea24371a97d2da6201c6747a633dc6dc1988ef503403b4c59504a8" -dependencies = [ - "bitflags 1.3.2", - "log", - "nix 0.25.1", - "slotmap", - "thiserror", - "vec_map 0.8.2", -] - [[package]] name = "calloop" version = "0.12.4" @@ -624,10 +629,10 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" dependencies = [ - "calloop 0.12.4", + "calloop", "rustix 0.38.34", - "wayland-backend 0.3.3", - "wayland-client 0.31.2", + "wayland-backend", + "wayland-client", ] [[package]] @@ -668,6 +673,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "clang-sys" version = "1.7.0" @@ -727,13 +738,11 @@ checksum = "4bfbf56724aa9eca8afa4fcfadeb479e722935bb2a0900c2d37e0cc477af0688" [[package]] name = "clipboard-win" -version = "4.5.0" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362" +checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" dependencies = [ "error-code", - "str-buf", - "winapi", ] [[package]] @@ -763,7 +772,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4274ea815e013e0f9f04a2633423e14194e408a0576c943ce3d14ca56c50031c" dependencies = [ "thiserror", - "x11rb 0.13.1", + "x11rb", ] [[package]] @@ -775,36 +784,6 @@ dependencies = [ "cc", ] -[[package]] -name = "cocoa" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" -dependencies = [ - "bitflags 1.3.2", - "block", - "cocoa-foundation", - "core-foundation", - "core-graphics", - "foreign-types", - "libc", - "objc", -] - -[[package]] -name = "cocoa-foundation" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" -dependencies = [ - "bitflags 1.3.2", - "block", - "core-foundation", - "core-graphics-types", - "libc", - "objc", -] - [[package]] name = "codespan-reporting" version = "0.11.1" @@ -828,10 +807,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] -name = "com-rs" -version = "0.2.1" +name = "com" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" +checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6" +dependencies = [ + "com_macros", +] + +[[package]] +name = "com_macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5" +dependencies = [ + "com_macros_support", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "com_macros_support" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] name = "combine" @@ -900,9 +904,9 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core-graphics" -version = "0.22.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -944,16 +948,17 @@ dependencies = [ [[package]] name = "cosmic-text" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0b68966c2543609f8d92f9d33ac3b719b2a67529b0c6c0b3e025637b477eef9" +checksum = "75acbfb314aeb4f5210d379af45ed1ec2c98c7f1790bf57b8a4c562ac0c51b71" dependencies = [ - "aliasable", "fontdb", "libm", "log", "rangemap", + "rustc-hash", "rustybuzz", + "self_cell", "swash", "sys-locale", "unicode-bidi", @@ -976,7 +981,7 @@ dependencies = [ "js-sys", "libc", "mach2", - "ndk 0.8.0", + "ndk", "ndk-context", "oboe", "wasm-bindgen", @@ -1053,6 +1058,12 @@ dependencies = [ "typenum", ] +[[package]] +name = "ctor-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f791803201ab277ace03903de1594460708d2d54df6053f2d9e82f592b19e3b" + [[package]] name = "ctrlc" version = "3.4.4" @@ -1071,12 +1082,12 @@ checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" [[package]] name = "d3d12" -version = "0.6.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f0de2f5a8e7bd4a9eec0e3c781992a4ce1724f68aec7d7a3715344de8b39da" +checksum = "3e3d747f100290a1ca24b752186f61f6637e1deffe3bf6320de6fcb29510a307" dependencies = [ - "bitflags 1.3.2", - "libloading 0.7.4", + "bitflags 2.5.0", + "libloading 0.8.3", "winapi", ] @@ -1130,7 +1141,7 @@ dependencies = [ "realfft", "roots", "rstest", - "rubato", + "rubato 0.14.1", "rust-ini", "rustfft", "serde", @@ -1187,11 +1198,11 @@ dependencies = [ "env_logger 0.10.2", "iced", "image", - "itertools 0.11.0", + "itertools 0.12.1", "log", "ndarray", "ringbuf", - "rubato", + "rubato 0.15.0", ] [[package]] @@ -1240,6 +1251,45 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" +[[package]] +name = "drm" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98888c4bbd601524c11a7ed63f814b8825f420514f78e96f752c437ae9cbb5d1" +dependencies = [ + "bitflags 2.5.0", + "bytemuck", + "drm-ffi", + "drm-fourcc", + "rustix 0.38.34", +] + +[[package]] +name = "drm-ffi" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97c98727e48b7ccb4f4aea8cfe881e5b07f702d17b7875991881b41af7278d53" +dependencies = [ + "drm-sys", + "rustix 0.38.34", +] + +[[package]] +name = "drm-fourcc" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4" + +[[package]] +name = "drm-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd39dde40b6e196c2e8763f23d119ddb1a8714534bf7d77fa97a65b0feda3986" +dependencies = [ + "libc", + "linux-raw-sys 0.6.5", +] + [[package]] name = "dyn-clone" version = "1.0.17" @@ -1327,13 +1377,9 @@ dependencies = [ [[package]] name = "error-code" -version = "2.3.1" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64f18991e7bf11e7ffee451b5318b5c1a73c52d0d0ada6e5a3017c8c1ced6a21" -dependencies = [ - "libc", - "str-buf", -] +checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f" [[package]] name = "etagere" @@ -1490,6 +1536,12 @@ dependencies = [ "spin", ] +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "font-types" version = "0.5.3" @@ -1499,14 +1551,24 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "fontconfig-parser" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1fcfcd44ca6e90c921fee9fa665d530b21ef1327a4c1a6c5250ea44b776ada7" +dependencies = [ + "roxmltree", +] + [[package]] name = "fontdb" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8d8cbea8f21307d7e84bca254772981296f058a1d36b461bf4d83a7499fc9e" +checksum = "020e203f177c0fb250fb19455a252e838d2bbbce1f80f25ecc42402aafa8cd38" dependencies = [ + "fontconfig-parser", "log", - "memmap2 0.6.2", + "memmap2 0.8.0", "slotmap", "tinyvec", "ttf-parser 0.19.2", @@ -1514,18 +1576,30 @@ dependencies = [ [[package]] name = "foreign-types" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" dependencies = [ + "foreign-types-macros", "foreign-types-shared", ] +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "foreign-types-shared" -version = "0.1.1" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "futures" @@ -1661,16 +1735,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "gethostname" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "gethostname" version = "0.4.3" @@ -1710,11 +1774,22 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + [[package]] name = "glam" -version = "0.24.2" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5418c17512bdf42730f9032c74e1ae39afc408745ebb2acf72fbc4691c17945" +checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" [[package]] name = "glob" @@ -1724,9 +1799,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "glow" -version = "0.12.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0fe580e4b60a8ab24a868bc08e2f03cbcb20d3d676601fa909386713333728" +checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" dependencies = [ "js-sys", "slotmap", @@ -1734,11 +1809,20 @@ dependencies = [ "web-sys", ] +[[package]] +name = "glutin_wgl_sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8098adac955faa2d31079b65dc48841251f69efd3ac25477903fc424362ead" +dependencies = [ + "gl_generator", +] + [[package]] name = "glyphon" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e87caa7459145f5e5f167bf34db4532901404c679e62339fb712a0e3ccf722a" +checksum = "6a62d0338e4056db6a73221c2fb2e30619452f6ea9651bac4110f51b0f7a7581" dependencies = [ "cosmic-text", "etagere", @@ -1748,34 +1832,34 @@ dependencies = [ [[package]] name = "gpu-alloc" -version = "0.5.4" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22beaafc29b38204457ea030f6fb7a84c9e4dd1b86e311ba0542533453d87f62" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "gpu-alloc-types", ] [[package]] name = "gpu-alloc-types" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", ] [[package]] name = "gpu-allocator" -version = "0.22.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce95f9e2e11c2c6fadfce42b5af60005db06576f231f5c92550fdded43c423e8" +checksum = "6f56f6318968d03c18e1bcf4857ff88c61157e9da8e47c5f29055d60e1228884" dependencies = [ - "backtrace", "log", + "presser", "thiserror", "winapi", - "windows 0.44.0", + "windows 0.52.0", ] [[package]] @@ -1821,30 +1905,35 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" dependencies = [ - "ahash", "allocator-api2", + "equivalent", + "foldhash", ] [[package]] name = "hassle-rs" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1397650ee315e8891a0df210707f0fc61771b0cc518c3023896064c5407cb3b0" +checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" dependencies = [ - "bitflags 1.3.2", - "com-rs", + "bitflags 2.5.0", + "com", "libc", - "libloading 0.7.4", + "libloading 0.8.3", "thiserror", "widestring", "winapi", @@ -1956,9 +2045,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "iced" -version = "0.10.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c708807ec86f99dd729dc4d42db5239acf118cec14d3c5f57679dcfdbbc472b1" +checksum = "7d4eb0fbbefb8c428b70680e77ed9013887b17c1d6be366b40f264f956d1a096" dependencies = [ "iced_core", "iced_futures", @@ -1971,23 +2060,27 @@ dependencies = [ [[package]] name = "iced_core" -version = "0.10.0" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d0bc4fbf018576d08d93f838e6058cc6f10bbc05e04ae249a2a44dffb4ebc8" +checksum = "7d7e6bbd197f311ed3d8b71651876b0ce01318fde52cda862a9a7a4373c9b930" dependencies = [ - "bitflags 1.3.2", - "instant", + "bitflags 2.5.0", + "glam", "log", + "num-traits", "palette", + "raw-window-handle", + "smol_str", "thiserror", - "twox-hash", + "web-time", + "xxhash-rust", ] [[package]] name = "iced_futures" -version = "0.7.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14dab0054a9c7a1cbce227a8cd9ee4a094497b3d06094551ac6c1488d563802e" +checksum = "370bad88fb3832cbeeb3fa6c486b4701fb7e8da32a753b3101d4ce81fc1d9497" dependencies = [ "futures", "iced_core", @@ -1999,52 +2092,57 @@ dependencies = [ [[package]] name = "iced_graphics" -version = "0.9.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ff14447a221e9e9205a13d84d7bbdf0636a3b1daa02cfca690ed09689c4d2b" +checksum = "6a044c193ef0840eacabfa05424717331d1fc5b3ecb9a89316200c75da2ba9a4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "bytemuck", - "glam", + "cosmic-text", "half", "iced_core", + "iced_futures", "image", "kamadak-exif", "log", + "once_cell", "raw-window-handle", + "rustc-hash", "thiserror", + "unicode-segmentation", + "xxhash-rust", ] [[package]] name = "iced_renderer" -version = "0.1.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1033385b0db0099a0d13178c9ff93c1ce11e7d0177522acf578bf79febdb2af8" +checksum = "5c281e03001d566058f53dec9325bbe61c62da715341206d2627f57a3ecc7f69" dependencies = [ "iced_graphics", "iced_tiny_skia", "iced_wgpu", "log", - "raw-window-handle", "thiserror", ] [[package]] name = "iced_runtime" -version = "0.1.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c6c89853e1250c6fac82c5015fa2144517be9b33d4b8e456f10e198b23e28bd" +checksum = "a79f852c01cc6d61663c94379cb3974ac3ad315a28c504e847d573e094f46822" dependencies = [ "iced_core", "iced_futures", + "raw-window-handle", "thiserror", ] [[package]] name = "iced_style" -version = "0.9.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d85c47d9d13e2281f75ddf98c865daf2101632bd2b855c401dd0b1c8b81a31a0" +checksum = "2ea42a740915d2a5a9ff9c3aa0bca28b16e9fb660bc8f675eed71d186cadb579" dependencies = [ "iced_core", "once_cell", @@ -2053,29 +2151,28 @@ dependencies = [ [[package]] name = "iced_tiny_skia" -version = "0.1.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7715f6222c9470bbbd75a39f70478fa0d1bdfb81a377a34fd1b090ffccc480b" +checksum = "8c2228781f4d381a1cbbd7905a9f077351aa8d37269094021d5d9e779f130aff" dependencies = [ "bytemuck", "cosmic-text", "iced_graphics", "kurbo", "log", - "raw-window-handle", "rustc-hash", "softbuffer", - "tiny-skia 0.10.0", - "twox-hash", + "tiny-skia", + "xxhash-rust", ] [[package]] name = "iced_wgpu" -version = "0.11.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703f7c5de46b997ed7b18e05ec67059dcdf3beeac51e917c21071b021bb848b9" +checksum = "e3c243b6700452886aac1ee1987e84d9fb43b56b53fea9a1eb67713fd0fde244" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "bytemuck", "futures", "glam", @@ -2084,17 +2181,14 @@ dependencies = [ "iced_graphics", "log", "once_cell", - "raw-window-handle", - "rustc-hash", - "twox-hash", "wgpu", ] [[package]] name = "iced_widget" -version = "0.1.3" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a177219ae51c3ba08f228ab932354b360cc669e94aec50c01e7c9b675f074c7c" +checksum = "7e01b2212adecf1cb80e2267f302c0e0c263e55f97812056949199ccf9f0b908" dependencies = [ "iced_renderer", "iced_runtime", @@ -2107,22 +2201,33 @@ dependencies = [ [[package]] name = "iced_winit" -version = "0.10.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0c884bcb14722a57192b40a5ef6b5e170fa2f01fe2ff28d6cdd9efe37acf70" +checksum = "63f66831d0e399b93f631739121a6171780d344b275d56808b9504d8ca75c7d2" dependencies = [ "iced_graphics", "iced_runtime", "iced_style", "log", - "raw-window-handle", "thiserror", + "tracing", "web-sys", "winapi", "window_clipboard", "winit", ] +[[package]] +name = "icrate" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319" +dependencies = [ + "block2 0.3.0", + "dispatch", + "objc2 0.4.1", +] + [[package]] name = "image" version = "0.24.9" @@ -2141,16 +2246,6 @@ dependencies = [ "tiff", ] -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - [[package]] name = "indexmap" version = "2.2.6" @@ -2174,9 +2269,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", ] [[package]] @@ -2216,15 +2308,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.12.1" @@ -2320,15 +2403,21 @@ dependencies = [ [[package]] name = "khronos-egl" -version = "4.1.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", - "libloading 0.7.4", + "libloading 0.8.3", "pkg-config", ] +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + [[package]] name = "kstring" version = "2.0.0" @@ -2341,11 +2430,12 @@ dependencies = [ [[package]] name = "kurbo" -version = "0.9.5" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd85a5776cd9500c2e2059c8c76c3b01528566b7fcbaf8098b55a33fc298849b" +checksum = "1618d4ebd923e97d67e7cd363d80aef35fe961005cbbbb3d2dad8bdd1bc63440" dependencies = [ "arrayvec", + "smallvec", ] [[package]] @@ -2356,7 +2446,7 @@ checksum = "6197e2fb8a3da99eca216e9689b47465b23cfe09e1a1ddc720fa1acdd54aa267" dependencies = [ "bitflags 0.8.2", "libc", - "vec_map 0.7.0", + "vec_map", ] [[package]] @@ -2443,6 +2533,12 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +[[package]] +name = "linux-raw-sys" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a385b1be4e5c3e362ad2ffa73c392e53f031eaa5b7d648e64cd87f27f6063d7" + [[package]] name = "liquid" version = "0.26.4" @@ -2518,11 +2614,11 @@ checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "lru" -version = "0.11.1" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a83fb7698b3643a0e34f9ae6f2e8f0178c0fd42f8b59d493aa271ff3a5bf21" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.15.0", ] [[package]] @@ -2567,18 +2663,9 @@ checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memmap2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" -dependencies = [ - "libc", -] - -[[package]] -name = "memmap2" -version = "0.6.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" +checksum = "43a5a03cefb0d953ec0be133036f14e109412fa594edc2f77227249db66cc3ed" dependencies = [ "libc", ] @@ -2592,15 +2679,6 @@ dependencies = [ "libc", ] -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.7.1" @@ -2621,16 +2699,17 @@ dependencies = [ [[package]] name = "metal" -version = "0.24.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" +checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "block", "core-graphics-types", "foreign-types", "log", "objc", + "paste", ] [[package]] @@ -2649,18 +2728,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "log", - "wasi", - "windows-sys 0.48.0", -] - [[package]] name = "mutate_once" version = "0.1.1" @@ -2669,15 +2736,15 @@ checksum = "16cf681a23b4d0a43fc35024c176437f9dcd818db34e0f42ab456a0ee5ad497b" [[package]] name = "naga" -version = "0.12.3" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbcc2e0513220fd2b598e6068608d4462db20322c0e77e47f6f488dfcfc279cb" +checksum = "50e3524642f53d9af419ab5e8dd29d3ba155708267667c2f3f06c88c9e130843" dependencies = [ "bit-set", - "bitflags 1.3.2", + "bitflags 2.5.0", "codespan-reporting", "hexf-parse", - "indexmap 1.9.3", + "indexmap", "log", "num-traits", "rustc-hash", @@ -2712,20 +2779,6 @@ dependencies = [ "rand_distr", ] -[[package]] -name = "ndk" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" -dependencies = [ - "bitflags 1.3.2", - "jni-sys", - "ndk-sys 0.4.1+23.1.7779620", - "num_enum 0.5.11", - "raw-window-handle", - "thiserror", -] - [[package]] name = "ndk" version = "0.8.0" @@ -2735,8 +2788,9 @@ dependencies = [ "bitflags 2.5.0", "jni-sys", "log", - "ndk-sys 0.5.0+25.2.9519653", - "num_enum 0.7.2", + "ndk-sys", + "num_enum", + "raw-window-handle", "thiserror", ] @@ -2746,15 +2800,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" -[[package]] -name = "ndk-sys" -version = "0.4.1+23.1.7779620" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" -dependencies = [ - "jni-sys", -] - [[package]] name = "ndk-sys" version = "0.5.0+25.2.9519653" @@ -2764,31 +2809,6 @@ dependencies = [ "jni-sys", ] -[[package]] -name = "nix" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.6.5", -] - -[[package]] -name = "nix" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.6.5", -] - [[package]] name = "nix" version = "0.26.4" @@ -2799,7 +2819,6 @@ dependencies = [ "cfg-if", "libc", "memoffset 0.7.1", - "pin-utils", ] [[package]] @@ -2810,7 +2829,7 @@ checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ "bitflags 2.5.0", "cfg-if", - "cfg_aliases", + "cfg_aliases 0.1.1", "libc", ] @@ -2880,55 +2899,13 @@ dependencies = [ "libc", ] -[[package]] -name = "num_enum" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" -dependencies = [ - "num_enum_derive 0.5.11", -] - -[[package]] -name = "num_enum" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" -dependencies = [ - "num_enum_derive 0.6.1", -] - [[package]] name = "num_enum" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ - "num_enum_derive 0.7.2", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "num_enum_derive" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 2.0.60", + "num_enum_derive", ] [[package]] @@ -2981,28 +2958,118 @@ dependencies = [ [[package]] name = "objc-sys" -version = "0.2.0-beta.2" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" [[package]] name = "objc2" -version = "0.3.0-beta.3.patch-leaks.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" +checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d" dependencies = [ - "block2", "objc-sys", - "objc2-encode", + "objc2-encode 3.0.0", ] [[package]] -name = "objc2-encode" -version = "2.0.0-pre.2" +name = "objc2" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" dependencies = [ "objc-sys", + "objc2-encode 4.0.3", +] + +[[package]] +name = "objc2-app-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" +dependencies = [ + "bitflags 2.5.0", + "block2 0.5.1", + "libc", + "objc2 0.5.2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation", + "objc2-quartz-core", +] + +[[package]] +name = "objc2-core-data" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" +dependencies = [ + "bitflags 2.5.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-encode" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666" + +[[package]] +name = "objc2-encode" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.5.0", + "block2 0.5.1", + "dispatch", + "libc", + "objc2 0.5.2", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.5.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.5.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation", + "objc2-metal", ] [[package]] @@ -3039,7 +3106,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8b61bebd49e5d43f5f8cc7ee2891c16e0f41ec7954d36bcb6c14c5e0de867fb" dependencies = [ "jni", - "ndk 0.8.0", + "ndk", "ndk-context", "num-derive", "num-traits", @@ -3101,9 +3168,9 @@ dependencies = [ [[package]] name = "ouroboros" -version = "0.17.2" +version = "0.18.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2ba07320d39dfea882faa70554b4bd342a5f273ed59ba7c1c6b4c840492c954" +checksum = "944fa20996a25aded6b4795c6d63f10014a7a83f8be9828a11860b08c5fc4a67" dependencies = [ "aliasable", "ouroboros_macro", @@ -3112,13 +3179,14 @@ dependencies = [ [[package]] name = "ouroboros_macro" -version = "0.17.2" +version = "0.18.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec4c6225c69b4ca778c0aea097321a64c421cf4577b331c61b229267edabb6f8" +checksum = "39b0deead1528fd0e5947a8546a9642a9777c25f6e1e26f34c97b204bbb465bd" dependencies = [ "heck 0.4.1", - "proc-macro-error", + "itertools 0.12.1", "proc-macro2", + "proc-macro2-diagnostics", "quote", "syn 2.0.60", ] @@ -3400,6 +3468,12 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "presser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + [[package]] name = "primal-check" version = "0.3.3" @@ -3437,7 +3511,6 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.109", "version_check", ] @@ -3461,6 +3534,19 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "proc-macro2-diagnostics" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", + "version_check", + "yansi", +] + [[package]] name = "profiling" version = "1.0.15" @@ -3562,15 +3648,6 @@ dependencies = [ "bytemuck", ] -[[package]] -name = "quick-xml" -version = "0.28.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" -dependencies = [ - "memchr", -] - [[package]] name = "quick-xml" version = "0.31.0" @@ -3652,9 +3729,9 @@ checksum = "f60fcc7d6849342eff22c4350c8b9a989ee8ceabc4b481253e8946b9fe83d684" [[package]] name = "raw-window-handle" -version = "0.5.2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" [[package]] name = "rawpointer" @@ -3793,6 +3870,12 @@ version = "0.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c36d2bbc763f480668d6d6790ae2fdd2e52ac0c21a3a26d156f3534a3d9eea9" +[[package]] +name = "roxmltree" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" + [[package]] name = "rstest" version = "0.19.0" @@ -3834,6 +3917,18 @@ dependencies = [ "realfft", ] +[[package]] +name = "rubato" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5d18b486e7d29a408ef3f825bc1327d8f87af091c987ca2f5b734625940e234" +dependencies = [ + "num-complex", + "num-integer", + "num-traits", + "realfft", +] + [[package]] name = "rust-ini" version = "0.21.0" @@ -3910,18 +4005,18 @@ dependencies = [ [[package]] name = "rustybuzz" -version = "0.8.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82eea22c8f56965eeaf3a209b3d24508256c7b920fb3b6211b8ba0f7c0583250" +checksum = "2ee8fe2a8461a0854a37101fe7a1b13998d0cfa987e43248e81d2a5f4570f6fa" dependencies = [ "bitflags 1.3.2", "bytemuck", "libm", "smallvec", - "ttf-parser 0.19.2", + "ttf-parser 0.20.0", "unicode-bidi-mirroring", "unicode-ccc", - "unicode-general-category", + "unicode-properties", "unicode-script", ] @@ -3963,17 +4058,23 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sctk-adwaita" -version = "0.5.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda4e97be1fd174ccc2aae81c8b694e803fa99b34e8fd0f057a9d70698e3ed09" +checksum = "70b31447ca297092c5a9916fc3b955203157b37c19ca8edde4f52e9843e602c7" dependencies = [ "ab_glyph", "log", - "memmap2 0.5.10", - "smithay-client-toolkit 0.16.1", - "tiny-skia 0.8.4", + "memmap2 0.9.4", + "smithay-client-toolkit", + "tiny-skia", ] +[[package]] +name = "self_cell" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" + [[package]] name = "semver" version = "1.0.22" @@ -4095,25 +4196,6 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[package]] -name = "smithay-client-toolkit" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870427e30b8f2cbe64bf43ec4b86e88fe39b0a84b3f15efd9c9c2d020bc86eb9" -dependencies = [ - "bitflags 1.3.2", - "calloop 0.10.6", - "dlib", - "lazy_static", - "log", - "memmap2 0.5.10", - "nix 0.24.3", - "pkg-config", - "wayland-client 0.29.5", - "wayland-cursor 0.29.5", - "wayland-protocols 0.29.5", -] - [[package]] name = "smithay-client-toolkit" version = "0.18.1" @@ -4121,7 +4203,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" dependencies = [ "bitflags 2.5.0", - "calloop 0.12.4", + "calloop", "calloop-wayland-source", "cursor-icon", "libc", @@ -4129,13 +4211,13 @@ dependencies = [ "memmap2 0.9.4", "rustix 0.38.34", "thiserror", - "wayland-backend 0.3.3", - "wayland-client 0.31.2", + "wayland-backend", + "wayland-client", "wayland-csd-frame", - "wayland-cursor 0.31.1", - "wayland-protocols 0.31.2", + "wayland-cursor", + "wayland-protocols", "wayland-protocols-wlr", - "wayland-scanner 0.31.1", + "wayland-scanner", "xkeysym", ] @@ -4146,8 +4228,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c091e7354ea8059d6ad99eace06dd13ddeedbb0ac72d40a9a6e7ff790525882d" dependencies = [ "libc", - "smithay-client-toolkit 0.18.1", - "wayland-backend 0.3.3", + "smithay-client-toolkit", + "wayland-backend", +] + +[[package]] +name = "smol_str" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" +dependencies = [ + "serde", ] [[package]] @@ -4162,30 +4253,35 @@ dependencies = [ [[package]] name = "softbuffer" -version = "0.2.1" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2b953f6ba7285f0af131eb748aabd8ddaf53e0b81dda3ba5d803b0847d6559f" +checksum = "d623bff5d06f60d738990980d782c8c866997d9194cfe79ecad00aa2f76826dd" dependencies = [ + "as-raw-xcb-connection", "bytemuck", - "cfg_aliases", - "cocoa", + "cfg_aliases 0.2.1", "core-graphics", - "fastrand 1.9.0", + "drm", + "fastrand 2.1.0", "foreign-types", + "js-sys", "log", - "nix 0.26.4", - "objc", + "memmap2 0.9.4", + "objc2 0.5.2", + "objc2-app-kit", + "objc2-foundation", + "objc2-quartz-core", "raw-window-handle", - "redox_syscall 0.3.5", - "thiserror", + "redox_syscall 0.5.1", + "rustix 0.38.34", + "tiny-xlib", "wasm-bindgen", - "wayland-backend 0.1.2", - "wayland-client 0.30.2", - "wayland-sys 0.30.1", + "wayland-backend", + "wayland-client", + "wayland-sys", "web-sys", - "windows-sys 0.48.0", - "x11-dl", - "x11rb 0.11.1", + "windows-sys 0.52.0", + "x11rb", ] [[package]] @@ -4199,12 +4295,11 @@ dependencies = [ [[package]] name = "spirv" -version = "0.2.0+1.5.4" +version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "bitflags 1.3.2", - "num-traits", + "bitflags 2.5.0", ] [[package]] @@ -4213,12 +4308,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "str-buf" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0" - [[package]] name = "strength_reduce" version = "0.2.4" @@ -4407,23 +4496,9 @@ dependencies = [ [[package]] name = "tiny-skia" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8493a203431061e901613751931f047d1971337153f96d0e5e363d6dbf6a67" -dependencies = [ - "arrayref", - "arrayvec", - "bytemuck", - "cfg-if", - "png", - "tiny-skia-path 0.8.4", -] - -[[package]] -name = "tiny-skia" -version = "0.10.0" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7db11798945fa5c3e5490c794ccca7c6de86d3afdd54b4eb324109939c6f37bc" +checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab" dependencies = [ "arrayref", "arrayvec", @@ -4431,14 +4506,14 @@ dependencies = [ "cfg-if", "log", "png", - "tiny-skia-path 0.10.0", + "tiny-skia-path", ] [[package]] name = "tiny-skia-path" -version = "0.8.4" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adbfb5d3f3dd57a0e11d12f4f13d4ebbbc1b5c15b7ab0a156d030b21da5f677c" +checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93" dependencies = [ "arrayref", "bytemuck", @@ -4446,14 +4521,16 @@ dependencies = [ ] [[package]] -name = "tiny-skia-path" -version = "0.10.0" +name = "tiny-xlib" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f60aa35c89ac2687ace1a2556eaaea68e8c0d47408a2e3e7f5c98a489e7281c" +checksum = "1d52f22673960ad13af14ff4025997312def1223bfa7c8e4949d099e6b3d5d1c" dependencies = [ - "arrayref", - "bytemuck", - "strict-num", + "as-raw-xcb-connection", + "ctor-lite", + "libloading 0.8.3", + "pkg-config", + "tracing", ] [[package]] @@ -4494,7 +4571,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.6", + "indexmap", "toml_datetime", "winnow", ] @@ -4505,7 +4582,7 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.2.6", + "indexmap", "toml_datetime", "winnow", ] @@ -4720,17 +4797,6 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "rand", - "static_assertions", -] - [[package]] name = "typenum" version = "1.17.0" @@ -4772,12 +4838,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc2520efa644f8268dce4dcd3050eaa7fc044fca03961e9998ac7e2e92b77cf1" -[[package]] -name = "unicode-general-category" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2281c8c1d221438e373249e065ca4989c4c36952c211ff21a0ee91c44a3869e7" - [[package]] name = "unicode-ident" version = "1.0.12" @@ -4799,6 +4859,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-properties" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" + [[package]] name = "unicode-script" version = "0.5.6" @@ -4851,12 +4917,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8cdc8b93bd0198ed872357fb2e667f7125646b1762f16d60b2c96350d361897" -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version_check" version = "0.9.4" @@ -4966,21 +5026,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "wayland-backend" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41b48e27457e8da3b2260ac60d0a94512f5cba36448679f3747c0865b7893ed8" -dependencies = [ - "cc", - "downcast-rs", - "io-lifetimes", - "nix 0.26.4", - "scoped-tls", - "smallvec", - "wayland-sys 0.30.1", -] - [[package]] name = "wayland-backend" version = "0.3.3" @@ -4992,35 +5037,7 @@ dependencies = [ "rustix 0.38.34", "scoped-tls", "smallvec", - "wayland-sys 0.31.1", -] - -[[package]] -name = "wayland-client" -version = "0.29.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f3b068c05a039c9f755f881dc50f01732214f5685e379829759088967c46715" -dependencies = [ - "bitflags 1.3.2", - "downcast-rs", - "libc", - "nix 0.24.3", - "scoped-tls", - "wayland-commons", - "wayland-scanner 0.29.5", - "wayland-sys 0.29.5", -] - -[[package]] -name = "wayland-client" -version = "0.30.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489c9654770f674fc7e266b3c579f4053d7551df0ceb392f153adb1f9ed06ac8" -dependencies = [ - "bitflags 1.3.2", - "nix 0.26.4", - "wayland-backend 0.1.2", - "wayland-scanner 0.30.1", + "wayland-sys", ] [[package]] @@ -5031,20 +5048,8 @@ checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f" dependencies = [ "bitflags 2.5.0", "rustix 0.38.34", - "wayland-backend 0.3.3", - "wayland-scanner 0.31.1", -] - -[[package]] -name = "wayland-commons" -version = "0.29.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8691f134d584a33a6606d9d717b95c4fa20065605f798a3f350d78dced02a902" -dependencies = [ - "nix 0.24.3", - "once_cell", - "smallvec", - "wayland-sys 0.29.5", + "wayland-backend", + "wayland-scanner", ] [[package]] @@ -5055,18 +5060,7 @@ checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ "bitflags 2.5.0", "cursor-icon", - "wayland-backend 0.3.3", -] - -[[package]] -name = "wayland-cursor" -version = "0.29.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6865c6b66f13d6257bef1cd40cbfe8ef2f150fb8ebbdb1e8e873455931377661" -dependencies = [ - "nix 0.24.3", - "wayland-client 0.29.5", - "xcursor", + "wayland-backend", ] [[package]] @@ -5076,22 +5070,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba" dependencies = [ "rustix 0.38.34", - "wayland-client 0.31.2", + "wayland-client", "xcursor", ] -[[package]] -name = "wayland-protocols" -version = "0.29.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b950621f9354b322ee817a23474e479b34be96c2e909c14f7bc0100e9a970bc6" -dependencies = [ - "bitflags 1.3.2", - "wayland-client 0.29.5", - "wayland-commons", - "wayland-scanner 0.29.5", -] - [[package]] name = "wayland-protocols" version = "0.31.2" @@ -5099,44 +5081,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" dependencies = [ "bitflags 2.5.0", - "wayland-backend 0.3.3", - "wayland-client 0.31.2", - "wayland-scanner 0.31.1", + "wayland-backend", + "wayland-client", + "wayland-scanner", ] [[package]] -name = "wayland-protocols-wlr" +name = "wayland-protocols-plasma" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" +checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" dependencies = [ "bitflags 2.5.0", - "wayland-backend 0.3.3", - "wayland-client 0.31.2", - "wayland-protocols 0.31.2", - "wayland-scanner 0.31.1", -] - -[[package]] -name = "wayland-scanner" -version = "0.29.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4303d8fa22ab852f789e75a967f0a2cdc430a607751c0499bada3e451cbd53" -dependencies = [ - "proc-macro2", - "quote", - "xml-rs", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", ] [[package]] -name = "wayland-scanner" -version = "0.30.1" +name = "wayland-protocols-wlr" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b873b257fbc32ec909c0eb80dea312076a67014e65e245f5eb69a6b8ab330e" +checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" dependencies = [ - "proc-macro2", - "quick-xml 0.28.2", - "quote", + "bitflags 2.5.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", ] [[package]] @@ -5146,50 +5119,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63b3a62929287001986fb58c789dce9b67604a397c15c611ad9f747300b6c283" dependencies = [ "proc-macro2", - "quick-xml 0.31.0", + "quick-xml", "quote", ] [[package]] name = "wayland-sys" -version = "0.29.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be12ce1a3c39ec7dba25594b97b42cb3195d54953ddb9d3d95a7c3902bc6e9d4" -dependencies = [ - "dlib", - "lazy_static", - "pkg-config", -] - -[[package]] -name = "wayland-sys" -version = "0.30.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b2a02ac608e07132978689a6f9bf4214949c85998c247abadd4f4129b1aa06" +checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" dependencies = [ "dlib", - "lazy_static", "log", + "once_cell", "pkg-config", ] [[package]] -name = "wayland-sys" -version = "0.31.1" +name = "web-sys" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ - "dlib", - "log", - "once_cell", - "pkg-config", + "js-sys", + "wasm-bindgen", ] [[package]] -name = "web-sys" -version = "0.3.69" +name = "web-time" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" dependencies = [ "js-sys", "wasm-bindgen", @@ -5203,12 +5163,13 @@ checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "wgpu" -version = "0.16.3" +version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "480c965c9306872eb6255fa55e4b4953be55a8b64d57e61d7ff840d3dcc051cd" +checksum = "cbd7311dbd2abcfebaabf1841a2824ed7c8be443a0f29166e5d3c6a53a762c01" dependencies = [ "arrayvec", "cfg-if", + "cfg_aliases 0.1.1", "js-sys", "log", "naga", @@ -5227,16 +5188,19 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.16.1" +version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f478237b4bf0d5b70a39898a66fa67ca3a007d79f2520485b8b0c3dfc46f8c2" +checksum = "28b94525fc99ba9e5c9a9e24764f2bc29bad0911a7446c12f446a8277369bf3a" dependencies = [ "arrayvec", "bit-vec", "bitflags 2.5.0", + "cfg_aliases 0.1.1", "codespan-reporting", + "indexmap", "log", "naga", + "once_cell", "parking_lot 0.12.2", "profiling", "raw-window-handle", @@ -5250,9 +5214,9 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.16.2" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecb3258078e936deee14fd4e0febe1cfe9bbb5ffef165cb60218d2ee5eb4448" +checksum = "bfabcfc55fd86611a855816326b2d54c3b2fd7972c27ce414291562650552703" dependencies = [ "android_system_properties", "arrayvec", @@ -5260,10 +5224,11 @@ dependencies = [ "bit-set", "bitflags 2.5.0", "block", + "cfg_aliases 0.1.1", "core-graphics-types", "d3d12", - "foreign-types", "glow", + "glutin_wgl_sys", "gpu-alloc", "gpu-allocator", "gpu-descriptor", @@ -5275,7 +5240,9 @@ dependencies = [ "log", "metal", "naga", + "ndk-sys", "objc", + "once_cell", "parking_lot 0.12.2", "profiling", "range-alloc", @@ -5292,9 +5259,9 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.16.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c153280bb108c2979eb5c7391cb18c56642dd3c072e55f52065e13e2a1252a" +checksum = "b671ff9fb03f78b46ff176494ee1ebe7d603393f42664be55b64dc8d53969805" dependencies = [ "bitflags 2.5.0", "js-sys", @@ -5332,15 +5299,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "winapi-wsapoll" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1eafc5f679c576995526e81635d0cf9695841736712b4e892f87abbe6fed3f28" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -5349,9 +5307,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "window_clipboard" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63287c9c4396ccf5346d035a9b0fcaead9e18377637f5eaa78b7ac65c873ff7d" +checksum = "f6d692d46038c433f9daee7ad8757e002a4248c20b0a3fbc991d99521d3bcb6d" dependencies = [ "clipboard-win", "clipboard_macos", @@ -5363,11 +5321,12 @@ dependencies = [ [[package]] name = "windows" -version = "0.44.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-targets 0.42.2", + "windows-core 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -5376,7 +5335,16 @@ version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" dependencies = [ - "windows-core", + "windows-core 0.54.0", + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ "windows-targets 0.52.5", ] @@ -5606,37 +5574,50 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winit" -version = "0.28.7" +version = "0.29.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9596d90b45384f5281384ab204224876e8e8bf7d58366d9b795ad99aa9894b94" +checksum = "0d59ad965a635657faf09c8f062badd885748428933dad8e8bdd64064d92e5ca" dependencies = [ + "ahash", "android-activity", - "bitflags 1.3.2", - "cfg_aliases", + "atomic-waker", + "bitflags 2.5.0", + "bytemuck", + "calloop", + "cfg_aliases 0.1.1", "core-foundation", "core-graphics", - "dispatch", - "instant", + "cursor-icon", + "icrate", + "js-sys", "libc", "log", - "mio", - "ndk 0.7.0", - "objc2", + "memmap2 0.9.4", + "ndk", + "ndk-sys", + "objc2 0.4.1", "once_cell", "orbclient", "percent-encoding", "raw-window-handle", "redox_syscall 0.3.5", + "rustix 0.38.34", "sctk-adwaita", - "smithay-client-toolkit 0.16.1", + "smithay-client-toolkit", + "smol_str", + "unicode-segmentation", "wasm-bindgen", - "wayland-client 0.29.5", - "wayland-commons", - "wayland-protocols 0.29.5", - "wayland-scanner 0.29.5", + "wasm-bindgen-futures", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-plasma", "web-sys", - "windows-sys 0.45.0", + "web-time", + "windows-sys 0.48.0", "x11-dl", + "x11rb", + "xkbcommon-dl", ] [[package]] @@ -5670,40 +5651,19 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "x11rb" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf3c79412dd91bae7a7366b8ad1565a85e35dd049affc3a6a2c549e97419617" -dependencies = [ - "gethostname 0.2.3", - "libc", - "libloading 0.7.4", - "nix 0.25.1", - "once_cell", - "winapi", - "winapi-wsapoll", - "x11rb-protocol 0.11.1", -] - [[package]] name = "x11rb" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" dependencies = [ - "gethostname 0.4.3", + "as-raw-xcb-connection", + "gethostname", + "libc", + "libloading 0.8.3", + "once_cell", "rustix 0.38.34", - "x11rb-protocol 0.13.1", -] - -[[package]] -name = "x11rb-protocol" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0b1513b141123073ce54d5bb1d33f801f17508fbd61e02060b1214e96d39c56" -dependencies = [ - "nix 0.25.1", + "x11rb-protocol", ] [[package]] @@ -5739,6 +5699,19 @@ dependencies = [ "winapi", ] +[[package]] +name = "xkbcommon-dl" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" +dependencies = [ + "bitflags 2.5.0", + "dlib", + "log", + "once_cell", + "xkeysym", +] + [[package]] name = "xkeysym" version = "0.2.0" @@ -5751,6 +5724,18 @@ version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" +[[package]] +name = "xxhash-rust" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a5cbf750400958819fb6178eaa83bee5cd9c29a26a40cc241df8c70fdd46984" + +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" + [[package]] name = "yazi" version = "0.1.6" diff --git a/ladspa/src/lib.rs b/ladspa/src/lib.rs index 8ae0ad841..af605f3ad 100644 --- a/ladspa/src/lib.rs +++ b/ladspa/src/lib.rs @@ -1,6 +1,7 @@ use std::collections::VecDeque; use std::fmt; use std::io::{self, Write}; +use std::sync::Weak; use std::sync::{ mpsc::{sync_channel, Receiver, SyncSender}, Arc, Mutex, Once, @@ -101,8 +102,8 @@ fn syslog_format(buf: &mut env_logger::fmt::Formatter, record: &log::Record) -> } fn get_worker_fn( - inqueue: SampleQueue, - outqueue: SampleQueue, + inqueue: Weak>>>, + outqueue: Weak>>>, controls: ControlRecv, sleep_duration: Duration, id: String, @@ -113,9 +114,15 @@ fn get_worker_fn( let mut outframe = Array2::zeros((df.ch, df.hop_size)); let t_audio_ms = df.hop_size as f32 / df.sr as f32 * 1000.; - let mut inframe_bufs = vec![]; - loop { + let Some(inqueue) = inqueue.upgrade() else { + break; + }; + + let Some(outqueue) = outqueue.upgrade() else { + break; + }; + if let Ok((c, v)) = controls.try_recv() { log::info!("DF {} | Setting '{}' to {:.1}", id, c, v); match c { @@ -132,8 +139,7 @@ fn get_worker_fn( let mut q = inqueue.lock().unwrap(); let mut inframes = vec![]; while q[0].len() >= df.hop_size { - let mut inframe = - inframe_bufs.pop().unwrap_or_else(|| Array2::zeros((df.ch, df.hop_size))); + let mut inframe = Array2::zeros((df.ch, df.hop_size)); for (i_q_ch, mut i_ch) in q.iter_mut().zip(inframe.outer_iter_mut()) { for i in i_ch.iter_mut() { @@ -160,7 +166,6 @@ fn get_worker_fn( .expect("Error during df::process"); let td_ms = t0.elapsed().as_secs_f32() * 1000.; - log::debug!( "DF {} | Enhanced {:.1}ms frame. SNR: {:>5.1}, Processing time: {:>4.1}ms, RTF: {:.2}", id, @@ -178,8 +183,6 @@ fn get_worker_fn( outframe.fill(0.0); } - inframe_bufs.push(inframe); - let mut o_q = outqueue.lock().unwrap(); for (o_ch, o_q_ch) in outframe.outer_iter().zip(o_q.iter_mut()) { for &o in o_ch.iter() { @@ -246,8 +249,8 @@ fn get_new_df(channels: usize) -> impl Fn(&PluginDescriptor, u64) -> DfPlugin { let (control_tx, control_rx) = sync_channel(32); let worker_handle = thread::spawn(get_worker_fn( - Arc::clone(&i_tx), - Arc::clone(&o_rx), + Arc::downgrade(&i_tx), + Arc::downgrade(&o_rx), control_rx, sleep_duration, id.clone(), @@ -447,12 +450,6 @@ impl Plugin for DfPlugin { } sleep(self.sleep_duration); } - - for o_ch in self.o_rx.lock().unwrap().iter_mut() { - for _ in 0..self.frame_size { - o_ch.push_back(0f32) - } - } } } From fec0e33299431dab289dee78e96ef16893dd2c0e Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 9 Nov 2024 21:21:02 -0500 Subject: [PATCH 3/5] prefill buffer --- ladspa/src/lib.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ladspa/src/lib.rs b/ladspa/src/lib.rs index af605f3ad..e3933614c 100644 --- a/ladspa/src/lib.rs +++ b/ladspa/src/lib.rs @@ -114,6 +114,20 @@ fn get_worker_fn( let mut outframe = Array2::zeros((df.ch, df.hop_size)); let t_audio_ms = df.hop_size as f32 / df.sr as f32 * 1000.; + { + let Some(outqueue) = outqueue.upgrade() else { + return; + }; + + // prefill buffer + let mut o_q = outqueue.lock().unwrap(); + for o_q_ch in o_q.iter_mut() { + for _ in 0..df.hop_size { + o_q_ch.push_back(0.0); + } + } + } + loop { let Some(inqueue) = inqueue.upgrade() else { break; From 2f9a157fd7920e5677dd712277e931c4948469f9 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 10 Nov 2024 03:06:40 -0500 Subject: [PATCH 4/5] remove spin loops --- ladspa/Cargo.toml | 8 +- ladspa/src/lib.rs | 268 ++++++++++++++++++++-------------------------- 2 files changed, 120 insertions(+), 156 deletions(-) diff --git a/ladspa/Cargo.toml b/ladspa/Cargo.toml index 7259047ac..7e21f4d03 100644 --- a/ladspa/Cargo.toml +++ b/ladspa/Cargo.toml @@ -15,9 +15,9 @@ default = ["default-model-ll"] [dependencies] deep_filter = { path = "../libDF", default-features = false, features = [ - "tract", - "use-jemalloc", - "default-model", + "tract", + "use-jemalloc", + "default-model", ] } ladspa = "0.3.4" ndarray = "^0.15" @@ -25,4 +25,4 @@ env_logger = "0.10" uuid = { version = "1.2.1", features = ["v4", "fast-rng"] } log = { version = "0.4", features = ["std"] } zbus = { version = "3.6", optional = true } -event-listener = { version = "2.5", optional = true } +event-listener = { version = "2.5", optional = true } \ No newline at end of file diff --git a/ladspa/src/lib.rs b/ladspa/src/lib.rs index e3933614c..e154d69e8 100644 --- a/ladspa/src/lib.rs +++ b/ladspa/src/lib.rs @@ -11,12 +11,12 @@ use std::time::{Duration, Instant}; use df::tract::*; use ladspa::{DefaultValue, Plugin, PluginDescriptor, Port, PortConnection, PortDescriptor}; -use ndarray::prelude::*; +use ndarray::{prelude::*, OwnedRepr}; use uuid::Uuid; static INIT_LOGGER: Once = Once::new(); -type SampleQueue = Arc>>>; +type AudioFrame = ArrayBase, Dim<[usize; 2]>>; type ControlProd = SyncSender<(DfControl, f32)>; type ControlRecv = Receiver<(DfControl, f32)>; #[cfg(feature = "dbus")] @@ -49,22 +49,21 @@ const MIN_PROC_BUF_MIN: f32 = 0.; const MIN_PROC_BUF_MAX: f32 = 10.; struct DfPlugin { - i_tx: SampleQueue, - o_rx: SampleQueue, + raw_audio_queue: Vec>, + raw_audio_sender: SyncSender, + cleaned_audio_queue: Vec>, + cleaned_audio_receiver: Receiver, control_tx: ControlProd, id: String, - ch: usize, - frame_size: usize, - sleep_duration: Duration, + channel_count: usize, + hop_size: usize, control_hist: DfControlHistory, - _h: JoinHandle<()>, // Worker thread handle #[cfg(feature = "dbus")] _dbus: Option<(JoinHandle<()>, Arc)>, // dbus thread handle } const ID_MONO: u64 = 7843795; const ID_STEREO: u64 = 7843796; -static mut MODEL: Option = None; fn log_format(buf: &mut env_logger::fmt::Formatter, record: &log::Record) -> io::Result<()> { let ts = buf.timestamp_millis(); @@ -101,129 +100,71 @@ fn syslog_format(buf: &mut env_logger::fmt::Formatter, record: &log::Record) -> ) } +fn new_df_frame(df: &DfTract) -> AudioFrame { + Array2::zeros((df.ch, df.hop_size)) +} + fn get_worker_fn( - inqueue: Weak>>>, - outqueue: Weak>>>, + raw_receiver: Receiver, + clean_sender: SyncSender, + channels: usize, controls: ControlRecv, - sleep_duration: Duration, id: String, -) -> impl FnMut() { +) -> impl FnMut() + Send { move || { - let mut df = unsafe { MODEL.clone().unwrap() }; + let (mut df, _, _) = init_df(channels); - let mut outframe = Array2::zeros((df.ch, df.hop_size)); - let t_audio_ms = df.hop_size as f32 / df.sr as f32 * 1000.; + let mut outframe = new_df_frame(&df); - { - let Some(outqueue) = outqueue.upgrade() else { - return; - }; + let t_audio_ms = df.hop_size as f32 / df.sr as f32 * 1000.; - // prefill buffer - let mut o_q = outqueue.lock().unwrap(); - for o_q_ch in o_q.iter_mut() { - for _ in 0..df.hop_size { - o_q_ch.push_back(0.0); - } + if let Ok((c, v)) = controls.try_recv() { + log::info!("DF {} | Setting '{}' to {:.1}", id, c, v); + match c { + DfControl::AttenLim => df.set_atten_lim(v), + DfControl::PfBeta => df.set_pf_beta(v), + DfControl::MinThreshDb => df.min_db_thresh = v, + DfControl::MaxErbThreshDb => df.max_db_erb_thresh = v, + DfControl::MaxDfThreshDb => df.max_db_df_thresh = v, + _ => (), } } - loop { - let Some(inqueue) = inqueue.upgrade() else { - break; - }; + while let Ok(inframe) = raw_receiver.recv() { + let t0 = Instant::now(); - let Some(outqueue) = outqueue.upgrade() else { - break; - }; - - if let Ok((c, v)) = controls.try_recv() { - log::info!("DF {} | Setting '{}' to {:.1}", id, c, v); - match c { - DfControl::AttenLim => df.set_atten_lim(v), - DfControl::PfBeta => df.set_pf_beta(v), - DfControl::MinThreshDb => df.min_db_thresh = v, - DfControl::MaxErbThreshDb => df.max_db_erb_thresh = v, - DfControl::MaxDfThreshDb => df.max_db_df_thresh = v, - _ => (), - } - } + let lsnr = df + .process(inframe.view(), outframe.view_mut()) + .expect("Error during df::process"); - let inframes = { - let mut q = inqueue.lock().unwrap(); - let mut inframes = vec![]; - while q[0].len() >= df.hop_size { - let mut inframe = Array2::zeros((df.ch, df.hop_size)); + let td_ms = t0.elapsed().as_secs_f32() * 1000.; + log::debug!( + "DF {} | Enhanced {:.1}ms frame. SNR: {:>5.1}, Processing time: {:>4.1}ms, RTF: {:.2}", + id, + t_audio_ms, + lsnr, + td_ms, + td_ms / t_audio_ms + ); - for (i_q_ch, mut i_ch) in q.iter_mut().zip(inframe.outer_iter_mut()) { - for i in i_ch.iter_mut() { - *i = i_q_ch.pop_front().unwrap(); - } - } - - inframes.push(inframe); - } - inframes - }; - - if inframes.is_empty() { - sleep(sleep_duration); - continue; + if clean_sender.send(outframe).is_err() { + break; } - for (i, inframe) in inframes.into_iter().enumerate() { - let t0 = Instant::now(); - - if i < 5 { - let lsnr = df - .process(inframe.view(), outframe.view_mut()) - .expect("Error during df::process"); - - let td_ms = t0.elapsed().as_secs_f32() * 1000.; - log::debug!( - "DF {} | Enhanced {:.1}ms frame. SNR: {:>5.1}, Processing time: {:>4.1}ms, RTF: {:.2}", - id, - t_audio_ms, - lsnr, - td_ms, - td_ms / t_audio_ms - ); - } else { - log::info!( - "DF {} | Processing overloaded! Dropping {} samples", - id, - outframe.len_of(Axis(1)) - ); - outframe.fill(0.0); - } - - let mut o_q = outqueue.lock().unwrap(); - for (o_ch, o_q_ch) in outframe.outer_iter().zip(o_q.iter_mut()) { - for &o in o_ch.iter() { - o_q_ch.push_back(o) - } - } - } + outframe = inframe; } + + println!("thread exiting") } } /// Initialize DF model and returns sample rate and frame size -fn init_df(channels: usize) -> (usize, usize) { - unsafe { - if let Some(m) = MODEL.as_ref() { - if m.ch == channels { - return (m.sr, m.hop_size); - } - } - } - +fn init_df(channels: usize) -> (DfTract, usize, usize) { let df_params = DfParams::default(); let r_params = RuntimeParams::default_with_ch(channels); let df = DfTract::new(df_params, &r_params).expect("Could not initialize DeepFilter runtime"); let (sr, frame_size) = (df.sr, df.hop_size); - unsafe { MODEL = Some(df) }; - (sr, frame_size) + (df, sr, frame_size) } fn get_new_df(channels: usize) -> impl Fn(&PluginDescriptor, u64) -> DfPlugin { @@ -245,28 +186,21 @@ fn get_new_df(channels: usize) -> impl Fn(&PluginDescriptor, u64) -> DfPlugin { .init(); }); - let (m_sr, hop) = init_df(channels); + let (_, m_sr, hop_size) = init_df(channels); assert_eq!(m_sr as u64, sample_rate, "Unsupported sample rate"); - let i_tx = Arc::new(Mutex::new(vec![VecDeque::with_capacity(hop * 4); channels])); - let o_rx = Arc::new(Mutex::new(vec![VecDeque::with_capacity(hop * 4); channels])); - let frame_size = hop; - let proc_delay = hop; - // Add a buffer of 1 frame to compensate processing delays causing underruns - for o_ch in o_rx.lock().unwrap().iter_mut() { - for _ in 0..proc_delay { - o_ch.push_back(0f32) - } - } - let sleep_duration = Duration::from_secs_f32(hop as f32 / m_sr as f32 / 5.); + let id = Uuid::new_v4().as_urn().to_string().split_at(33).1.to_string(); let (control_tx, control_rx) = sync_channel(32); - let worker_handle = thread::spawn(get_worker_fn( - Arc::downgrade(&i_tx), - Arc::downgrade(&o_rx), + let (raw_tx, raw_rx) = sync_channel(128); + let (clean_tx, clean_rx) = sync_channel(128); + + thread::spawn(get_worker_fn( + raw_rx, + clean_tx, + channels, control_rx, - sleep_duration, id.clone(), )); let hist = DfControlHistory::default(); @@ -275,16 +209,17 @@ fn get_new_df(channels: usize) -> impl Fn(&PluginDescriptor, u64) -> DfPlugin { &id, t0.elapsed().as_secs_f32() * 1000. ); + dbg!(&channels); DfPlugin { - i_tx, - o_rx, + raw_audio_queue: vec![VecDeque::new(); channels], + cleaned_audio_queue: vec![VecDeque::from(vec![0.0; hop_size * 2]); channels], + raw_audio_sender: raw_tx, + cleaned_audio_receiver: clean_rx, control_tx, - ch: channels, + channel_count: channels, + hop_size, id, - frame_size, - sleep_duration, control_hist: hist, - _h: worker_handle, #[cfg(feature = "dbus")] _dbus: None, } @@ -393,6 +328,7 @@ impl Plugin for DfPlugin { log::debug!("dbus thread spawned") } } + fn deactivate(&mut self) { log::info!("DF {} | deactivate", self.id); #[cfg(feature = "dbus")] @@ -413,23 +349,24 @@ impl Plugin for DfPlugin { } } } + fn run<'a>(&mut self, sample_count: usize, ports: &[&'a PortConnection<'a>]) { let mut i = 0; - let mut inputs = Vec::with_capacity(self.ch); - let mut outputs = Vec::with_capacity(self.ch); - for _ in 0..self.ch { - inputs.push(ports[i].unwrap_audio()); + let mut input_ports = Vec::with_capacity(self.channel_count); + let mut output_ports = Vec::with_capacity(self.channel_count); + for _ in 0..self.channel_count { + input_ports.push(ports[i].unwrap_audio()); i += 1; } - for _ in 0..self.ch { - outputs.push(ports[i].unwrap_audio_mut()); + for _ in 0..self.channel_count { + output_ports.push(ports[i].unwrap_audio_mut()); i += 1; } for p in ports[i..].iter() { let &v = p.unwrap_control(); let c = DfControl::from_port_name(p.port.name); if c == DfControl::AttenLim && v >= 100. { - for (i_ch, o_ch) in inputs.iter().zip(outputs.iter_mut()) { + for (i_ch, o_ch) in input_ports.iter().zip(output_ports.iter_mut()) { for (&i, o) in i_ch.iter().zip(o_ch.iter_mut()) { *o = i } @@ -441,28 +378,55 @@ impl Plugin for DfPlugin { } } - { - let i_q = &mut self.i_tx.lock().unwrap(); - for (i_ch, i_q_ch) in inputs.iter().zip(i_q.iter_mut()) { - for &i in i_ch.iter() { - i_q_ch.push_back(i) + for (port_buffer, queue_buffer) in input_ports.iter().zip(self.raw_audio_queue.iter_mut()) { + assert_eq!(port_buffer.len(), sample_count); + for &i in port_buffer.iter() { + queue_buffer.push_back(i); + } + } + + while self.raw_audio_queue[0].len() >= self.hop_size { + let mut frame = Array2::zeros((self.channel_count, self.hop_size)); + for (mut frame_channel, queue_channel) in + frame.outer_iter_mut().zip(self.raw_audio_queue.iter_mut()) + { + for i in frame_channel.iter_mut() { + *i = queue_channel.pop_front().unwrap(); } } + if let Err(e) = self.raw_audio_sender.try_send(frame) { + log::warn!( + "DF {} | Processing thread is overloaded! Dropping frame", + self.id, + ); + dbg!(&e); + dbg!(self.hop_size); + } } - 'outer: loop { + while let Ok(frame) = self.cleaned_audio_receiver.try_recv() { + for (frame_channel, queue_channel) in + frame.outer_iter().zip(self.cleaned_audio_queue.iter_mut()) { - let o_q = &mut self.o_rx.lock().unwrap(); - if o_q[0].len() >= sample_count { - for (o_q_ch, o_ch) in o_q.iter_mut().zip(outputs.iter_mut()) { - for o in o_ch.iter_mut() { - *o = o_q_ch.pop_front().unwrap(); - } - } - break 'outer; + for &o in frame_channel.iter() { + queue_channel.push_back(o); } } - sleep(self.sleep_duration); + } + + for (queue_channel, port_channel) in + self.cleaned_audio_queue.iter_mut().zip(output_ports.iter_mut()) + { + assert_eq!(port_channel.len(), sample_count); + for o in port_channel.iter_mut() { + *o = queue_channel.pop_front().unwrap_or_default(); + } + } + + while self.cleaned_audio_queue[0].len() > sample_count.max(self.hop_size) { + for channel in self.cleaned_audio_queue.iter_mut() { + channel.pop_front().unwrap(); + } } } } From a20ca9f6c201b3661842901d085dee7b0a81a45c Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 15 Nov 2024 19:02:33 -0500 Subject: [PATCH 5/5] fix control messages --- ladspa/src/lib.rs | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/ladspa/src/lib.rs b/ladspa/src/lib.rs index e154d69e8..d79b0bb43 100644 --- a/ladspa/src/lib.rs +++ b/ladspa/src/lib.rs @@ -1,6 +1,7 @@ use std::collections::VecDeque; use std::fmt; use std::io::{self, Write}; +use std::sync::mpsc::{channel, Sender}; use std::sync::Weak; use std::sync::{ mpsc::{sync_channel, Receiver, SyncSender}, @@ -17,7 +18,7 @@ use uuid::Uuid; static INIT_LOGGER: Once = Once::new(); type AudioFrame = ArrayBase, Dim<[usize; 2]>>; -type ControlProd = SyncSender<(DfControl, f32)>; +type ControlProd = Sender<(DfControl, f32)>; type ControlRecv = Receiver<(DfControl, f32)>; #[cfg(feature = "dbus")] use ::{ @@ -118,19 +119,19 @@ fn get_worker_fn( let t_audio_ms = df.hop_size as f32 / df.sr as f32 * 1000.; - if let Ok((c, v)) = controls.try_recv() { - log::info!("DF {} | Setting '{}' to {:.1}", id, c, v); - match c { - DfControl::AttenLim => df.set_atten_lim(v), - DfControl::PfBeta => df.set_pf_beta(v), - DfControl::MinThreshDb => df.min_db_thresh = v, - DfControl::MaxErbThreshDb => df.max_db_erb_thresh = v, - DfControl::MaxDfThreshDb => df.max_db_df_thresh = v, - _ => (), + while let Ok(inframe) = raw_receiver.recv() { + while let Ok((c, v)) = controls.try_recv() { + log::info!("DF {} | Setting '{}' to {:.1}", id, c, v); + match c { + DfControl::AttenLim => df.set_atten_lim(v), + DfControl::PfBeta => df.set_pf_beta(v), + DfControl::MinThreshDb => df.min_db_thresh = v, + DfControl::MaxErbThreshDb => df.max_db_erb_thresh = v, + DfControl::MaxDfThreshDb => df.max_db_df_thresh = v, + _ => (), + } } - } - while let Ok(inframe) = raw_receiver.recv() { let t0 = Instant::now(); let lsnr = df @@ -191,7 +192,7 @@ fn get_new_df(channels: usize) -> impl Fn(&PluginDescriptor, u64) -> DfPlugin { let id = Uuid::new_v4().as_urn().to_string().split_at(33).1.to_string(); - let (control_tx, control_rx) = sync_channel(32); + let (control_tx, control_rx) = channel(); let (raw_tx, raw_rx) = sync_channel(128); let (clean_tx, clean_rx) = sync_channel(128);