Repository navigation
fix: report why macOS system audio capture stopped - #590
Merged
Merged
Conversation
A stopped ScreenCaptureKit stream always failed with a hint to check the recording permission, even when the user ended the capture from the menu bar or the display went away. The failure now names the actual cause: stopped by the user, permission declined, or the system's error code and description. Capture timestamps are translated from the stream's synchronization clock, as ScreenCaptureKit documents, falling back to the host clock when the stream reports none.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A stopped ScreenCaptureKit stream always failed with a hint to check the recording permission, even when the user ended the capture from the menu bar or the display went away.
SystemAudioSource.getFailure()now names the actual cause:SCStreamErrorUserStopped: "stopped by the user", without the permission hintSCStreamErrorUserDeclined: asks to grant screen/audio recording permissionCapture timestamps are now translated from the stream's
synchronizationClock, as ScreenCaptureKit documents, falling back to the host clock when the stream reports none. Both APIs are available from macOS 13, the existing minimum for system audio.Testing
On macOS 14.5 (arm64), with the native library rebuilt:
SystemAudioSourceTest: 7/7 passSystemAudioSourceIntegrationTest(-Dtest.systemAudio=true, audio playing on the default output): passes, including the restartThe new stop messages need a manual stop from the menu bar and were not triggered by a test. macOS 13, macOS 15 and x86_64 were not tested.