Unity Crash on MacOS when the join method is invoked (Agora.io) - macos

I downloaded the agora.io video sdk asset from the asset store, imported it to a new project. On the demo "SceneHome" scene, I entered the api id. Clicked play, and as soon as I click the "join" button Unity crashes. As far as I can tell the crash happens on the
app.join(field.text);
line in the TestHome.cs script (line #86).
I tested it in 2019.3.2f1 and 2020.1.0b5. The result was the same.
The OS is Catalina 10.15.4.
The demo works on Windows.
I followed this tutorial: https://medium.com/#jake_agora.io/mac-run-video-chat-within-your-unity-application-e001091db62f but used x86_64 dlls instead of x86
Does anyone know what this is about? Or where should I begin to look?
Another tutorial, this one from Agora:
https://www.agora.io/en/blog/run-video-chat-within-your-unity-application-mac

It can be caused by missing the Camera and Microphone usage in the Unity Editor project setting. Please let us know if that's the case. (I saw you are also on the Slack channel, let's continue the conversation there.).
For the people who didn't know, Agora Developer Community - Unity Chat channel is here :)

As herve nau pointed out the problem was that the Unity did not had the permission to use camera or microphone. And the solution should work. Alternatively, here is another way to add the permission as described by launzone:
1) Disable SIP: Go into recovery mode (hold CMD+R when you
restart your Mac) Don't be afraid, we are not doing anything crazy.
2) After that open Terminal (it should be accessible from one of the
Menus at the Top) Type in "csrutil disable" and hit enter. Then reboot
your Mac normally.
3) Open Terminal and type in: "sqlite3 ~/Library/Application\
Support/com.apple.TCC/TCC.db" and hit enter
4) For microphone access, type in: "INSERT INTO access
VALUES('kTCCServiceMicrophone','com.unity3d.unityhub',0,1,1,NULL,NULL,NULL,'UNUSED',NULL,0,1541440109);"
and hit enter
For camera, type in: "INSERT INTO access
VALUES('kTCCServiceCamera','com.unity3d.unityhub',0,1,1,NULL,NULL,NULL,'UNUSED',NULL,0,1541440109);"
and hit enter
6) check in your SystemPreferences/Security&Privacy > unity hub should
now show up in both mic and cam
7) reboot in recovery mode again (CMD+R), open terminal again, type
in: "csrutil enable" and hit enter, to enable SIP again
8) reboot normally and enjoy!
Here is the full thread. I hope it helps someone :)

check if not related to the webcam registration issue on macOs with the Unity Hub running. Fix for the camera, not sure if related to your problem: Remove the Unity Hub app, then open the project directly from Unity App. May also be useful to relocate the Unity app in another folder to force the webcam usage security registration.
Made the test here, Unity 2019.3.11.f1, using the demo app, with Hub active -> crash on press of Join Button, did the Hub removal described above, rerun the same demo and no more crash at this level. Running on Catalina 10.15.2.

Related

Has any one got camera errors in a widows machine, after using camera to opencv projeccts?

I was working on an OpenCV project. There I used OpenCV to get video captures and then used some algorithms to face detection and face-swapping. After working on this project for about two weeks, I got errors in my camera (windows camera application). attached one error but sometimes I got different errors as well. I want to know, Did I get those errors due to this OpenCV project?.
If your application still runs, you cannot achieve from windows application at the same time. If not, basic reset always saves lives!
Click Windows key + I to open Settings app.
Select System>Apps & features and find Camera on the list.
Click Advanced options link.
Then press Reset button and wait for the process to be executed.
Secondly, check if the camera works properly from device manager.
Lastly, try to open from another app(like Skype, discord). Otherwise, update or roll-back driver of the camera.

qt webengine request camera and mic access on mac

