From 9502580b5afb97a8a224dd8f1c88c81098f36bf7 Mon Sep 17 00:00:00 2001 From: EdisonJwa Date: Sun, 17 May 2026 01:00:50 +0800 Subject: [PATCH] chore(audio,ios): silence cpal-side dead_code on iOS + regen Podfile.lock (rc.8+62) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two follow-ups after the iOS Rust build went green at 5de6ecc: 1. cpal-side framing constants (SAMPLE_RATE / FRAME_SAMPLES / MAX_OPUS_FRAME) are dead code in the current iOS commit because the VPIO callbacks are still no-op stubs and don't reach the constants yet (commits 3 + 4 will). They are genuinely live on every other platform via the cpal capture pipeline. Mark each with #[allow(dead_code)] and add a comment pointing at the commits that will reactivate them on iOS, instead of cfg-gating per-platform (the constants are framing invariants of the engine itself, not per-backend details). 2. ios/Podfile.lock regenerated on the Mac via 'pod install' to register package_info_plus (0.4.5) which landed in 97a6ba6. Without this regen the Xcode build fails with 'The sandbox is not in sync with the Podfile.lock' because Xcode's CocoaPods integration check sees a new plugin in pubspec.yaml that has no matching Pod entry. Five pods now in the lockfile: Flutter, audio_session, chanora_bridge, connectivity_plus, package_info_plus. Build counter 61 -> 62 — the About dialog will display v1.0.0-rc.8+62 so the user can confirm the build under test matches this commit (the previous build said +61). --- apps/chanora_flutter/ios/Podfile.lock | 6 ++++++ apps/chanora_flutter/pubspec.yaml | 2 +- crates/chanora_audio/src/engine.rs | 10 ++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/apps/chanora_flutter/ios/Podfile.lock b/apps/chanora_flutter/ios/Podfile.lock index 68c6fe0..531805f 100644 --- a/apps/chanora_flutter/ios/Podfile.lock +++ b/apps/chanora_flutter/ios/Podfile.lock @@ -5,12 +5,15 @@ PODS: - connectivity_plus (0.0.1): - Flutter - Flutter (1.0.0) + - package_info_plus (0.4.5): + - Flutter DEPENDENCIES: - audio_session (from `.symlinks/plugins/audio_session/ios`) - chanora_bridge (from `.`) - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - Flutter (from `Flutter`) + - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) EXTERNAL SOURCES: audio_session: @@ -21,12 +24,15 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/connectivity_plus/ios" Flutter: :path: Flutter + package_info_plus: + :path: ".symlinks/plugins/package_info_plus/ios" SPEC CHECKSUMS: audio_session: 9bb7f6c970f21241b19f5a3658097ae459681ba0 chanora_bridge: af821d2c0507cb3199c91be12996bf0eb6b8bf5d connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 + package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499 PODFILE CHECKSUM: 15f58b0363434f244766f3301e00b9b1cdee096a diff --git a/apps/chanora_flutter/pubspec.yaml b/apps/chanora_flutter/pubspec.yaml index 9b6ccac..12cc436 100644 --- a/apps/chanora_flutter/pubspec.yaml +++ b/apps/chanora_flutter/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.0-rc.8+61 +version: 1.0.0-rc.8+62 environment: sdk: ^3.11.5 diff --git a/crates/chanora_audio/src/engine.rs b/crates/chanora_audio/src/engine.rs index dbb762d..aef1028 100644 --- a/crates/chanora_audio/src/engine.rs +++ b/crates/chanora_audio/src/engine.rs @@ -51,8 +51,18 @@ use crate::AudioError; pub struct SessionAudioId(pub u64); /// Audio framing: 48 kHz mono, 20 ms = 960 samples per frame. +/// These constants are framing invariants of the engine and are +/// referenced from per-platform helpers (`try_open_capture` and +/// the CaptureState on cpal platforms; `ios_voice_unit` on iOS once +/// commits 3+4 land). The `allow(dead_code)` is here because in +/// the current commit the iOS VPIO callbacks are still no-op stubs +/// and don't reach these constants yet — they will in commit 3 +/// when the input callback wires into CaptureState. +#[allow(dead_code)] const SAMPLE_RATE: u32 = 48_000; +#[allow(dead_code)] const FRAME_SAMPLES: usize = 48_000 / 50; // 960 +#[allow(dead_code)] const MAX_OPUS_FRAME: usize = 1275; /// Engine configuration.