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

Idea: move xpc_connection_create_mach_service to NSXPCConnection so that it works with QuickTime #59

Open
demiantres opened this issue Feb 21, 2022 · 12 comments

Comments

@demiantres
Copy link

QuickTime does not work with the webcam because it does not allow accessing xpc_connection_create_mach_service.
Moving to NSXPCConnection (sorry, I don't know the C++ equivalent) fixes the problem:

https://github.com/obsproject/obs-studio/blob/dde4d57d726ed6d9e244ffbac093d8ef54e29f44/plugins/mac-virtualcam/src/obs-plugin/OBSDALMachServer.mm
https://stackoverflow.com/questions/54188295/nsmachbootstrapserver-is-deprecated-how-can-nsxpcconnection-be-used-to-register

@hipersayanX
Copy link
Member

I was looking all information about NSXPCConnection, and did not found any evidence that using the CoreFoudation libraries instead of libxpc makes any difference, libxpc hasn't been deprecated, and libxpc is still the base library for CoreFoudation libraries.
If the virtual camera doesn't works with QuickTime, is most probably because the virtual camera isn't signed, which I won't do.

@demiantres
Copy link
Author

I had closed this issue because I am not entirely sure why it does not work in QuickTime. I signed the plugin but this did not help.
Interestingly other cameras (for instance https://github.com/johnboiles/coremediaio-dal-minimal-example) show up in QuickTime (even if not signed).

The problem is that debugging is very hard because the plugin cannot write to a log file in (/tmp) nor send debug XPC messages to the server.

@hipersayanX
Copy link
Member

The problem is that debugging is very hard because the plugin cannot write to a log file in (/tmp) nor send debug XPC messages to the server.

You can debug both, the plugin and the service, setting the loglevel:

AkVcamManager set-loglevel 7

and the StandardOutPath and the StandardErrorPath variables in org.webcamoid.cmio.AkVCam.Assistant.plist.
It's all documented in the wiki.

@demiantres
Copy link
Author

demiantres commented Feb 22, 2022

I know, but this does not work when the plugin is loaded by QuickTime.

@demiantres
Copy link
Author

I tried to write to a logging file using the working camera from the link above, and even there logging does not work (though the camera itself shows up in QuickTime).

@demiantres
Copy link
Author

I suspect that the QuickTime sandbox prevents all file access (and possibly some XPC stuff).

@hipersayanX
Copy link
Member

Running QuickTime from terminal throw some messages?

@hipersayanX
Copy link
Member

I re-opened the issue because you said it was working with the other virtual camera. I'm right now quite busy working with Webcamoid, I won't come back to this issue until much later, but it would be useful if you can continue debugging it and give me some updates.

@hipersayanX hipersayanX reopened this Feb 22, 2022
@demiantres
Copy link
Author

Ok, I will keep you posted. But at the moment I have run out of ideas.

@demiantres
Copy link
Author

I found the problem: QuickTime does not allow accessing the preferences file which is used by the plugin (Preferences.h). XPC seems to work fine but no devices are shown due to lack of access to the preferences file.

@hipersayanX
Copy link
Member

Ok, then the idea would be reading the preferences from the service, similar to what I did with the DirectShow plugin.

@demiantres
Copy link
Author

I did some testing. When using XPC for getting the device info instead of the preferences file then QuickTime works (even without signing).

@hipersayanX hipersayanX transferred this issue from webcamoid/akvirtualcamera Oct 29, 2023
@hipersayanX hipersayanX transferred this issue from another repository Dec 15, 2023
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

2 participants