hydra-synth / atom-hydra

78 stars 29 forks source link

atom-hydra on mac catalina not requesting mic or camera permissions #35

Open jholtzkener-at-cbc opened 3 years ago

jholtzkener-at-cbc commented 3 years ago

Atom-hydra does not request permission to use the microphone or the camera on my macbook (running macOS Catalina 10.15.7). When running code in hydra such asa.show() or s0.initCam(), I get no errors, but the the system does not ask for permission to use the mic or the camera and silently fails.

I can see in the System Preferences that Atom does not have the option to allow microphone use (i.e., there is no checkbox). The same is true for the camera.

Screen Shot 2020-11-15 at 10 17 24 AM

In contrast, when I run code for producing feedback, it did ask for permission for Screen Recording, and this is visible in the System Preferences:

Screen Shot 2020-11-15 at 10 17 06 AM

I have tried reinstalling Atom and atom-hydra, as well as resetting the privacy settings with tccutil reset, but it has no effect - it asks permissions again for screen recording, but does not ask for camera or microphone

pkarydogiannis commented 3 years ago

Same issue in Mojave.

elunaj commented 3 years ago

I’m also experiencing this in Big Sur 11.1.

Is anyone working on this issue? If not, I’d like to volunteer. I use this package a ton and would like to contribute to it. I can’t promise a solution, but I’d give it a go :)

livacengiz commented 3 years ago

hi folks,

i worked this issue. but it's so complex for me. I think this problem is caused by atom. I tried it with veda but I could not be successful there either.

I am open to ideas. I would like to solve this problem :)

ojack commented 3 years ago

I have been trying as well, but have no solution so far. It is related to https://github.com/electron/electron/issues/20498 and there is further information at https://github.com/ojack/hydra/issues/103.

So far, I have been able to access system preferences from inside the hydra plugin by including them in main.js as follows.

import { desktopCapturer, remote } from 'electron'
const { systemPreferences } = remote

However, running systemPreferences.askForMediaAccess('microphone') causes Atom to crash. It seems related to the plist entries documented above, but I can't figure out how to edit those in Atom.

@elunaj @livacengiz any help with this is greatly appreciated! Feel free to comment here or in the dev channel at the hydra discord https://discord.gg/82EYfdFEmz

elunaj commented 3 years ago

@ojack sure, I'll gladly take a look at this! Also, I joined the hydra discord.

jidagraphy commented 3 years ago

are there no updates to this issue? macOS Big Sur, and can confirm it still doesnt work, and i cant seem to find any reference to atom's permission granting :(

xu-hong commented 3 years ago

Also following up on this thread - Catalina still doesn't work

ffd8 commented 2 years ago

Processing on 10.15+ had a similar issue – maaaybe opening via Terminal can request the right premissions??https://www.youtube.com/watch?v=xNa_ua_esmw

jholtzkener-at-cbc commented 2 years ago

@ffd8 That was a good suggestion - but unfortunately I still get the silent failure when I open via Terminal (in the way suggested in the video)

edit: my mistake - it worked for me!

ojack commented 2 years ago

@jholtzkener-at-cbc It actually just worked for me! when I combined the terminal method with the systemPreferences.askForMediaAccess('microphone') and systemPreferences.askForMediaAccess('camera') from above. It is still not requesting permission, but just started to show my camera.

Screenshot 2021-10-12 at 15 01 29

I added electron system preferences to the global namespace in atom-hydra. Hopefully these are the steps to recreate this: 1) update the atom-hydra package to the latest version (should be version 0.3.6) 2) open Atom following @ffd8's video above, by first right clicking on the atom icon, clicking Show Package Contents > Contents > MacOS > Atom 3) Toggle atom-hydra to on 4) open the Atom developer tools. type systemPreferences.askForMediaAccess('microphone') and click enter. type systemPreferences.askForMediaAccess('camera') and click enter. 5) You can try running the camera at this stage in atom-hydra. However, for me it didn't work until I fully exited everything and rejoined. 6) quit atom 7) open atom again following step 2. Turn on atom-hydra. Run the following code:

s0.initCam()
src(s0).out()

It now continuously works for me if I open atom via the terminal. Still would like to find a better way to solve this, but hopefully it works for others in the meantime.

jholtzkener-at-cbc commented 2 years ago

@ojack, I tried it again after seeing your post, and it works! I didn't even get to systemPreferences.askForMediaAccess('microphone') and systemPreferences.askForMediaAccess('camera') before it asked permissions. I think that perhaps the only steps I was missing the first time was restarting atom (and possibly updating atom-hydra).

Anyway, thank you @ffd8 and @ojack !

ojack commented 2 years ago

@jholtzkener-at-cbc so happy to hear that!! mine still doesn't request permissions, but at least it works in the meantime

ffd8 commented 2 years ago

Woohoo – happy to hear it worked! (yeah, closing and re-opening seems to be key). Curious if continues working from just opening app (without launching via terminal)? ... otherwise just need to add that fancy binary to the dock.