Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microphone not being captured #3254

Closed
DanielWright opened this issue Mar 13, 2020 · 41 comments
Closed

Microphone not being captured #3254

DanielWright opened this issue Mar 13, 2020 · 41 comments

Comments

@DanielWright
Copy link

DanielWright commented Mar 13, 2020

Issue Type: Bug

The extension works well, except that VSCode and/or Live Share Audio have not requested access to my microphone, so I cannot be heard on collaboration session calls. I cannot figure out how to get Code or the extension to prompt macOS Catalina to grant microphone access, either. Any guidance would be greatly appreciated!

Extension version: 0.1.80
VS Code version: Code 1.43.0 (78a4c91400152c0f27ba4d363eb56d2835f9903a, 2020-03-09T19:34:44.548Z)
OS version: Darwin x64 19.3.0

System Info
Item Value
CPUs Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz (8 x 2400)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) 2, 3, 3
Memory (System) 16.00GB (0.20GB free)
Process Argv
Screen Reader no
VM 0%
@mlacouture
Copy link
Member

Hi Daniel! thank you for using Live Share.
+@setaskin and @jramsay who might know the answer ...

@vrutberg
Copy link

Hi, I am experiencing the same exact same issue.

Extension version: 0.1.80
VS Code version: Code Version: 1.43.0 (78a4c91400152c0f27ba4d363eb56d2835f9903a, 2020-03-09T19:34:44.548Z)
OS: Darwin x64 19.3.0

@quinnmil
Copy link

Noticed for myself this happened after muting and unmuting the call. My microphone was being captured fine, I muted the call for maybe 10 seconds, then unmuted and nothing. Was unable to get my microphone to register even after ending and restarting the audio call.

Did not try fully restarting the session. Will update if I'm able to duplicate.

Extension: 0.1.80
VS Code: 1.43.0
OS: Darwin x64 19.3.0

@skennicutt
Copy link

skennicutt commented Mar 18, 2020

I'm witnessing something similar. My colleague is able to hear me, but I'm not able to hear him. I'm on OSX Catalina, but my colleague is not.

UPDATE- Looks like a device restart did the trick for now.

@hexpunk
Copy link

hexpunk commented Mar 18, 2020

I'm also on Catalina and restarting hasn't fixed it. Sometimes I can hear my colleague but she can't hear me. Sometimes neither of us can hear each other.

@jramsay
Copy link
Member

jramsay commented Mar 18, 2020

Thanks for filing this issue! Sorry to hear you've been having problems with audio. After you start (or join) the audio call are you able to configure your microphone?

You can do this by clicking on the audio icon in the VS Code Status Bar and selecting Configure Microphone from the dropdown.

image

Do you see your microphone in the list? If this doesn't work, your logs may provide us with helpful information. You can access them via the Live Share: Export Logs command from the command palette (ctrl + shift + p) and attach them to this issue.

@mlacouture mlacouture assigned jramsay and unassigned mlacouture Mar 18, 2020
@hexpunk
Copy link

hexpunk commented Mar 18, 2020

I'm able to see both microphones (internal and external) in the list. However, changing them doesn't make any difference.

Also, FWIW, VSCode never prompts the OS for permission to access the microphone on my system. For example. VSCode should be showing up in this list:
Screen Shot 2020-03-18 at 4 09 03 PM

@jasmine-q
Copy link

For those affected by this, I found a fix if you installed VS Code using homebrew.

If you open VS Code through your terminal e.g. code [path] you will be prompted to give your terminal access to your microphone. After doing this voice calls worked seamlessly for me.

@DanielWright
Copy link
Author

DanielWright commented Mar 18, 2020

@jasmine-q Worked great!

ETA: It only works if I launch VS Code from the Terminal. If I use e.g. Spotlight, the mic ceases to work.

@tamarmot
Copy link

tamarmot commented Mar 20, 2020

same issue. I use vs code from spotlight.

My coworker was asked to allow microphone access when he joined my share, and his worked. I was never asked. Electron is not in my system preferences for microphone sharing.

When my coworker invited me to collaborate and I joined his audio call I was asked for microphone access, and now Electron IS in my system preferences and the microphone works.

The bug is the extension should ask for microphone access upon installation

@KerberosMorphy
Copy link