I tried to access the camera and mic using QWebEngineView so I used this code to grand the access on my Mac
I used the solution which is Here it worked fine when I run the app inside QT and it asks me for the first time on my Mac that QT need to access my Mic and Camera which I allow it and it works, the problem is when I use the release version which has all the needed dependencies and stuff, the app crashes and when I check my system preferences for the permission I did not see the app is listed only QT in both Camer and Mic, and I can't add an app manually.
So what is the solution of this problem? to let the app ask for permission instead of crashes? what edit do I need to do to the codes to allow the app to ask for permission as QT does?
Update
What I tried as well is to run the app from executable inside the .app or the package which allow the terminal to request permission to the camera and mic and I worked but this not effective solution to ask the user to do so.
Another test I did is to go to the info.plist inside the .app package and add both
Privacy - Camra Usage Description
Privacy - Microphone Usage Description
after that I test again, the app not crash but the Camera open and then after 1 or two seconds the Camera close that is it, so I think I need to show the Permission dialog box, any help with it or how to show it up?
after trying many solutions what is worked that I added both permissions to the plist in qt bundle
Privacy - Camra Usage Description
Privacy - Microphone Usage Description
but with values 6.0 or any other value that not have space or long characters, and it worked! and it shows me the permission box and added the app to the privacy in system preferences, maybe long text not let the dialog box show, I am not sure exactly.

Webusb: Access Denied trying to open printer on Windows

I am trying to allow a POS web app to print directly to a StarMicronics (or any receipt printer, for that matter) using the Chrome webusb API.
I am using the example here almost exactly except I have modified the vendorId filter to the Vendor ID of StarMicronics. I have also tried it with a completely empty filter. It works great on the Mac computers I have tested it on, but the problem is on Windows.
When I click the print button, Chrome opens up the connection window, my device is listed and I can select it and click Connect. So navigator.usb.getDevices() is working great. When I refresh the window, after having connected the website to the device, Chrome finds the device again with no problem.
The problem comes when I try to do device.open(). I get this error in the console: DOMException: Access Denied. From this point, I can't do either device.selectConfiguration() or device.claimInterface() because I get the error that the device must first be opened, obviously.
I have enabled all the flags I know of in Chrome:
#enable-experimental-web-platform-features
#enable-webusb
#new-usb-backend
But none of this has helped. I have also tried using other printers, such as an HP deskjet and a Dymo Label Writer all with the same resulting error message that access is denied.
Again, it is working fine on Macs.
Any help on this would be greatly appreciated.
You get the "Access Denied" error on Windows because there is already a driver that has claimed the device. The Windows driver model requires that the "winusb.sys" driver be loaded for any device that will be accessed by a userspace application like Chrome.
See my answer to this earlier question about smartcard readers which encounter the same difficulty on Windows.
You'll need to first download the Star Micronics Windows Driver (available here for the SP700). You want the "USB Vendor Class Driver" (again, available here for the SP700)
Of course, there is no auto-installer (to my knowledge), so you'll have to open up the StarUSBVendorClassDriver_... zipped folder, and navigate to Manuals/usb-vendor-class-driver_im_en.pdf.
In reading this, you'll notice that you actually need to install the driver from the CMD line with the following cmd (note the <version_here>, don't COPY+PASTE):
pnputil -a StarUSBVendorClassDriver_<version_here>\USBVendorClassDriver\SMJUSBCOM.INF
Once you have the correct driver installed, download the Zadig utility from the download page here. The website is ad-ridden, but I had no problems.
Open Zadig, toggle the "Options" menu dropdown, and toggle "List All Devices".
You should then see your device in the drop down below. Select it as shown below.
Then, on the LHS dropdown, you will see a "non WinUSB" driver selected. On the RHS, ensure that WinUSB is selected, and click "Replace Driver".
This should enable WebUSB! Happy printing!

Show Firefox OS devtools on Firefox Developer Edition 'desktop'

