WebRTC Chrome microphone not working - javascript

Description
Specs: Chrome version 44,45,46 both Win, Mac and Linux.
Actions made:
first source: camera and microphone granted via getUserMedia
second source: microphone only granted via getUserMedia
both sources are stored in JS object
volume level checked with WebAudio (getting peak level over 5 seconds) 3) WebRTC call
established within a first source
Symptoms:
volume level is detected as 0
in the WebRTC call one user doesn't hear the Chrome user
Expected behavior:
volume level is detected higher than 0
in the WebRTC call both users hear each other
Severity: often, but not always. Doesn't seem to be tied to particular user, it happens from day to day with any user.
(!) Can sometimes be temporary fixed by restarting Chrome completely.
(!) Can sometimes be temporary fixed on Mac (until restart):
Go to Mac Applications > Utilities > Terminal
Copy and paste this command, then press Enter: sudo killall VDCAssistant
Type in your computer password and press Enter
Restart Chrome
(!) Happened even with the only one source requested.
Help
This seems to be a massive issue addressed to Google a long time ago, but still not solved. Have anyone faced it? Is there any way to fix this in JavaScript or anyhow else?
Edit 1
It is also reproducible at https://apprtc.appspot.com/ and any other webrtc websites.
Edit 2
Seems like it is WebRTC bug:
https://code.google.com/p/webrtc/issues/detail?id=4799
https://code.google.com/p/webrtc/issues/detail?id=5175

Here is a script I have in my .profile that will resolve this issue:
alias fixcam="sudo kill -9 `pgrep VDCAssistant`; sudo killall coreaudiod"
Then I just run fixcam from terminal. If you add the above command to your .profile you'll need to open a new terminal window or run source ~/.profile to reload the configuration.
It looks like the bug has been isolated to coreaudiod getting in a bad state. I haven't tested ONLY restarting coreaudiod but it's possible that will work also.

Related

How to test IndexedDB 'QuotaExceededError' without filling disk?