Same Issues here, I teach for an introduction class to programmation and we want to offer Live Help with Live Share, but honestly, people who need Live Help must have no complication to run Live Share because they can't fix it themself, they're not able to play with setting and the "Mac not prompting Microphone Permission" is really annoying. Hope the fix will come soon.

@jramsay
Copy link
Member

jramsay commented Mar 24, 2020

Thanks for the feedback (and temporary workaround @jasmine-q!). Agreed, this is not a good experience for Catalina users. We're testing this out now and will see if we can resolve the issue.

@emilecantin
Copy link

@jramsay Just be aware that this doesn't only happen on Catalina, I'm on Mojave and I have the issue as well.

@crowicked
Copy link

MacOS Catalina/Mojave has the apps default mic access denied, until an app specifically requests access to the HW resource. Sadly, you cannot manually add the app to the allowed list (weird).
Assuming LiveShare team is more agile than Apple - please fix this.

@qkdreyer
Copy link

qkdreyer commented Apr 1, 2020

Sadly, the @jasmine-q working isn't working for me using macOS Catalina and latest VSCode + Live Share Extension Pack

@pbassham
Copy link

Since I didnt install via Brew, @jasmine-q's trick didnt work. The path for me was '/Applications/Visual Studio Code.app/Contents/MacOS/Electron'

I just opened it via that link, and similarly it prompted to allow Terminal to use the mic.

@NickWhiu
Copy link

NickWhiu commented May 5, 2020

After much frustration trailing this for an education provider no mic prob, and having to auth about 10 times, I finally got it going with help from pbassham, although my path was /usr/local/bin/code. This works for me, but I cant get students using this with a hack like this for now - will be nothing but mayhem as they open VSCode from browser link or from launcher instead of the terminal.

@tatosjb
Copy link

tatosjb commented May 8, 2020

Guys, opening VSCode form your terminal, it asks for a permission to the terminal to access your microphone, it could be a good work around for MAC users

@KerberosMorphy
Copy link

@tatosjb I agree, but for my case, I need a students proof solution, students who, for the most part, have never used a terminal before. With 200 to 400 students per session, I cannot guide them to a work around and it's the students who have the most difficulty who need a LiveShare session. Why is it always complicated with Mac :P

@mflisikowski
Copy link

for me did the job this sudo open /usr/local/bin/code

@martapiechocka
Copy link

For me the same -> sudo open /usr/local/bin/code

@tatosjb
Copy link

tatosjb commented May 11, 2020

@KerberosMorphy I agree with the fact that it is a real issue and have to be fixed, i just have tried to help between that time. I just run the bash and type code, no need for the rest of the path and the vscode opens. But I also have teached before and I agree with you, to a classroom that does not have that much contact with this kind of thing, have to a workaround is hard

@KerberosMorphy
Copy link

@tatosjb I've tried the vscode online with liveshare, but it doesn't seem compatible with audio. The new github online IDE (vscode) also look great (hope to have preview access), if liveshare audio work it could be almost easier than fighting with MacOS.

But generaly Microsoft/VS Code/Liveshare all seem to embrace pair programming, so I'm confident that this issue will be resolve.

@Destaq
Copy link

Destaq commented May 28, 2020

When running sudo open /usr/local/bin/code I get: The file /usr/local/bin/code does not exist.

Any other workarounds?

@tatosjb
Copy link

tatosjb commented May 29, 2020

@Destaq You have tried to only execute code on your terminal?

@jmplun
Copy link

jmplun commented Jun 12, 2020

if you are looking for something fool proof for your students and a way to open vscode could I suggest the following ( as it worked for me)

open vscode
open command pallete (command shift p)
shell command install code in path ( is an option)
get them to run that
close vscode
then from bash type code
permissions then get asked when you execute requiring microphone ( or it did when i ran a python file needing it)

@Destaq
Copy link

Destaq commented Jun 17, 2020

Wow ^^ works great, thanks!

@mengesb
Copy link

mengesb commented Jun 18, 2020

I'm affected by this issue, but everything above I've tried and nothing is adding or requesting Microphone permissions for code. I've tried installing individual compoonents, the extension pack, re-installiing the extensions, code, both, nothing is getting the mic to work for me and I do not see Visual Studio Code in the Security & Privacy permissions

