diff --git a/.github/workflows/build_android.yml b/.github/workflows/build_android.yml new file mode 100644 index 000000000..74c1a244d --- /dev/null +++ b/.github/workflows/build_android.yml @@ -0,0 +1,68 @@ +name: Build and upload Android artifacts + +on: + workflow_dispatch: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build-android: + runs-on: ubuntu-latest + strategy: + fail-fast: false + env: + RUST_LOG: info + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Rust toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + target: ${{ matrix.target }} + + - name: Install Cargo NDK + run: cargo install cargo-ndk + + - name: Add Android targets + run: rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android + + - name: Build Android libraries + run: cargo ndk -t armeabi-v7a -t arm64-v8a -t x86 -t x86_64 -o android-libs-build build --features android --release + working-directory: ./libDF + + - name: Verify built .so files 16 kb alignment + run: | + LLVM_READELF_PATH=$(find $ANDROID_NDK_HOME -name llvm-readelf | head -n 1) + $LLVM_READELF_PATH -l android-libs-build/arm64-v8a/libdf.so | grep 'R E' | grep '0x4000$' || (echo "Alignment check failed for arm64-v8a" && exit 1) + working-directory: ./libDF + + - name: Upload native Android libraries + uses: actions/upload-artifact@v4 + with: + name: native-android-libraries + path: | + ./libDF/android-libs-build/arm64-v8a/libdf.so + ./libDF/android-libs-build/armeabi-v7a/libdf.so + ./libDF/android-libs-build/x86/libdf.so + ./libDF/android-libs-build/x86_64/libdf.so + + - name: Copy and rename DeepFilter model + run: cp ./models/DeepFilterNet3_onnx_mobile.tar.gz ./models/deep-filter-mobile-model + + - name: Upload DeepFilter mobile model + uses: actions/upload-artifact@v4 + with: + name: deep-filter-mobile-model + path: ./models/deep-filter-mobile-model + + - name: Clean up build artifacts + run: rm -rf ./libDF/android-libs-build + + - name: Clean up temporary model file + run: rm -f ./models/deep-filter-mobile-model \ No newline at end of file diff --git a/.github/workflows/build_ios.yml b/.github/workflows/build_ios.yml new file mode 100644 index 000000000..62d284570 --- /dev/null +++ b/.github/workflows/build_ios.yml @@ -0,0 +1,47 @@ +name: Build as iOS xcframework + +on: + workflow_dispatch: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build-ios: + runs-on: macos-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Rust toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + + - name: Add iOS targets + run: | + rustup target add aarch64-apple-ios + rustup target add x86_64-apple-ios + rustup target add aarch64-apple-ios-sim + + - name: Clean + working-directory: ./libDF + run: cargo clean + + - name: Build iOS libraries + run: . ios_xcframework.sh + working-directory: ./libDF + + - name: Zip XCFramework + working-directory: ./Binaries + run: | + zip -r DeepFilterNet.xcframework.zip DeepFilterNet.xcframework + + - name: Upload framework + uses: actions/upload-artifact@v4 + with: + name: Binaries + path: ./Binaries/DeepFilterNet.xcframework.zip diff --git a/Cargo.lock b/Cargo.lock index 886c82549..d6f9148e8 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", ] @@ -1117,6 +1128,7 @@ dependencies = [ "hound", "itertools 0.12.1", "jemallocator", + "jni", "js-sys", "lewton", "log", @@ -1130,7 +1142,7 @@ dependencies = [ "realfft", "roots", "rstest", - "rubato", + "rubato 0.14.1", "rust-ini", "rustfft", "serde", @@ -1187,11 +1199,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 +1252,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 +1378,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 +1537,12 @@ dependencies = [ "spin", ] +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "font-types" version = "0.5.3" @@ -1499,14 +1552,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 +1577,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 +1736,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 +1775,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 +1800,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 +1810,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 +1833,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 +1906,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.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" 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 +2046,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 +2061,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 +2093,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 +2152,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 +2182,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 +2202,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 +2247,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 +2270,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 +2309,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 +2404,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 +2431,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 +2447,7 @@ checksum = "6197e2fb8a3da99eca216e9689b47465b23cfe09e1a1ddc720fa1acdd54aa267" dependencies = [ "bitflags 0.8.2", "libc", - "vec_map 0.7.0", + "vec_map", ] [[package]] @@ -2443,6 +2534,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 +2615,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.2", ] [[package]] @@ -2567,18 +2664,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 +2680,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 +2700,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 +2729,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 +2737,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 +2780,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 +2789,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 +2801,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 +2810,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 +2820,6 @@ dependencies = [ "cfg-if", "libc", "memoffset 0.7.1", - "pin-utils", ] [[package]] @@ -2810,7 +2830,7 @@ checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ "bitflags 2.5.0", "cfg-if", - "cfg_aliases", + "cfg_aliases 0.1.1", "libc", ] @@ -2880,55 +2900,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 +2959,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.1.0", +] + +[[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.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[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 +3107,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 +3169,9 @@ dependencies = [ [[package]] name = "ouroboros" -version = "0.17.2" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2ba07320d39dfea882faa70554b4bd342a5f273ed59ba7c1c6b4c840492c954" +checksum = "1e0f050db9c44b97a94723127e6be766ac5c340c48f2c4bb3ffa11713744be59" dependencies = [ "aliasable", "ouroboros_macro", @@ -3112,13 +3180,13 @@ dependencies = [ [[package]] name = "ouroboros_macro" -version = "0.17.2" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec4c6225c69b4ca778c0aea097321a64c421cf4577b331c61b229267edabb6f8" +checksum = "3c7028bdd3d43083f6d8d4d5187680d0d3560d54df4cc9d752005268b41e64d0" dependencies = [ "heck 0.4.1", - "proc-macro-error", "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.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2fdfc24bc566f839a2da4c4295b82db7d25a24253867d5c64355abb5799bdbe" + [[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.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f60aa35c89ac2687ace1a2556eaaea68e8c0d47408a2e3e7f5c98a489e7281c" +checksum = "0324504befd01cab6e0c994f34b2ffa257849ee019d3fb3b64fb2c858887d89e" 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.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" + +[[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/libDF/.cargo/config.toml b/libDF/.cargo/config.toml new file mode 100644 index 000000000..270cf5bb3 --- /dev/null +++ b/libDF/.cargo/config.toml @@ -0,0 +1,11 @@ +[target.aarch64-linux-android] +rustflags = ["-C", "link-arg=-Wl,-z,max-page-size=16384"] + +[target.armv7-linux-androideabi] +rustflags = ["-C", "link-arg=-Wl,-z,max-page-size=16384"] + +[target.i686-linux-android] +rustflags = ["-C", "link-arg=-Wl,-z,max-page-size=16384"] + +[target.x86_64-linux-android] +rustflags = ["-C", "link-arg=-Wl,-z,max-page-size=16384"] \ No newline at end of file diff --git a/libDF/Cargo.toml b/libDF/Cargo.toml index c0f3271ef..b4f67459a 100644 --- a/libDF/Cargo.toml +++ b/libDF/Cargo.toml @@ -91,6 +91,20 @@ wasm = [ "dep:console_error_panic_hook", "dep:js-sys", ] + +ios = [ + "tract", + "default-model", + "dep:ndarray", +] + +android = [ + "tract", + "default-model", + "dep:ndarray", + 'dep:jni', + "dep:log", +] hdf5-static = ["hdf5?/static"] [dependencies] @@ -131,6 +145,8 @@ getrandom = { version = "0.2", features = ["js"], optional = true } console_error_panic_hook = { version = "0.1.1", optional = true } js-sys = { version = "0.3", optional = true } +[target.'cfg(target_os = "android")'.dependencies] +jni = { version = "0.21.1", optional = true } [target.'cfg(all(not(windows), not(target_os = "android"), not(target_os = "macos"), not(target_os = "freebsd"), not(target_env = "musl"), not(target_arch = "riscv64")))'.dependencies] jemallocator = { version = "0.5.0", optional = true } diff --git a/libDF/ios_xcframework.sh b/libDF/ios_xcframework.sh new file mode 100755 index 000000000..97e03f10d --- /dev/null +++ b/libDF/ios_xcframework.sh @@ -0,0 +1,175 @@ +#!/bin/bash +set -e + + +# Clean previous builds +rm -rf ../xcframework-build +mkdir -p ../xcframework-build/device +mkdir -p ../xcframework-build/simulator + +# Compile for iOS device (arm64) +echo "Building for iOS devices (arm64)..." +cargo build --target aarch64-apple-ios --release --features ios + +# Compile for iOS simulator (arm64 and x86_64) +echo "Building for iOS simulator (arm64)..." +cargo build --target aarch64-apple-ios-sim --release --features ios + +echo "Building for iOS simulator (x86_64)..." +cargo build --target x86_64-apple-ios --release --features ios + +# Clean previous framework output +rm -rf ../Binaries + +# Create device and simulator libraries +echo "Creating fat library for simulator..." +lipo -create \ + ../target/aarch64-apple-ios-sim/release/libdf.a \ + ../target/x86_64-apple-ios/release/libdf.a \ + -output ../xcframework-build/simulator/libdf.a + +# Copy the device library +cp ../target/aarch64-apple-ios/release/libdf.a ../xcframework-build/device/ + +# Copy or create header files +mkdir -p ../xcframework-build/include +cat > ../xcframework-build/include/DeepFilterNet.h << EOL +#ifndef DEEPFILTERNET_H +#define DEEPFILTERNET_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Opaque pointer to the Rust DFState struct + */ +typedef struct DFState DFState; + +DFState* df_create(const uint8_t* modelBytes, int modelSize, int channels, float attenLim); + +int df_get_frame_length(DFState* state); + +/** + * Set DeepFilterNet attenuation limit. + * + * @param state DFState pointer created via df_create() + * @param limDb New attenuation limit in dB + */ +void df_set_atten_lim(DFState* state, float limDb); + +/** + * Set DeepFilterNet post filter beta. A beta of 0 disables the post filter. + * + * @param state DFState pointer created via df_create() + * @param beta Post filter attenuation. Suitable range between 0.05 and 0 + */ +void df_set_post_filter_beta(DFState* state, float beta); + +/** + * Processes a chunk of samples. + * + * @param state DFState pointer created via df_create() + * @param input Input buffer of length df_get_frame_length() + * @return Local SNR of the current frame + */ +float df_process_frame( + DFState* state, + const int16_t* input, + int frameSize +); + +/** + * Destroy a DeepFilterNet instance and free its resources. + * + * @param state DFState pointer created via df_create() + */ +void df_free(DFState* state); + +#ifdef __cplusplus +} +#endif + +#endif // DEEPFILTERNET_H +EOL + +# Create framework directories for iOS device +mkdir -p ../xcframework-build/out/device/DeepFilterNet.framework/Headers +mkdir -p ../xcframework-build/out/device/DeepFilterNet.framework/Modules +# Create framework directories for iOS simulator +mkdir -p ../xcframework-build/out/simulator/DeepFilterNet.framework/Headers +mkdir -p ../xcframework-build/out/simulator/DeepFilterNet.framework/Modules + +# Copy libraries and headers +cp ../xcframework-build/device/libdf.a ../xcframework-build/out/device/DeepFilterNet.framework/DeepFilterNet +cp ../xcframework-build/simulator/libdf.a ../xcframework-build/out/simulator/DeepFilterNet.framework/DeepFilterNet +cp ../xcframework-build/include/DeepFilterNet.h ../xcframework-build/out/device/DeepFilterNet.framework/Headers/ +cp ../xcframework-build/include/DeepFilterNet.h ../xcframework-build/out/simulator/DeepFilterNet.framework/Headers/ + +# Create module map file +cat > ../xcframework-build/out/device/DeepFilterNet.framework/Modules/module.modulemap << EOL +framework module DeepFilterNet { + umbrella header "DeepFilterNet.h" + export * + module * { export * } +} +EOL + +# Copy module map to simulator framework +cp ../xcframework-build/out/device/DeepFilterNet.framework/Modules/module.modulemap ../xcframework-build/out/simulator/DeepFilterNet.framework/Modules/ + +# Create Info.plist for iOS framework +cat > ../xcframework-build/out/device/DeepFilterNet.framework/Info.plist << EOL + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + DeepFilterNet + CFBundleIdentifier + com.deepfilternet + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + DeepFilterNet + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + MinimumOSVersion + 13.0 + UIDeviceFamily + + 1 + 2 + + NSPrincipalClass + + DTPlatformName + iphoneos + CFBundleSupportedPlatforms + + iPhoneOS + + + +EOL + +# Create Info.plist for simulator framework +cp ../xcframework-build/out/device/DeepFilterNet.framework/Info.plist ../xcframework-build/out/simulator/DeepFilterNet.framework/ + +# Create XCFramework +echo "Creating XCFramework..." +xcodebuild -create-xcframework \ + -framework ../xcframework-build/out/device/DeepFilterNet.framework \ + -framework ../xcframework-build/out/simulator/DeepFilterNet.framework \ + -output ../Binaries/DeepFilterNet.xcframework + +echo "XCFramework created at DeepFilterNet.xcframework" \ No newline at end of file diff --git a/libDF/src/android.rs b/libDF/src/android.rs new file mode 100644 index 000000000..5a5628fd9 --- /dev/null +++ b/libDF/src/android.rs @@ -0,0 +1,304 @@ +use std::boxed::Box; +use ndarray::Array2; +use crate::tract::*; +use jni::{ + sys::{jlong, jint, jfloat, jclass, jboolean, JNI_TRUE, JNI_FALSE}, + JNIEnv, + objects::{JByteArray, JClass, JObject, JByteBuffer}, +}; + +#[repr(C)] +pub struct NativeDeepFilterNet(crate::tract::DfTract); + +impl NativeDeepFilterNet { + /// Creates a new NativeDeepFilterNet instance from model bytes + /// + /// # Arguments + /// * `model_bytes` - Bytes containing the model data + /// * `channels` - Number of audio channels + /// * `atten_lim` - Attenuation limit in dB + /// + /// # Returns + /// A new NativeDeepFilterNet instance or panics if initialization fails + #[no_mangle] + pub fn new(model_bytes: &[u8], channels: usize, atten_lim: f32) -> Result { + let r_params = RuntimeParams::default_with_ch(channels).with_atten_lim(atten_lim); + + let df_params = match DfParams::from_bytes(model_bytes) { + Ok(params) => params, + Err(e) => return Err(format!("Could not load model: {}", e)), + }; + + match DfTract::new(df_params, &r_params) { + Ok(m) => Ok(NativeDeepFilterNet(m)), + Err(e) => Err(format!("Could not initialize DeepFilter runtime: {}", e)), + } + } + + /// Returns the hop size of the current model + pub fn hop_size(&self) -> usize { + // Hop size: 480 samples for 10ms at 48kHz. + self.0.hop_size + } + + /// Sets the attenuation limit in dB + pub fn set_atten_lim(&mut self, lim_db: f32) { + self.0.set_atten_lim(lim_db); + } + + /// Sets the post-filter beta value + pub fn set_pf_beta(&mut self, beta: f32) { + self.0.set_pf_beta(beta); + } + + /// Returns the hop size of the current model + pub fn frame_bytes(&self) -> usize { + // For 16-bit PCM, this equates to 960 bytes (480 samples * 2 bytes/sample). + self.0.hop_size * 2 + } +} + +/// Helper module for JNI operations +mod jni_helpers { + use super::*; + use std::ptr::NonNull; + + /// Safely get a mutable reference from a JNI pointer + pub fn get_native_ptr(ptr: jlong) -> Result<&'static mut T, String> { + if ptr == 0 { + return Err("Null pointer provided".to_string()); + } + + // Convert the jlong to a pointer and then to a reference + unsafe { + NonNull::new(ptr as *mut T) + .map(|mut p| p.as_mut()) + .ok_or_else(|| "Invalid pointer".to_string()) + } + } + + pub fn log_error(message: &str) { + eprintln!("[NativeDeepFilterNet Error] {}", message); + } +} + + +#[no_mangle] +pub extern "C" fn Java_com_rikorose_deepfilternet_NativeDeepFilterNet_newNative( + env: JNIEnv, + _: JClass, + model_bytes: JByteArray, + atten_lim: jfloat, +) -> jlong { + use jni_helpers::*; + + // Convert Java byte array to Rust vector + let model_bytes: Vec = match env.convert_byte_array(&model_bytes) { + Ok(bytes) => bytes, + Err(e) => { + log_error(&format!("Error converting jbyteArray: {:?}", e)); + return 0; + } + }; + + // Create the NativeDeepFilterNet instance + let df = match NativeDeepFilterNet::new(&model_bytes, 1, atten_lim) { + Ok(df) => df, + Err(e) => { + log_error(&format!("Failed to create NativeDeepFilterNet: {}", e)); + return 0; + } + }; + + // Box and convert to raw pointer + Box::into_raw(Box::new(df)) as jlong +} + +#[no_mangle] +pub extern "C" fn Java_com_rikorose_deepfilternet_NativeDeepFilterNet_freeNative( + _env: JNIEnv, + _: jclass, + ptr: jlong, +) { + if ptr == 0 { + return; + } + + unsafe { + // Convert back to Box and drop to properly free the memory + let _ = Box::from_raw(ptr as *mut NativeDeepFilterNet); + } +} + +#[no_mangle] +pub extern "C" fn Java_com_rikorose_deepfilternet_NativeDeepFilterNet_getFrameLengthNative( + _env: JNIEnv, + _: jclass, + ptr: jlong, +) -> jlong { + use jni_helpers::*; + + if ptr == 0 { + log_error("Null NativeDeepFilterNet pointer"); + return 0; + } + + match get_native_ptr::(ptr) { + Ok(state) => state.frame_bytes() as jlong, + Err(err) => { + log_error(&err); + 0 + } + } +} + +#[no_mangle] +pub extern "C" fn Java_com_rikorose_deepfilternet_NativeDeepFilterNet_setAttenLimNative( + _env: JNIEnv, + _: jclass, + ptr: jlong, + lim_db: jfloat, +) -> jboolean { + use jni_helpers::*; + + // Get NativeDeepFilterNet instance + let state = match get_native_ptr::(ptr) { + Ok(state) => state, + Err(err) => { + log_error(&err); + return JNI_FALSE; + } + }; + + // Set attenuation limit + state.set_atten_lim(lim_db); + + JNI_TRUE +} + +#[no_mangle] +pub extern "C" fn Java_com_rikorose_deepfilternet_NativeDeepFilterNet_setPostFilterBetaNative( + _env: JNIEnv, + _: jclass, + ptr: jlong, + beta: jfloat, +) -> jboolean { + use jni_helpers::*; + + // Get NativeDeepFilterNet instance + let state = match get_native_ptr::(ptr) { + Ok(state) => state, + Err(err) => { + log_error(&err); + return JNI_FALSE; + } + }; + + // Set post-filter beta + state.set_pf_beta(beta); + + JNI_TRUE +} + +#[no_mangle] +pub extern "C" fn Java_com_rikorose_deepfilternet_NativeDeepFilterNet_processFrameNative<'a>( + mut env: JNIEnv<'a>, + _: jclass, + ptr: jlong, + byte_buffer: JObject<'a> +) -> jfloat { + use jni_helpers::*; + + // Get the NativeDeepFilterNet instance + let state = match get_native_ptr::(ptr) { + Ok(state) => state, + Err(err) => { + log_error(&err); + return -10 as jfloat; + } + }; + + // Verify buffer is direct + let is_direct = env.call_method(&byte_buffer, "isDirect", "()Z", &[]) + .expect("Failed to call isDirect") + .z() + .expect("Failed to convert to boolean"); + + if !is_direct { + log_error("ByteBuffer must be direct"); + return -20 as jfloat; // Error code for non-direct buffer + } + + let byte_buffer = unsafe { JByteBuffer::from_raw(byte_buffer.into_raw()) }; + + let buffer_capacity = match env.get_direct_buffer_capacity(&byte_buffer) { + Ok(capacity) => capacity, + Err(e) => { + log_error(&format!("Failed to get direct buffer capacity: {:?}", e)); + return -30 as jfloat; + } + }; + + if buffer_capacity != state.frame_bytes() { + log_error(&format!( + "Invalid size for the ByteBuffer. Expected: {}, Got: {}", + state.frame_bytes(), + buffer_capacity + )); + return -40 as jfloat; + } + + // Get buffer pointer and capacity + let buffer_ptr = match env.get_direct_buffer_address(&byte_buffer) { + Ok(ptr) => ptr as *mut i16, + Err(e) => { + log_error(&format!("Failed to get direct buffer address: {:?}", e)); + return -50 as jfloat; + } + }; + + // Calculate hop size + let hop_size = std::cmp::min(buffer_capacity, state.hop_size()); + + // Create a slice view of the input buffer + let input_slice = unsafe { std::slice::from_raw_parts(buffer_ptr, hop_size) }; + + // Pre-allocate output buffer with zeros + let mut output_float = Array2::zeros((1, hop_size)); + + // Process in one step - convert i16 to float during array creation + let array = Array2::from_shape_fn((1, hop_size), |(_, i)| { + input_slice[i] as f32 / 32768.0 + }); + let input_float = array.view(); + + // Process the data + let lsnr = match state.0.process(input_float, output_float.view_mut()) { + Ok(lsnr) => lsnr, + Err(e) => { + log_error(&format!("Failed to process audio frame: {:?}", e)); + return -60 as jfloat; + } + }; + + // Convert processed floats back to shorts in-place + let output_float_slice = match output_float.as_slice() { + Some(slice) => slice, + None => { + log_error("Failed to get output as slice"); + return -70 as jfloat; + } + }; + + for (i, &float_val) in output_float_slice.iter().enumerate() { + // Clamp and convert to i16 in one step + let short_val = (float_val.max(-1.0).min(1.0) * 32767.0) as i16; + unsafe { + *buffer_ptr.add(i) = short_val; + } + } + + // Return the LSNR (Level of Suppressed Noise Ratio) + lsnr as jfloat +} + diff --git a/libDF/src/ios.rs b/libDF/src/ios.rs new file mode 100644 index 000000000..34e33ec98 --- /dev/null +++ b/libDF/src/ios.rs @@ -0,0 +1,138 @@ +use std::boxed::Box; +use std::ffi::{c_char, c_float, c_uint, CStr, CString, c_short}; +use std::path::PathBuf; +use std::str::FromStr; +use std::slice; + +use crossbeam_channel::TryRecvError; +use ndarray::prelude::*; + +use crate::tract::*; + +#[repr(C)] +pub struct DFState(crate::tract::DfTract); + +impl DFState { + + fn new(model_bytes: &[u8], channels: usize, atten_lim: f32) -> Self { + let r_params = RuntimeParams::default_with_ch(channels).with_atten_lim(atten_lim); + let df_params = DfParams::from_bytes(model_bytes).expect("Could not load model from path"); + let m = DfTract::new(df_params, &r_params).expect("Could not initialize DeepFilter runtime."); + DFState(m) + } + + fn boxed(self) -> Box { + Box::new(self) + } +} + +// C-compatible creation function +#[no_mangle] +pub extern "C" fn df_create( + model_bytes: *const u8, + model_size: usize, + channels: usize, + atten_lim: f32 +) -> *mut DFState { + // Safety: Convert raw pointer to Rust slice + let bytes = unsafe { + if model_bytes.is_null() || model_size == 0 { + return std::ptr::null_mut(); + } + slice::from_raw_parts(model_bytes, model_size) + }; + + let df = DFState::new(bytes, 1, atten_lim); + Box::into_raw(df.boxed()) +} + + +/// Get DeepFilterNet frame size in samples. +#[no_mangle] +pub unsafe extern "C" fn df_get_frame_length(st: *mut DFState) -> usize { + let state = st.as_mut().expect("Invalid pointer"); + state.0.hop_size +} + + +/// Set DeepFilterNet attenuation limit. +/// +/// Args: +/// - lim_db: New attenuation limit in dB. +#[no_mangle] +pub unsafe extern "C" fn df_set_atten_lim(st: *mut DFState, lim_db: f32) { + let state = st.as_mut().expect("Invalid pointer"); + state.0.set_atten_lim(lim_db) +} + +/// Set DeepFilterNet post filter beta. A beta of 0 disables the post filter. +/// +/// Args: +/// - beta: Post filter attenuation. Suitable range between 0.05 and 0; +#[no_mangle] +pub unsafe extern "C" fn df_set_post_filter_beta(st: *mut DFState, beta: f32) { + let state = st.as_mut().expect("Invalid pointer"); + state.0.set_pf_beta(beta) +} + +/// Processes a chunk of samples. +/// +/// Args: +/// - df_state: Created via df_create() +/// - input: Input buffer of length df_get_frame_length() +/// +/// Returns: +/// - Local SNR of the current frame. +#[no_mangle] +pub unsafe extern "C" fn df_process_frame( + st: *mut DFState, + input: *mut i16, + frame_size: usize, +) -> c_float { + let state = st.as_mut().expect("Invalid pointer"); + let hop_size = state.0.hop_size; // 512 + + if frame_size != hop_size { + return -1.0; + } + + let mut result: c_float = 0.0; + + // Convert first half of input from i16 to f32 + let mut input_float = Vec::with_capacity(hop_size); + + // Convert int16 values to float (scaling to the -1.0 to 1.0 range) + for i in 0..hop_size { + let int_value = *input.add(i); + // Scale int16 (-32768 to 32767) to float (-1.0 to 1.0) + let float_val = int_value as f32 / 32768.0; + input_float.push(float_val); + } + // Create input view + let input_view = match ArrayView2::from_shape((1, hop_size), input_float.as_slice()) { + Ok(input) => input, + Err(error) => { + return -4.0; // Error code for shape mismatch + } + }; + // Create output buffer for first half + let mut output_float = Array2::zeros((1, hop_size)); + let output_view = output_float.view_mut(); + // Process first half + result = state.0.process(input_view, output_view).expect("Failed to process first half of DF frame"); + let output_slice = output_float.as_slice().unwrap(); + // Write processed data back to first half of input buffer + for i in 0..hop_size { + let float_val = output_slice[i]; + let clamped = float_val.max(-1.0).min(1.0); + let short_val = (clamped * 32767.0) as i16; + *input.add(i) = short_val; + } + result +} + +/// Free a DeepFilterNet Model +#[no_mangle] +pub unsafe extern "C" fn df_free(model: *mut DFState) { + let _ = Box::from_raw(model); +} diff --git a/libDF/src/lib.rs b/libDF/src/lib.rs index 7ab568856..924b686e4 100644 --- a/libDF/src/lib.rs +++ b/libDF/src/lib.rs @@ -36,6 +36,12 @@ pub mod tract; #[cfg(feature = "wasm")] mod wasm; +#[cfg(feature = "android")] +mod android; + +#[cfg(feature = "ios")] +mod ios; + #[cfg(all(feature = "wav-utils", not(feature = "dataset")))] pub mod wav_utils; diff --git a/models/DeepFilterNet3_onnx_mobile.tar.gz b/models/DeepFilterNet3_onnx_mobile.tar.gz new file mode 100644 index 000000000..c13aee93c Binary files /dev/null and b/models/DeepFilterNet3_onnx_mobile.tar.gz differ diff --git a/models/deepfilternet_model_optimization.md b/models/deepfilternet_model_optimization.md new file mode 100644 index 000000000..51fffc0bb --- /dev/null +++ b/models/deepfilternet_model_optimization.md @@ -0,0 +1,37 @@ +## Deepfilternet model optimization + +### Goal +The deepfilternet model is designed to be light and fast, so it is also suitable for running on mobile devices. +Some tests are conducted, to see how it performes in realtime on relatively new, and older, android devices. +Google Pixel 3A is chosen as an older device, the Samsung Flip 3 is chosen as a newer device. +The Deepfilternet3 model processes audio chunks smoothly on the Samsung Flip 3, while it failed to process chunks correctly on the Google Pixel 3A, it is too slow and the resulting audio is corrupted. +The Goal was therefore to optimise the Deepfilternet3 model to be able to process audio samples smoothly even on older devices such as the Google Pixel 3A. + +### Fusing Layers +The first technique tried is Fusing Layers. +The Deepfilternet network is divided into encoder, erb decoder and df decoder. +Although with different structures, all the three components are of the "CNN + RNN" type, where the RNN part is a squeezed GRU, an efficient type of recurrent neural network. +In the convolutional part, each Conv layer is followed by a Batch normalization layer (Bn) and a Relu layer, the Conv + bn + Relu block can be fused, resulting in a single, more efficient layer. +This not reduce the size of the model, just made the inference more efficient especially on CPU. +With the fusing layers operation, the model also became performant on the Google Pixel 3A. + +### Quantization +Quantization of the model is also tried. Weights and activation functions are in float32 precision, converting them into int8 precision, it should give an advantage on mobile devices as int8 calculations are performed faster. +Considering the structure of the network, the most appropriate choice is to apply static quantization to the convolutional layers, as CNN have a highly regular structure and perform repetitive and predictable operations on the feature maps. +This allows efficient inference optimization while maintaining good accuracy. +For GRU layers, it is preferable to use dynamic quantization, as they process sequential data with hidden states and gates that vary at each time step, making the internal dynamics of the model less suitable for static quantization. +Dynamic quantization reduces approximation errors, as it avoids directly to quantize activations and is better suited to the variable behaviour of recurrent models. +#### Pytorch +Applying these quantizations to the pytorch model, results in a model that is about half the size and runs on a PC almost twice as fast. +The problem is that it must be converted to onnx, as the inference on mobile is then done in rust with the tract-onnx library. +Pytorch Quantized layers, however, cannot be exported to onnx, so this way is not possible. +#### Onnx +it is also possible to do the same quantization directly in Onnx, with Onnxruntime, in this case the model is reduced in size as in Pytorch, the gain in inference time measured on PC is less, as Onnx model is already more optimised than the models in Pytorch format. +However, trying then to make inference with quantized Onnx model using tract-onnx, it does not work, as there are unsupported quantized layers. +So it was not possible to use the quantized model on mobile to see the gain in inference time. + +### Further Actions +- Verify it is possible to make inference with Onnxruntime in rust, since with Tract-Onnx it doesn't work, and quantization in python is done with Onnxruntime. +- Train a model with fewer parameters or a lower sample rate (16khz, 24khz), perhaps using the distillation process. + + diff --git a/scripts/onnx_dyn_quantization.py b/scripts/onnx_dyn_quantization.py new file mode 100644 index 000000000..997678cfc --- /dev/null +++ b/scripts/onnx_dyn_quantization.py @@ -0,0 +1,18 @@ +from onnxruntime.quantization import quant_pre_process, quantize_dynamic, QuantType +import onnx + + +input_model_path = "enc.onnx" +preprocessed_model_path = "model_preprocessed.onnx" +quantized_model_path = "enc_quant.onnx" + +model = onnx.load(input_model_path) +quant_pre_process( + input_model_path=input_model_path, + output_model_path=preprocessed_model_path +) +quantize_dynamic( + preprocessed_model_path, + quantized_model_path, + weight_type=QuantType.QInt8 +) \ No newline at end of file diff --git a/scripts/onnx_static_quantization.py b/scripts/onnx_static_quantization.py new file mode 100644 index 000000000..4bfd11154 --- /dev/null +++ b/scripts/onnx_static_quantization.py @@ -0,0 +1,84 @@ +from torch.nn import functional as F +from torch import nn +from onnxruntime.quantization import quantize_static, quant_pre_process, CalibrationDataReader, QuantType, QuantFormat +import onnx +import onnxruntime as ort +from df.io import load_audio +from df.enhance import df_features, init_df +from df.model import ModelParams +import warnings +warnings.filterwarnings("ignore") + + +def calibration_data_generator(model_type,input_model_path): + for file_path in samples: + audio, meta = load_audio(file_path, sr=df_state.sr()) + n_fft, hop = df_state.fft_size(), df_state.hop_size() + audio = F.pad(audio, (0, n_fft)) + spec, feat_erb, feat_spec = df_features(audio, df_state, p.nb_df, device="cpu") + pad_feat = nn.ConstantPad2d((0, 0, -p.conv_lookahead, p.conv_lookahead), 0.0) + feat_spec = feat_spec.squeeze(1).permute(0, 3, 1, 2) + feat_erb = pad_feat(feat_erb) + ort_sess = ort.InferenceSession(input_model_path) + e0,e1,e2,e3,emb,c0,lsnr = ort_sess.run(None, {'feat_erb':feat_erb.numpy(), 'feat_spec': feat_spec.numpy()}) + if model_type == 'enc': + yield {'feat_erb': feat_erb.numpy(), 'feat_spec': feat_spec.numpy()} + if model_type == 'erb_dec': + yield {'emb':emb, 'e3':e3, 'e2':e2, 'e1':e1, 'e0':e0} + if model_type == 'df_dec': + yield {'emb':emb, 'c0':c0} + +class DataReader(CalibrationDataReader): + def __init__(self, data_generator, model_type, input_model_path): + self.data_generator = data_generator + self.iterator = iter(self.data_generator(model_type, input_model_path)) + + def get_next(self): + try: + return next(self.iterator) + except StopIteration: + return None + +def quant_layer(model_type, input_model_path, quantized_model_path): + preprocessed_model_path = "model_preprocessed.onnx" + ''' + You could apply only to some layers + model = onnx.load(input_model_path) + nodes_to_exclude = [] + for node in model.graph.node: + if node.op_type != "Conv": + nodes_to_exclude.append(node.name) + ''' + + quant_pre_process( + input_model_path=input_model_path, + output_model_path=preprocessed_model_path + ) + calibration_reader = DataReader(calibration_data_generator, model_type, input_model_path) + quantize_static( + preprocessed_model_path, + quantized_model_path, + calibration_reader, + quant_format=QuantFormat.QDQ, + activation_type=QuantType.QInt8, + weight_type=QuantType.QInt8 + #nodes_to_exclude=nodes_to_exclude + ) + + +if __name__ == "__main__": + import glob + import random + path_to_dataset = 'drive/MyDrive/BWAVN' + files = glob.glob(f'{path_to_dataset}/*') + input_model_path = "enc.onnx" + quantized_model_path = "enc_quant_static.onnx" + #model type is enc, erb_dec or df_dec + model_type = 'enc' + n_samples = 101 + random.seed(10) + samples = random.sample(files, n_samples) + layers = ['enc','erb_dec','df_dec'] + model, df_state, _ = init_df() + p = ModelParams() + quant_layer(model_type, input_model_path, quantized_model_path) \ No newline at end of file diff --git a/scripts/pt_quantization.py b/scripts/pt_quantization.py new file mode 100644 index 000000000..2aebe6b40 --- /dev/null +++ b/scripts/pt_quantization.py @@ -0,0 +1,147 @@ +import os +from copy import deepcopy + +import torch +from torch.ao.quantization import ( + MinMaxObserver, + get_default_qconfig_mapping, + QConfig, + QConfigMapping, + quantize_dynamic +) +from torch.ao.quantization.quantize_fx import convert_fx, prepare_fx + +from df.enhance import df_features, init_df +from df.io import load_audio +from df.model import ModelParams +from df.utils import get_device + + +@torch.no_grad() +def main(model, df_state, p, samples): + model.eval() + qconfig = QConfig( + activation=MinMaxObserver.with_args(dtype=torch.qint8), + weight=MinMaxObserver.with_args(dtype=torch.qint8), + ) + ''' + with default qmapping cannot export in onnx, to unsupported layer + with this type of configurations no quantization is applied, just fusing layers + #qconfig_mapping = get_default_qconfig_mapping("qnnpack") + ''' + qconfig_mapping = QConfigMapping().set_global(qconfig) + audio, _ = load_audio(samples[0], sr=df_state.sr()) + spec, feat_erb, feat_spec = df_features(audio, df_state, p.nb_df, device=get_device()) + feat_spec = feat_spec.squeeze(1).permute(0, 3, 1, 2) + e0, e1, e2, e3, emb, c0, lsnr = model.enc(feat_erb, feat_spec) + _ = model.erb_dec(emb, e3, e2, e1, e0) + _ = model.df_dec(emb, c0) + #In case of Dynamic Quant no need of calibration + ''' + enc = quantize_dynamic(model.enc, qconfig_dict_dyn) + erb_dec = quantize_dynamic(model.erb_dec, qconfig_dict_dyn) + df_dec = quantize_dynamic(model.df_dec, qconfig_dict_dyn) + ''' + enc = model.enc + erb_dec = model.erb_dec + df_dec = model.df_dec + enc_prep = prepare_fx(enc, qconfig_mapping, example_inputs=(feat_erb, feat_spec)) + erb_dec_prep = prepare_fx(erb_dec, qconfig_mapping, example_inputs=(emb, e3, e2, e1, e0)) + df_dec_prep = prepare_fx(df_dec, qconfig_mapping, example_inputs=(emb, c0)) + for file_path in samples[1:]: + audio, _ = load_audio(file_path, p.sr) + spec, feat_erb, feat_spec = df_features(audio, df_state, p.nb_df, device=get_device()) + feat_spec = feat_spec.squeeze(1).permute(0, 3, 1, 2) + with torch.no_grad(): + e0, e1, e2, e3, emb, c0, _ = enc_prep(feat_erb, feat_spec) + _ = erb_dec_prep(emb, e3, e2, e1, e0) + _ = df_dec_prep(emb, c0) + enc_static = convert_fx(enc_prep) + erb_dec_static = convert_fx(erb_dec_prep) + df_dec_static = convert_fx(df_dec_prep) + torch.save(enc_static, os.path.join("enc_quant.pt")) + torch.save(erb_dec_static, os.path.join("erb_dec_quant.pt")) + torch.save(df_dec_static, os.path.join("df_dec_quant.pt")) + + dynamic_axes = { + "feat_erb": {2: "S"}, + "feat_spec": {2: "S"}, + "e0": {2: "S"}, + "e1": {2: "S"}, + "e2": {2: "S"}, + "e3": {2: "S"}, + "emb": {1: "S"}, + "c0": {2: "S"}, + "lsnr": {1: "S"}, + } + + torch.onnx.export( + model=deepcopy(enc_static), + f='enc_q.onnx', + args=(feat_erb, feat_spec), + input_names= ["feat_erb", "feat_spec"], + dynamic_axes=dynamic_axes, + output_names = ["e0", "e1", "e2", "e3", "emb", "c0", "lsnr"], + opset_version=14, + keep_initializers_as_inputs=False, + do_constant_folding=True, + export_params=True + ) + + inputs = (emb.clone(), e3, e2, e1, e0) + input_names = ["emb", "e3", "e2", "e1", "e0"] + output_names = ["m"] + dynamic_axes = { + "emb": {1: "S"}, + "e3": {2: "S"}, + "e2": {2: "S"}, + "e1": {2: "S"}, + "e0": {2: "S"}, + "m": {2: "S"}, + } + torch.onnx.export( + model=deepcopy(erb_dec_static), + f='erb_dec_q.onnx', + args=inputs, + input_names= input_names, + dynamic_axes=dynamic_axes, + output_names = output_names, + opset_version=14, + keep_initializers_as_inputs=False, + do_constant_folding=True, + export_params=True + ) + inputs = (emb.clone(), c0) + input_names = ["emb", "c0"] + output_names = ["coefs"] + dynamic_axes = { + "emb": {1: "S"}, + "c0": {2: "S"}, + "coefs": {1: "S"}, + } + torch.onnx.export( + model=deepcopy(df_dec_static), + f='df_dec_q.onnx', + args=inputs, + input_names= input_names, + dynamic_axes=dynamic_axes, + output_names = output_names, + opset_version=14, + keep_initializers_as_inputs=False, + do_constant_folding=True, + export_params=True + ) + + +if __name__ == "__main__": + import glob + import random + + path_to_dataset = 'drive/MyDrive/BWAVN' + files = glob.glob(f'{path_to_dataset}/*') + n_samples = 101 + random.seed(10) + samples = random.sample(files, n_samples) + model, df_state, _ = init_df() + p = ModelParams() + main(model, df_state, p, samples) \ No newline at end of file