I want to make sure my code handles the QuotaExceededError with IndexedDB properly, I'd prefer not torturing my SSD to do so.
Is there any way to set a storage limit (like to say 5 MB) in the developer tools or browser settings?
In Chrome, you can launch the browser with --user-data-dir pointing at a smaller volume, e.g. via tmpfs.
Chrome doesn't have devtools support for such testing, but it's on the wish list.
As of today you can open DevTools, go to the Application Panel and check the Simulate custom storage quota label and then provide the maximum amount of MB that can be stored by IndexedDB.
Chrome DevTools Application Panel Screeshot
I've used a VM with a small hard drive. That's not ideal obviously, so I hope someone suggests a better answer!
Building on #joshua-bell's answer but adding detail on exactly how to do this in Mac OSX:
Copy the mount-ram.sh file at https://gist.github.com/koshigoe/822455 (you will probably want the unmount-ram.sh file for later as well)
Save that file anywhere you want
From the directory where you saved mount-ram.sh, run sh mount-ram.sh mytmpfs 512
cd /Applications/Google Chrome.app/Contents/MacOS (at least that's where it was on my machine)
./Google\ Chrome --user-data-dir=/PATH/TO/mytmpfs/, replacing /PATH/TO/mytmpfs/ with the path the directory you created in step 3.
Now you've got Chrome running, pointed at a file system with only 512MB of storage.
If you're ok with a 100MB storage limit, just open Chrome in incognito mode.
To see how much storage you have left, try this:
navigator.storage.estimate().then(console.log)

want to disable / enable usb3 host controller

Looked here first on how to do that and found a lot of references but not up-to-date (windows 10)
Tried "net start usbstor" but that is not supported it seems.
It appears I need devcon.exe which is part of a huge windows 10 sdk download includeing visual studio
This is my problem, maybe there is another solution:
I have a number of USB 3 external drives they are not used all the time so they go to sleep (the drives, not the computer). This is fine but occasionally one or more of them never wake up when I tried to access them. They are on a server and I access them through the file manager on my desktop. When they do not wake up I have to use remote desktop to run "device manager" and disable "Renesas USB 3.0 eXtensible..." and then enable that host controller. Immediately, all the sleeping drives wake up. I would like to run a program from the command prompt preferably from my desktop and not have to log in using splashtop or VNC. From googleing it seem devcon needs to be on that server.
Maybe there is a service I can start or stop remotely? I did not see usbstor listed as a service.
Thanks for looking!
[EDIT] Wanted to to follow up on this post. I read harvey263 suggestion but I decided I wanted the disks to sleep as they are used rarely and I have no interested in buying a 2TB replacement disk anytime soon. However, I did want to post about that devcon program. I was unable to located the device kit for win10. It was not in
Directory of C:\Program Files (x86)\Microsoft SDKs
after downloading a huge amount of stuff I did not need, but I discovered that splashtop remote (or server which I already had in all my systems) includes devcon support in its free download and the program is tiny and easy to install. I did have to move their devcon support from
C:\Program Files (x86)\Splashtop\Splashtop Remote\Server\Driver\Monitor\utils
into my personal download directory as I wanted to execute it upon login and I could not do that from the task scheduler on account of permissions or authorizations. For example, I put
devcon64.exe remove "PCI\VEN_10DE&DEV_026D*"
devcon64.exe rescan
into a task executed once on startup and it disabled the USB controller connected to the drives and then re-scanned, reinstalling the driver and wakening the drives. It also removed the yellow bang that was always on the driver every time I rebooted.
You might be able to alleviate the sleep issue by changing the USB setting in Advanced Power Options (control powercfg.cpl,,1). I think "selective suspend" is normally Enabled by default.
For devcon.exe you only need to download the Windows Driver Kit. It's not that big and you can copy devcon.exe out to run standalone and uninstall the rest if you want. I have scripted devcon to "re-enable" a device like this:
devcon disable *ROOT\NDISVIRTUALBUS*
timeout /t 5 /nobreak
devcon enable *ROOT\NDISVIRTUALBUS*
You could put this in say "\\RemotePC\c$\Scripts\EnableUSB.bat". Then call it with psexec like lit mentioned:
psexec \\RemotePC cmd /c ("C:\Scripts\EnableUSB.bat")

React Native Expo building very slowly

I've recently noticed my build time has increased considerably, sometimes taking a full minute to load. On the console I still see "Building JavaScript bundle: finished" fairly quickly but the screen takes much longer to refresh. Is there a reason something like this would be happening?
Try using Expo in a Simulator on your development machine and determine if it is taking as long as on your device:
If it is faster than on your test device, then you should check the
network connection on your test device
If it is as slow as on the test device, then you could try to remove node_modules and reinstall them with 'npm install' or 'yarn'. Expo will be redownloaded aswell as all other packages.
In my case, it was a different solution.
I followed the instructions given by jimmylee on the Expo SDK forums, which say:
If you are behind a VPN, try disabling the VPN.
If you are using windows 10, run CMD on your machine and type
ipconfig. Take a look at the first Ethernet Adapter. If it doesn’t say
Ethernet Adapter Ethernet it means Expo is taking the IP address of
something else.
To fix this, go to network connections and disable the adapter that it
should not be pointing at.
Connect your computer to the network and your phone to the same
network. Restart Expo.
So, go to Settings > Network & Internet.
Click Change Adapter Options:
Then disable the unneeded Ethernet:
Then restart Expo.
If the connection is made but bundle building is very slow - Try disconnecting from the network both devices, the system and the mobile, and reconnect. Also, don't forget to clear the 'recently in development' projects and start the project again.
It will certainly increase the speed of building by far, especially for windows it works very well.
I was going through the same problem.
I used expo on multiple devices and clearly it depends on the device also, i.e, whether it is able to handle it or not.
Second, for the slow device, i came up with a solution.
I just turned off the fast Refresh.
Fast Refresh keeps a watch on the development side and keeps reloading whenever we make a change.
By deactivating it, we need to refresh the app on our own. But this helped me.
Due to multiple refreshes and continuous bundling, expo gets slow (as per me) thus disabling this feature may help (infact helped me a lot).
STEPS TO DO THAT;
In your expo go app, shake your device. An option panel will open.
There will be an option to disable fast refresh. Simply click that and you are done.

mic access into my browser

I am testing the annyang library for the voice command.
Unfortunately I am facing a problem that it works but the browser (chrome) only allows the listening for about 5 secs, then it asks for me to allow/deny the mic again.
(the allow is not saving in the chrome/manage exceptions setting).
What should I do?
Thanks in advance.
You can experience this behavior on the annyang official site, if you remove the SSL protocol (which is the default):
http://www.talater.com/annyang/
The reason for this is that Chrome only saves audio permission preferences for sites running on SSL. Annyang appears to close the audio context after a period of time if it isn't being used (presumably a performance thing).
Your two options are to:
Add SSL to your site using the library
File a bug report, because it should only attempt to make a connection to the audio context once

Visual Studio 2013 caching older version of .js file

I am working on a small web api project in Visual Studio 2013 Ultimate. Windows 2013. Internet Explorer 9. When I run (debug) from VS using the internal web server (I guess that is IIS Express, now), I am finding that the changes I am making (and saving) to a javascript page are being ignored. Placing a breakpoint in the javascript shows the older code without my changes.
CTRL+F5 does not force the application to use the currently updated page. Checking the page in, then checking it back out often works. Is there some setting or trick that will help me out here?
Clearing the cache history seemed a bit excessive and I don't want to do that all the time.
The following solution worked me in Internet Explorer:
First enable script debugging:
Tools menu -> select Internet Options
On advance tab uncheck "Disable script debugging (Internet Explorer)"
Then make sure you get the newest page:
From the Tools menu choose Internet Options.
On the General tab, under Browsing history, click Settings.
Under "Check for newer versions of stored pages" make sure "Every time I visit the webpage" is selected.
Click the OK button.
If somebody has this problem and ctrl+F5, clearing browser's cache, restarting debugging, changing browser, changing web.config and rebuilding project don't help, then there is one last thing that works (at least for me): restart Visual Studio.
Also changing debugging port on local IIS Express helps but this is far more painful if working in a team or using Azure Active Directory etc.
Only solution that worked for me was changing the javascript file name and updating the bundle configuration to point at the new file. I tried everything else from restarting my pc, deleting bin/obj/cache/etc, CTRL F5, restart IIS, and so on.
If I'm correct you should build (ctrl+shift+b) your project before debugging. This web server runs in the background on a port of choosing whenever you start in debug mode. You can close the task(s) (process bar next to your clock) if you need a new session or press F5 in VS.
You can avoid using the built in web server if you have IIS (Express) or something similar.
Go to RUN and type iis depending on your OS it's already installed. Otherwise try to install it in Control Panel > Programs or Features > Turn windows features on or off
add a website (site name, path, hostname)
add to your host file 127.0.0.1 hostname (c:\windows\system32\drivers\etc\hosts)
To debug your project in Visual Studio:
open your website on your hostname in your favourite browser
click on DEBUG
click on ATTACH TO PROCESS
find w3wp.exe
hit ctrl+f5 in your browser to start debugging server code
Depending on how your solution/project is setup, you can publish your project files directly to IIS if you choose to publish to File System. Right mouse click on your project and choose publish. Set it up from there.
If your Visual Studio is up-to-date you can publish single files with alt+$+p.
Hope it helps.
Locate the code section where the JavaScript file is loaded to the page and add a parameter string to the end for testing. For example:
Change src="../Resources/js/MyScriptFile.js"
To src="../Resources/js/MyScriptFile.js?v=23"
Every time you update your JavaScript file, you change the version number. This will force the browser to load your new version of JavaScript file. After you finished testing, You can remove the string "?v=23". The bonus, if you leave it there, the end user will not be required to refresh his/her browser cache after you deployed your code to production.
I keep getting this problem very often. Normally what I do is first get into the drive where the OS is installed (In my case C:), and delete all the application.dll and application.pdb (it is stored in Windows\Microsoft.net\Framework\vx.x.xxxxx\Temporary ASP.NET Files). Delete application.dll and application.pdb in the users\xxx. Get into the application directory and again delete application.dll and application.pdb. Clear the browser cache. Restart the system (cold restart). Build the application. Most of time found to be working.
Note: I use DOS prompt for deleting since I'm quite used to it. But the user should have admin privileges. It's not a perfect solution but it works.
What worked for me was
Shutdown Visual Studio 2013 update 2 (I have win 8.1 all 64 bit)
Delete clear out "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files"
Cleaned and Rebuilt solution
Restart IIS Express. If using IIS just re start app and pool.
Run in VS 2013 Debug (F5) it still loads the old file under Script Documents > Windows Internet Explorer > Page_Name.aspx
Then F12 Developer tools clear Browser Cache (IE), I have the same issue in Chrome
F5 in browser reload the page finally loads the changed JS script file with my debugger; entry and breakpoints set
So i had the same problem and i could avoid this by canceling the .ASP.NET-Server
.ASP.NET-Server from Visual Studio for debugging
from Visual Studio and restarting the debugging. Hope this helps someone.
I restarted Visual Studio and rebuilt the project, but the problem persisted for me -- the debugger continued to run an old copy of the .js file. The solution for me was to simply reboot the machine. (When all else fails...)
For reference, I'm currently using Visual Studio 2015.

Categories