Repository navigation
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
43.3.0
What operating system(s) are you using?
macOS
Operating System Version
macOS Tahoe 26.5.2 (arm64 / Apple Silicon)
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
Unknown — have not found a version where this works via a custom picker.
Does the issue also appear in Chromium / Google Chrome?
I don't know how to test
Expected Behavior
When session.setDisplayMediaRequestHandler is used with useSystemPicker: false (i.e. the app supplies its own picker UI and resolves the callback with a desktopCapturer source plus audio: 'loopback' or audio: 'loopbackWithMute'), the resulting audio MediaStreamTrack should actually capture system audio, the same way it does when useSystemPicker: true is used instead.
Actual Behavior
The audio track is created (kind: "audio", label: "System audio"), so the API call itself succeeds, but the track's readyState is "ended" from the very first observation, and no audio data is ever captured — an AnalyserNode attached to the track reports peakAmplitude: 0 at every sample, forever. The video track from the same getDisplayMedia() call works fine (readyState: "live", frames render normally) — only the audio side fails.
Swapping the same request handler to useSystemPicker: true (letting Electron/macOS own the whole picker UI) makes system-audio capture work correctly and also correctly triggers the macOS "would like to record system audio" TCC permission prompt. With useSystemPicker: false, that TCC prompt never appears at all — which is consistent with the underlying native audio-capture session never actually starting, even though the JS-level API returns a track as if it had.
This makes audio: 'loopback'/'loopbackWithMute' unusable for any app that wants to keep its own custom screen-share picker UI while also offering a "share system audio" option — the only way to get working system audio is to hand the entire picker over to useSystemPicker: true, which replaces the app's own UI.
Reproduces identically on an ad-hoc electron . run and on a Developer ID-signed, hardened-runtime, notarization-skipped, /Applications-installed packaged build — so this isn't a code-signing or Gatekeeper/TCC-staleness issue.
Testcase Gist URL
Additional Information
Steps to reproduce with the gist:
npm installin the gist's directory, thennpm start(orelectron .).- The renderer calls
getDisplayMedia({ video: true, audio: true }). - Watch the on-screen log: the audio track appears with
readyState=endedimmediately, and the peak-amplitude readout stays at0.0000indefinitely, while the video track stayslive. - For comparison, change
useSystemPicker: falsetouseSystemPicker: trueinmain.jsand repeat — the native macOS picker appears, the TCC "record your system audio" prompt fires, and after granting it, real audio is captured (non-zero peak amplitude).
In-depth investigation
We believe the root cause is that macOS's system-audio capture (the ScreenCaptureKit-backed Core Audio Tap, gated behind the separate "System Audio Recording Only" TCC permission introduced in newer macOS versions) is only ever started by Electron when Electron's own native picker (useSystemPicker: true) drives the capture end-to-end. When an app supplies its own desktopCapturer-selected source through a custom picker instead, the 'loopback'/'loopbackWithMute' audio request appears to be accepted and a track handle is handed back, but the corresponding native capture session is never actually wired up — no TCC prompt is ever shown for the app through this path, and getUserMedia/getDisplayMedia never delivers audio samples.
We were unable to find any workaround from the app side (no combination of Chromium command-line switches changed the result), and confirmed the failure is independent of code signing, notarization, and running from /Applications vs. an ad-hoc build directory.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields👍 Does Not Block Stable
Activity
anildigital commentedon Aug 9, 2026
Follow-up after more digging: this is not a duplicate of #49607 (which is closed) — I confirmed our app's
Info.plistalready hasNSAudioCaptureUsageDescriptionset (added by #49717, and present by default in Electron 43.3.0's own bundledInfo.plistinnode_modules/electron/dist/Electron.app). So the missing-plist-key issue from #49607 does not apply here and does not fix this.With
enable-logging/v=1, I see the exact same failure signature #49607 diagnosed:The difference: #49607's repro (and its fix) went through the case where the permission probe eventually succeeds once the plist key is present. In our case (
useSystemPicker: false, app supplies its owndesktopCapturer-selected source via a custom picker), the permission probe fails every time, with the plist key already present, and no TCC prompt for "System Audio Recording Only" is ever shown to the user at all — checked directly in System Settings → Privacy & Security, no entry appears for the app through this path. Switching the same code touseSystemPicker: truedoes trigger that TCC prompt and does work.So this looks like a second, narrower gap: the CoreAudio Tap permission probe/prompt only ever gets triggered when Electron's own native picker owns the capture; it's never triggered for a developer-supplied source passed through a custom picker, independent of the
NSAudioCaptureUsageDescriptionfix. Happy to pull morev=1logs or test other flag combinations if useful — also saw theMacCatapLoopbackAudioForScreenSharedisable-features flag mentioned in the #49717 docs update and can test that combination too if helpful.(Also noting #51154 for anyone else who finds this thread — that was a different, unrelated proposal that was closed/rejected, not a fix for this.)
fix(recording): tell a Mac user to add Obsidian with the + button
feat(recording): record the system output on macOS 14.2+ with Electro…