@fordguo
Copy link

fordguo commented Jul 3, 2020

with the Version: 1.46.1, my audio can not work(neither spotlight nor terminal) :(

@karisheen
Copy link

if you are looking for something fool proof for your students and a way to open vscode could I suggest the following ( as it worked for me)

open vscode
open command pallete (command shift p)
shell command install code in path ( is an option)
get them to run that
close vscode
then from bash type code
permissions then get asked when you execute requiring microphone ( or it did when i ran a python file needing it)

THANK YOU SO MUCH! Worked like a charm

@mengesb
Copy link

mengesb commented Jul 28, 2020

Any potential of getting this issue more attention? This has been ongoing now for 4+ months now and is a critical/great component to live-share!

@mengesb
Copy link

mengesb commented Jul 28, 2020

Maybe this information will be helpful.

From my device log, filtering for tccd

Prompting policy for hardened runtime; service: kTCCServiceMicrophone requires entitlement com.apple.security.device.audio-input but it is missing for RESP:{ID: com.microsoft.VSCode, PID[622], auid: 501, euid: 501, responsible path: '/Applications/Visual Studio Code.app/Contents/MacOS/Electron', binary path: '/Applications/Visual Studio Code.app/Contents/MacOS/Electron'}, ACC:{ID: com.github.Electron.helper, PID[3733], auid: 501, euid: 501, binary path: '/Users/[USERNAME]/Library/Application Support/Code/User/globalStorage/ms-vsliveshare.vsliveshare-audio/electron-4.2.7/dist/Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper'}, REQ:{ID: com.apple.tccd, PID[241], auid: 0, euid: 0, binary path: '/System/Library/PrivateFrameworks/TCC.framework/Versions/A/Resources/tccd'}

There are in fact a few errors actually which may be related as well:

{ID: com.microsoft.VSCode, PID[622], auid: 501, euid: 501, binary path: '/Applications/Visual Studio Code.app/Contents/MacOS/Electron'} attempted to call TCCAccessRequest without the com.apple.private.tcc.manager.check-by-audit-token entitlement

Prompting policy for hardened runtime; service: kTCCServiceAppleEvents requires entitlement com.apple.security.automation.apple-events but it is missing for RESP:{ID: com.microsoft.VSCode, PID[622], auid: 501, euid: 501, responsible path: '/Applications/Visual Studio Code.app/Contents/MacOS/Electron', binary path: '/Applications/Visual Studio Code.app/Contents/MacOS/Electron'}, ACC:{ID: com.github.Electron, PID[3731], auid: 501, euid: 501, binary path: '/Users/[USERNAME]/Library/Application Support/Code/User/globalStorage/ms-vsliveshare.vsliveshare-audio/electron-4.2.7/dist/Electron.app/Contents/MacOS/Electron'}, REQ:{ID: com.apple.appleeventsd, PID[437], auid: 55, euid: 55, binary path: '/System/Library/CoreServices/appleeventsd'}

Prompting policy for hardened runtime; service: kTCCServiceMicrophone requires entitlement com.apple.security.device.audio-input but it is missing for RESP:{ID: com.microsoft.VSCode, PID[622], auid: 501, euid: 501, responsible path: '/Applications/Visual Studio Code.app/Contents/MacOS/Electron', binary path: '/Applications/Visual Studio Code.app/Contents/MacOS/Electron'}, ACC:{ID: com.github.Electron.helper, PID[3733], auid: 501, euid: 501, binary path: '/Users/[USERNAME]/Library/Application Support/Code/User/globalStorage/ms-vsliveshare.vsliveshare-audio/electron-4.2.7/dist/Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper'}, REQ:{ID: com.apple.tccd, PID[241], auid: 0, euid: 0, binary path: '/System/Library/PrivateFrameworks/TCC.framework/Versions/A/Resources/tccd'}

pid 241 attempted to call TCCAccessRequest without the com.apple.private.tcc.override-prompt-policy entitlement

@mengesb
Copy link

mengesb commented Jul 28, 2020

Per codesign it seems it's missing some entitlements

$ codesign -d --entitlements - /Applications/Visual\ Studio\ Code.app
Executable=/Applications/Visual Studio Code.app/Contents/MacOS/Electron
��qq�<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.cs.allow-jit</key>
    <true/>
    <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
    <true/>
    <key>com.apple.security.cs.allow-dyld-environment-variables</key>
    <true/>
</dict>
</plist>

@mengesb
Copy link

mengesb commented Jul 28, 2020

Might be helpful to compress several of these audio issues down to a single issue.

Combined with the above; pretty sure that microsoft/vscode#95832 is related (as I've commented on other issues here).

Here's all the audio tagged issues

@mengesb
Copy link

mengesb commented Jul 28, 2020

Suggested update to build/azure-pipelines/darwin/app-entitlements.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.cs.allow-jit</key>
    <true/>
    <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
    <true/>
    <key>com.apple.security.cs.allow-dyld-environment-variables</key>
    <true/>
    <key>com.apple.security.device.audio-input</key>
    <true/>
</dict>
</plist>

@gwd0715
Copy link

gwd0715 commented Aug 28, 2020

Same issue here, why it isn't fixed?????
Tried some of the workaround solutions, none of those really worked!!!

Version: 1.48.2
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.6.0

@movermeyer
Copy link

movermeyer commented Sep 3, 2020

After reading this other thread, I've figured out another incantation if these other workarounds haven't helped.

Myself and another coworker were having this issue: I could hear others (who didn't have this issue), and my microphone turned on, but the data wasn't being sent to the other participants. This solved it for us.

Full disclosure, I don't understand all the details...


It seems that VS Code inherits its permissions from the Mac Terminal.app (or something), so we need to grant permissions to Terminal.app.

  1. Install the OpenCV Python library: pip install opencv-python
  • This is the easiest way to trigger the permissions check. You can uninstall it after (pip uninstall opencv-python)
  1. In the terminal within VS Code, run python to start the Python interpreter. Then run:
import cv2
cam = cv2.VideoCapture(0)
print(cam.isOpened())
cam.release()

This will crash with an Abort trap: 6. That indicates that you are missing the permissions needed.

  1. Close all instances of VS Code
  2. Open the Mac Terminal app
  3. Once again, run python and that same code in the interpreter.
  • This time, you should get a permissions request. Accept it.
  1. Start VS Code again

You should be good to go! Hopefully this helps you! 🤞

@gwd0715
Copy link

gwd0715 commented Sep 4, 2020

@movermeyer
Nope! Despite terminal.app got the needed permissions, it still failed to make microphone working in a live share session in vscode.

@mengesb
Copy link

mengesb commented Sep 4, 2020

There appears to be two issues described here, and in some other places.

  • Folks developing applications on VSCode that use MacOS permission restricted features - like the camera or microphone - where the permissions engine isn't being prompted or consulted correctly. This could be because the debug console, embedded terminal or some other "executor" of the code needs these permissions explicitly, and/or the IDE needs these permissions.
  • Folks who want to use Live Share Audio feature - which VS Code isn't allowed to use the microphone on MacOS due to the same advanced permissions engine.

Can we clearly separate these two issues and get an update on progress towards both? I know I worked with @jramsay in a number of GH issues, including #3768 and microsoft/vscode/#103509. Would love to see an update as to where we are with at least the Live Share Audio issues. I see the current version is 0.1.85 and from a Mac, it isn't capturing my microphone likely because it doesn't have permission to use it.

Can we also close off duplicates and consolidate the issues - should make it easier to manage the spray of GH issues in the future and help folks if you make it easier to search or list "Known Issues" ahead of time.

@jramsay
Copy link
Member

jramsay commented Sep 15, 2020

We just released an update to the audio extension (v0.1.91) to the VS Code Marketplace that should address this issue. I'm going to close this and related items as fixed. Can you give it a go and let us know if it works for you? Thanks for all your help with this issue!

@jramsay jramsay closed this as completed Sep 15, 2020
@abhinav700
Copy link

For those affected by this, I found a fix if you installed VS Code using homebrew.

If you open VS Code through your terminal e.g. code [path] you will be prompted to give your terminal access to your microphone. After doing this voice calls worked seamlessly for me.

I tried this but it is not working
my command: code F:\programming\development and other\python programming\projects\jarvis for desktop\jarvis.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests