diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be9d2e26..2b489863 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: if: matrix.platform == 'linux' run: | sudo apt-get update - sudo apt-get install -y libasound2-dev libjack-jackd2-dev libxkbcommon-dev protobuf-compiler + sudo apt-get install -y libasound2-dev libjack-jackd2-dev libpipewire-0.3-dev libpulse-dev libxkbcommon-dev protobuf-compiler - name: Install dependencies (Windows) if: matrix.platform == 'windows' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 605d4721..94d89825 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,7 +52,7 @@ jobs: if: matrix.platform == 'linux' run: | sudo apt-get update - sudo apt-get install -y libasound2-dev libjack-jackd2-dev libxkbcommon-dev protobuf-compiler + sudo apt-get install -y libasound2-dev libjack-jackd2-dev libpipewire-0.3-dev libpulse-dev libxkbcommon-dev protobuf-compiler - name: Install dependencies (Windows) if: matrix.platform == 'windows' diff --git a/RustApp/Cargo.lock b/RustApp/Cargo.lock index 1ceec642..1f76d7a8 100644 --- a/RustApp/Cargo.lock +++ b/RustApp/Cargo.lock @@ -193,7 +193,7 @@ dependencies = [ "android-properties", "bitflags 2.11.1", "cc", - "jni 0.22.4", + "jni", "libc", "log", "ndk", @@ -1157,12 +1157,6 @@ dependencies = [ "shlex", ] -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - [[package]] name = "cexpr" version = "0.6.0" @@ -1468,15 +1462,6 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "136d3e02915a2cea4d74caa8681e2d44b1c3254bdbf17d11d41d587ff858832c" -[[package]] -name = "convert_case" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baaaa0ecca5b51987b9423ccdc971514dd8b0bb7b4060b983d3664dad3f1f89f" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "cookie-factory" version = "0.3.3" @@ -1677,7 +1662,7 @@ dependencies = [ [[package]] name = "cpal" version = "0.18.0" -source = "git+https://github.com/RustAudio/cpal.git?rev=3e73d824295c18373e794ef7bb8f53c58bd8af67#3e73d824295c18373e794ef7bb8f53c58bd8af67" +source = "git+https://github.com/RustAudio/cpal.git?rev=5418f0b43786bcbb4eaf21179e8a0fac76021a58#5418f0b43786bcbb4eaf21179e8a0fac76021a58" dependencies = [ "alsa", "block2 0.6.2", @@ -1685,7 +1670,7 @@ dependencies = [ "dasp_sample", "futures", "jack", - "jni 0.21.1", + "jni", "js-sys", "libc", "mach2 0.6.0", @@ -4225,22 +4210,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "jni" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" -dependencies = [ - "cesu8", - "cfg-if", - "combine", - "jni-sys 0.3.1", - "log", - "thiserror 1.0.69", - "walkdir", - "windows-sys 0.45.0", -] - [[package]] name = "jni" version = "0.22.4" @@ -4554,26 +4523,25 @@ dependencies = [ [[package]] name = "libspa" -version = "0.9.2" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b8cfa2a7656627b4c92c6b9ef929433acd673d5ab3708cda1b18478ac00df4" +checksum = "2909f3be29d674e7f10604aff18d1bbe1bb03c4cd61c8a8ba19c0b1d162f7d4e" dependencies = [ "bitflags 2.11.1", "cc", - "convert_case", "cookie-factory", "libc", "libspa-sys", - "nix 0.30.1", "nom 8.0.0", + "rustix 1.1.4", "system-deps 7.0.8", ] [[package]] name = "libspa-sys" -version = "0.9.2" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901049455d2eb6decf9058235d745237952f4804bc584c5fcb41412e6adcc6e0" +checksum = "69ad52764fca54818486f3cf75afec844d1f1a1568c24dcee25d41b1ab007dda" dependencies = [ "bindgen", "cc", @@ -5022,34 +4990,6 @@ dependencies = [ "memoffset 0.7.1", ] -[[package]] -name = "nix" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" -dependencies = [ - "bitflags 2.11.1", - "cfg-if", - "cfg_aliases 0.2.1", - "libc", -] - -[[package]] -name = "nnnoiseless" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "805d5964d1e7a0006a7fdced7dae75084d66d18b35f1dfe81bd76929b1f8da0c" -dependencies = [ - "anyhow", - "clap 3.2.25", - "dasp", - "dasp_interpolate", - "dasp_ring_buffer", - "easyfft", - "hound", - "once_cell", -] - [[package]] name = "nom" version = "7.1.3" @@ -5921,26 +5861,23 @@ dependencies = [ [[package]] name = "pipewire" -version = "0.9.2" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9688b89abf11d756499f7c6190711d6dbe5a3acdb30c8fbf001d6596d06a8d44" +checksum = "8585aba8a52ad74ccc633b8e293c1dc4277976bd5d510b925533f34fd6685f38" dependencies = [ - "anyhow", "bitflags 2.11.1", "libc", "libspa", "libspa-sys", - "nix 0.30.1", - "once_cell", "pipewire-sys", - "thiserror 2.0.18", + "rustix 1.1.4", ] [[package]] name = "pipewire-sys" -version = "0.9.2" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb028afee0d6ca17020b090e3b8fa2d7de23305aef975c7e5192a5050246ea36" +checksum = "f2089f245b548723e60325773c27f586b7a2372c79ea941b246cd0d654706adc" dependencies = [ "bindgen", "libspa-sys", @@ -6102,7 +6039,7 @@ dependencies = [ "inferno", "libc", "log", - "nix 0.26.4", + "nix", "once_cell", "smallvec", "spin", @@ -7044,7 +6981,7 @@ checksum = "26d1e2536ce4f35f4846aa13bff16bd0ff40157cdb14cc056c7b14ba41233ba0" dependencies = [ "core-foundation 0.10.1", "core-foundation-sys", - "jni 0.22.4", + "jni", "log", "once_cell", "rustls", @@ -8174,7 +8111,7 @@ dependencies = [ "toml_datetime 1.1.1+spec-1.1.0", "toml_parser", "toml_writer", - "winnow 1.0.2", + "winnow 1.0.3", ] [[package]] @@ -8240,6 +8177,12 @@ dependencies = [ "winnow 1.0.3", ] +[[package]] +name = "toml_writer" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" + [[package]] name = "tower" version = "0.5.3" @@ -8274,10 +8217,16 @@ dependencies = [ ] [[package]] -name = "toml_writer" -version = "1.1.1+spec-1.1.0" +name = "tower-layer" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -9319,6 +9268,17 @@ dependencies = [ "windows-link 0.1.3", ] +[[package]] +name = "windows-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link 0.2.1", + "windows-result 0.4.1", + "windows-strings 0.5.1", +] + [[package]] name = "windows-result" version = "0.1.2" @@ -9364,15 +9324,6 @@ dependencies = [ "windows-link 0.2.1", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -9418,21 +9369,6 @@ dependencies = [ "windows-link 0.2.1", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-targets" version = "0.48.5" @@ -9499,12 +9435,6 @@ dependencies = [ "windows-link 0.2.1", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -9523,12 +9453,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -9547,12 +9471,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -9583,12 +9501,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -9607,12 +9519,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -9631,12 +9537,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -9655,12 +9555,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -10031,7 +9925,7 @@ dependencies = [ "futures-sink", "futures-util", "hex", - "nix 0.26.4", + "nix", "once_cell", "ordered-stream", "rand 0.8.6", diff --git a/RustApp/Cargo.toml b/RustApp/Cargo.toml index cecd3681..8dc8828c 100644 --- a/RustApp/Cargo.toml +++ b/RustApp/Cargo.toml @@ -46,7 +46,8 @@ adb = [] [dependencies] clap = { version = "4", features = ["derive"] } # linux: alsa will probably be included as a fallback ? -cpal = { git = "https://github.com/RustAudio/cpal.git", rev="3e73d824295c18373e794ef7bb8f53c58bd8af67", features = ["jack", "pipewire", "pulseaudio"] } +# TODO: update cpal to 0.18 once released +cpal = { git = "https://github.com/RustAudio/cpal.git", rev="5418f0b43786bcbb4eaf21179e8a0fac76021a58", features = ["jack", "pipewire", "pulseaudio"] } rtrb = "0.3" local-ip-address = "0.6" log = "0.4" diff --git a/RustApp/src/ui/app.rs b/RustApp/src/ui/app.rs index a61c337e..e73b5344 100644 --- a/RustApp/src/ui/app.rs +++ b/RustApp/src/ui/app.rs @@ -4,7 +4,8 @@ use std::{ }; use cpal::{ - Device, Host, HostId, traits::{DeviceTrait, HostTrait, StreamTrait} + Device, Host, + traits::{DeviceTrait, HostTrait, StreamTrait}, }; use local_ip_address::list_afinet_netifas; use notify_rust::Notification; @@ -21,6 +22,9 @@ use cosmic::{ widget::markdown, }; +#[cfg(target_os = "linux")] +use cpal::HostId; + use super::{ message::{AppMsg, ConfigMsg}, view::{main_window, settings_window}, @@ -329,7 +333,6 @@ impl Application for AppState { flags: Self::Flags, ) -> (Self, cosmic::app::Task) { // initialize audio device - let available_hosts = cpal::available_hosts(); let audio_host = cpal::default_host(); let audio_devices = get_audio_devices(&audio_host); @@ -393,7 +396,7 @@ impl Application for AppState { config: flags.config, audio_device, #[cfg(target_os = "linux")] - available_hosts, + available_hosts: cpal::available_hosts(), audio_host, audio_devices, audio_wave: AudioWave::new(), @@ -468,7 +471,8 @@ impl Application for AppState { let audio_host = cpal::default_host(); #[cfg(target_os = "linux")] - let audio_host = cpal::host_from_id(self.audio_host.id()).unwrap_or(cpal::default_host()); + let audio_host = + cpal::host_from_id(self.audio_host.id()).unwrap_or(cpal::default_host()); self.audio_devices = get_audio_devices(&audio_host); }