I've an iMac with OS X Yosemite v.10.10.3. I use Firefox Developer Edition 40.0a2. I've a ZTE Open C (FR version) with Firefox OS; Boot2Gecko 2.1.0.0-prerelease (B2G OS).
What I'd like to do is the following: I've a basic webpage (mostyl HTML, CSS and JS) opened in my browser on my Firefox OS phone. I'd like to get the devtools (Cmd+Shift+i) and be able to edit that webpage with my Firefox Developer Edition browser on my iMac.
I've already tried these things:
Use webIDE.
Follow this potential solution.
Connecting a Firefox OS device.
WebIDE Troubleshooting.
Comment déboguer facilement du web y compris sur tablettes et téléphones—french article.
With webIDE, I can build a new app for Firefox OS (with or without a base theme) and I can use the devtools to inspect the DOM and stuff like that. I just want to achieve the exact same thing but directly on my desktop computer.
Do you have any clue?
Feel free to ask me if you need more piece of informations. ;)
Current status
When I launch the Firefox OS browser app, I can inspect (via the devtools) the homepage (DOM stuff, etc.). But when I load another webpage (Google for example), I can't inspect the DOM. Any idea about that?
I often get this message: http://puu.sh/ir2Ju/32563e51bc.png when I switch to several apps I want to debug.
If I understand correctly, you're trying to connect the Firefox Developer Edition WebIDE on your desktop to a tab that is open on your Firefox OS phone. Something like this?
If that's right, once you connect to your phone in the WebIDE, you should see a list of open browser tabs at the bottom of the "Open App" menu, which is in the top left of the WebIDE panel.
When you connect your phone, you have to accept remote debugging.
Then on the left of the window, you should see a dropdown menu with the apps that you can debug. By default, you can only debug unprivileged applications.
Click on the app, the you want to debug and in the middle of the screen click on the "wrench". It is the button to activate debugging.
Now the complicated part. In order to debug privileged apps such as the web Browser. You have to root your phone and change some preferences. To check that you have a rooted phone. Click on the runtime menu and then runtime info.
If your adb is in root mode, then you can press the button to request higher privileges. You can also do that by hand.
There for more info:
https://developer.mozilla.org/fr/docs/Tools/WebIDE/Running_and_debugging_apps#Unrestricted_app_debugging_%28including_certified_apps.2C_main_process.2C_etc.%29
https://developer.mozilla.org/en-US/Firefox_OS/Using_the_App_Manager#Using_the_B2G_desktop_client
Using a real device
On your computer, enter the following command in Terminal/console to enter your device's filesystem via the shell:
adb shell
Your prompt should change to root#android. Next, stop B2G running using the following command:
stop b2g
Navigate to the following directory:
cd /data/b2g/mozilla/*.default/
Here, update the prefs.js file with the following line:
echo 'user_pref("devtools.debugger.forbid-certified-apps", false);' >> prefs.js
After you've finished editing and saving the file, start B2G again using the following command:
start b2g
Exit the android filesystem using the exit command; this will return you to your normal terminal prompt.
Next, reconnect to the App Manager and you should see certified apps appear for debugging.
When this is done, you should see the application "Browser" in the list of available apps for debugging. At the same time, you should see all other application of your phone available as debugging.

WP7 app won't launch from app list

I have a simple Windows Phone 7 application which is working perfectly when started from Visual Studio. However, if I deactivate the app (press Windows button or back button from the application's MainPage) and then click the app's icon to relaunch, the screen will flash and return to the list/home screen. I assumed this was an issue with the emulator but when I got a developer device I have the same issue.
Note that reactivating without a complete tombstone works (pressing Windows button from the app and then back).
I have no idea what causes this or how to proceed with debugging. Hopefully someone else has experienced this and knows a fix.
Turns out there is a bug, i found the solution here http://forums.create.msdn.com/forums/p/67522/416995.aspx
In short, it turns out that the Microsoft.Xna.Framework.Media.MediaLibrary class (which I am using to display pictures on applications main page) is not properly initialized when the user has not opened a media hub prior to you calling it. So picture collection properties are null or empty. The solution is to add a call to MediaPlayer.Queue.ToString(), it will force the initialization of the native media library allowing you to invoke the MediaLibrary later on.
Sounds like an unhandled error on startup is causing the app to crash.
Trap/log/handle/display any unhandled exceptions. Also check what you're doing on startup.
IF you are saving something (to Isolated Storage) after first run and then opening it on subsequent launches then that's where I'd look first.
If it works when launched from Visual Studio then this will probably be due to the way you are rebuilding/redeploying the app before launching it in that case.

Resources