hydra-synth / hydra

Livecoding networked visuals in the browser

Home Page:https://hydra.ojack.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

audio input and video input don't work in atom

opened this issue · comments

hi

i had install hydra on atom, but when i try to use 4-audio-reactivity (from exemple) or try to use camera input
nothing happen, but the same code in hydra.ojack.xyz work fine.

how i can fix this issue?

@santoluigi can you share your code that isn't working?

this is the code for mic input:

a.show()
a.setBins(20)
a.fft[2]
osc(10, 0, () => (a.fft[2]*2))
.out()

this is the code for camera input:

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

I tried it on linux and work good, but on Mac the audio input and the camera input don't work.

thanks

if you're using macOS 10.15 (Catalina) did you grant mic/camera access to atom?
see: hydra-synth/hydra-synth#55

yes I'am using macOs 10.15.6 (Catalina). i saw your issue. Atom doesn't have any permissions, but it doesn't even require it ... how do I get it into the permissions if it doesn't ask for it?

have you tried entering this into the developer console?

navigator.getUserMedia(
   {audio: true, video: true}, 
   (stream) => {console.log(stream)},
   (e) => {alert('Error capturing audio.')}
)

hi

yes, but nothing change

Schermata 2020-09-01 alle 09 11 24

it was working for me but I think that had to do with previously giving atom permissions. I reinstalled my OS to test and found that now I also can't grant permission to atom.

it looks like this might have to do with electron
electron/electron#17640 (comment)

i don't think atom has these entitlements that allow for cam/mic access anymore
(this is a beta commit but idk what version 1.50.0 is like)
atom/atom@4139da8#diff-010d1a8b66df8d61b88cf2028bf6c444

i don't think this is something that can be solved via the atom-hydra extension

Hey @zachkrall thank you for researching this! This is bad news :/ I tried this on a new mac as well and had the same issue. It is interesting that screen share still seems to work.
Maybe adding https://www.electronjs.org/docs/api/system-preferences#systempreferencesaskformediaaccessmediatype-macos this could help.
Will try the next time I get a chance :)

@ojack i looked at forking atom yesterday to see if i could override some of those settings manually. systemPreferences didn't seem to be exposed in the window object for atom.

what are your thoughts on making an electron bundle of hydra-server for a desktop app? (i would be into helping!)

i think the main benefit of atom is that you can use the file system to save / swap out sketch files.

@zachkrall I think it isn't exposed in the window, but I was able to use electron parameters for the desktop capture: https://github.com/ojack/atom-hydra/blob/7dc415b432b55057fd21a5f62e45ace69d5a82b2/lib/main.js#L3

re: electron, this is something I started at one point: https://github.com/ojack/hydra-standalone
In my own practice, almost every time I used it I ended up wanting basically everything that a text editor would have, or just use the browser version. Also I just didn't want to take on too many things that would need updating! Would be open to discussing more though :)

closing here ---> please continue conversation in atom-hydra repo