Repository navigation
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b79d729a95
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 02aa44437f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Hi, what is this PR supposed to do again? You have an issue? Microphone is a very sensitive area and the issues that come up are very large. So I'd be very careful before merging this. But if you want to have a discussion on this, we are happy to take a look at it. @grohith327 for viz |
|
@altic-dev yes, FluidVoice is not usable for me since 1.6.7. The issue I had created: #852 This PR fixes that built-in microphone stops capturing input after 3 seconds of dictation on Apple M1. It switches built-in microphone capture to AVAudioEngine instead of using direct Core Audio. Only switches if both selected and default microphone are built-in and it's Apple Silicon. |
We're trying to move away from AvAudio and w e need to find a bette way for this. @grohith327 wdyt? Not sure how to fix this in a bette way |
|
@Defake The AVAudioEngine flow that exists right now will simply be removed in future commits as we have fully committed to the CoreAudio flow. The equivalent fix for this in CoreAudio flow is there in this commit - 6fe6143 Can you try building this and let us know if it works. Thank you for trying really hard to get FV work! |
|
@grohith327 thanks, I tried it 2 weeks ago, it didn't fix the issue: #852 (comment) The problem is not zero-PCM. Capture starts normally and works for 3.5 seconds. Then corespeechd mutes the built-in microphone. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95b08c30a4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
I reworked this PR so it works with Core Audio now. |
|
Could you try a simpler Core Audio approach first? Start the built-in output with The keep alive should also be best effort. If it fails, it shouldn’t delay or stop microphone capture. The current version you have could cause dictation fails in a lot of devices if it fails. |
95b08c3 to
5aef500
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5aef50044f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| private func stopOutputKeepAlive() { | ||
| guard let deviceID = self.outputKeepAliveDeviceID else { return } | ||
| self.outputKeepAliveDeviceID = nil | ||
| _ = AudioDeviceStop(deviceID, nil) |
There was a problem hiding this comment.
Stop only FluidVoice's keep-alive IOProc
When another application is playing through the built-in output during dictation, AudioDeviceStop(deviceID, nil) stops the device as a whole rather than a keep-alive operation owned by FluidVoice, so ending direct capture can interrupt or strand that application's playback. Register and retain a dedicated no-op output IOProc and pass its ID to both AudioDeviceStart and AudioDeviceStop instead of using the device-wide nil form.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This suggests to reintroduce the larger IOProc solution we decided to remove
|
@altic-dev thanks, it worked! I reworked the PR to use the simpler solution, please take a look |
|
This pull request has been marked stale because it has had no activity for 5 days. It will be closed in 2 days if there is no further activity. Add the |
5aef500 to
03f1c1c
Compare
|
Still actual. |
|
Thanks! does it still work well? can merge this soon. |
FluidVoice PR build readyDownload FluidVoice-PR-912-9bd0810532dc The artifact contains the ad-hoc-signed app ZIP, Xcode archive, build manifest, and installation instructions. It expires 5 days after the build. Install the app
This build has its own app identity, so its permissions are separate from the release version of FluidVoice. |
|
@altic-dev yes, I tried the new build, it works 👍 Thank you. |
|
This pull request has been marked stale because it has had no activity for 5 days. It will be closed in 2 days if there is no further activity. Add the |
03f1c1c to
9bd0810
Compare
|
Rebased the PR |
|
This pull request has been marked stale because it has had no activity for 5 days. It will be closed in 2 days if there is no further activity. Add the |
|
Thanks for sticking with this and simplifying the fix. It keeps the current Core Audio approach, and your confirmation that it fixes the cutoff is helpful. Before merging, I’d like to address two things:
I also tested the concern about interrupting another app’s audio. Its callbacks continued through repeated start/stop cycles, so I couldn’t reproduce that locally. We should still check actual playback while starting and stopping dictation. |
9bd0810 to
5fc09e7
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5fc09e7cf2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| self.packetHandler = packetHandler | ||
| // Discover output candidates during idle preparation, not on each Start. | ||
| // The lifecycle controller rebuilds this input after topology changes. | ||
| #if arch(arm64) |
There was a problem hiding this comment.
Detect Apple Silicon when running under Rosetta
When FluidVoice's universal release is launched using its x86_64 slice under Rosetta on an Apple Silicon Mac, this compile-time branch takes the #else and prepares no output IDs. The release is configured for standard architectures with ONLY_ACTIVE_ARCH = NO (Fluid.xcodeproj/project.pbxproj:970-1023), and Rosetta does not change the underlying Core Audio hardware, so direct built-in-microphone capture again lacks the keep-alive and can go silent or truncate. Detect the physical host/translation state at runtime and pass that result to the policy instead of using the process architecture.
Useful? React with 👍 / 👎.
Description
On Apple Silicon, direct Core Audio capture from the built-in microphone can become silent after about 3.5 seconds and truncate dictation. Keep the built-in output hardware active during capture with
AudioDeviceStart(outputDeviceID, nil), then release it withAudioDeviceStop(outputDeviceID, nil).Output candidates are discovered during idle input preparation and refreshed when topology changes rebuild the input, avoiding a device scan before each recording. Cleanup retries once immediately, clears the saved device only after success, and logs failures while retaining it for a later stop or teardown. Output failures remain best effort and do not block microphone capture.
Type of Change
Related Issue or Discussion
Closes #852
Testing
wrapPropertyBodiesandwrapIfStatementBodiesviolations excludedThe arm64 Debug test build succeeded on 1.6.10-beta.8 (build 27). The test host used the existing
FLUIDVOICE_MIC_PHASE1=pr912-testsopt-in in its xctestrun environment to bypass onboarding and model downloads. Test selection:DirectAudioReliabilityTests: 58 passed, including output preparation, start fallback, transient/permanent stop failures, and later cleanup.AudioHardwareRecoveryTests: 15 passed.MonitorTopologyRecoveryTests: the two prepared-input topology refresh tests passed.NormalAudioCaptureCompatibilityTests: the 50-cycle prepared start/stop test passed.Manual playback check on the PR build (1.6.10-beta.7, before the rebase): select the built-in microphone, disable Pause Media During Transcription, play music, and repeatedly start and stop dictation, including recordings beyond the original cutoff. Music kept playing normally. Logs show nine completed recordings, no dropped audio packets, and no keep-alive cleanup warnings. The capture implementation was preserved unchanged by the rebase.
Intel runtime and the full repository test suite were not run for this update.
Screenshots / Video
Copyable local test output:
Notes
A persistent output-stop failure can leave the output hardware active until a later cleanup succeeds or the process exits. It is logged and does not prevent dictation. The keep-alive remains limited to the Apple Silicon built-in microphone path.
Codex assisted with implementation and automated verification. The author approved the approach and performed the manual playback check.