Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

[BUG]Virtual camera can't work with EOS Webcam Utility (Mac OSX Mojave) #232

Closed
amirher opened this issue Oct 31, 2020 · 22 comments · Fixed by #242
Closed

[BUG]Virtual camera can't work with EOS Webcam Utility (Mac OSX Mojave) #232

amirher opened this issue Oct 31, 2020 · 22 comments · Fixed by #242

Comments

@amirher
Copy link

amirher commented Oct 31, 2020

Every time I installed this plugin, my OBS can't feed video capture from EOS Webcam utility. In order to get back video feed from EOS Webcam, I need to uninstall this plugin.

@johnboiles
Copy link
Owner

Hmm can you paste the Info.plists from both plugins? In terminal you can run

cat /Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/Info.plist | pbcopy

Then paste the results here. And then run

cat /Library/CoreMediaIO/Plug-Ins/DAL/EOSWebcam.plugin/Contents/Info.plist | pbcopy

Then paste here.

@amirher
Copy link
Author

amirher commented Nov 2, 2020

Ok. I had to reinstall your virtual-camera plugin and as expected my EOS Webcam utility stops working. Anyway as requested attached is the output file of the commands.

obs-virtualcamera.txt

Hopes this could help you to resolve the issue.

Thanks

@johnboiles
Copy link
Owner

Huh this is a strange one. I don't see anything fishy in the plist files.

Does EOS Webcam Utility work in any other apps (e.g. QuickTime, Zoom, etc) while this plugin is installed? Or does it just not work in OBS?

@amirher
Copy link
Author

amirher commented Nov 2, 2020

Yup. My Zoom works fine and can directly feed from EOS Webcam while OBS doesn't.

@timbl
Copy link

timbl commented Nov 23, 2020

I am also trying to use bother EOS adapter and OBS virtual webcab. Wonder whether they re trying to use the same point to insert themselves in the chain. In the system logs, searching for obs-mac-virtualcam I see a lot of:

Nov 23 17:12:15 cascade10-2 caphost[1522]: objc[1522]: Class Device is implemented in both /Library/CoreMediaIO/Plug-Ins/DAL/EOSWebcamUtility.plugin/Contents/MacOS/EOSWebcamUtility (0x106b69660) and /Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam (0x10701e690). One of the two will be used. Which one is undefined.

Looks like both use the same hack and it clashes ...

@timbl
Copy link

timbl commented Nov 23, 2020

In fact there seem to be problems with 4 classes: Stream, Device, Plugin and ObjectStore.

MacOS/obs-mac-virtualcam (0xb8356b8). One of the two will be used. Which one is undefined.
Nov 23 17:12:15 cascade10-2 caphost[1522]: objc[1522]: Class ObjectStore is implemented in both /Library/CoreMediaIO/Plug-Ins/DAL/EOSWebcamUtility.plugin/Contents/MacOS/EOSWebcamUtility (0x106b69688) and /Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam (0x10701e5c8). One of the two will be used. Which one is undefined.
Nov 23 17:12:15 cascade10-2 caphost[1522]: objc[1522]: Class PlugIn is implemented in both /Library/CoreMediaIO/Plug-Ins/DAL/EOSWebcamUtility.plugin/Contents/MacOS/EOSWebcamUtility (0x106b69610) and /Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam (0x10701e618). One of the two will be used. Which one is undefined.
Nov 23 17:12:15 cascade10-2 caphost[1522]: objc[1522]: Class Device is implemented in both /Library/CoreMediaIO/Plug-Ins/DAL/EOSWebcamUtility.plugin/Contents/MacOS/EOSWebcamUtility (0x106b69660) and /Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam (0x10701e690). One of the two will be used. Which one is undefined.
Nov 23 17:12:15 cascade10-2 caphost[1522]: objc[1522]: Class Stream is implemented in both /Library/CoreMediaIO/Plug-Ins/DAL/EOSWebcamUtility.plugin/Contents/MacOS/EOSWebcamUtility (0x106b696d8) and /Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam (0x10701e6b8). One of the two will be used. Which one is undefined.

@timbl
Copy link

timbl commented Nov 23, 2020

The symptom for me is that after installing this webcam plugin, it doesn't appear in the Tools menu.

@PatTheMav
Copy link

PatTheMav commented Nov 23, 2020

I'd guess both (EOSWebCamUtility and obs-mac-virtualcam) used https://github.com/johnboiles/coremediaio-dal-minimal-example as the basis for their code (I know virtualcam did), so they share that part of the code. With ObjC being late-binding, there are now two classes with the same name available and the class lookup will pick one at random.

@gxalpha
Copy link
Collaborator

gxalpha commented Nov 23, 2020

@PatTheMav so the information in #215 is correct?

@PatTheMav
Copy link

I'd say so. ObjectiveC doesn't bind to code sections at compile time, but instead looks up symbols by name at runtime, as everything is translated to variants of objc_msgSend in C which takes a string-based selector for the target of your message.

So any plugin based on the minimal example without changing their class names will exist in the namespace of an app that loads DAL plugins and as such the selector will be ambiguous.

@gxalpha
Copy link
Collaborator

gxalpha commented Nov 23, 2020

That also means that that problem also exists in the version that currently is in OBS on the main branch, right?
I think I'll need to send a PR there :D

@PatTheMav
Copy link

PatTheMav commented Nov 23, 2020

Yes and I prepared a PR already, testing the build as we speak.

EDIT: Be aware that Quicktime in Big Sur has activated library hardening, so you can't test virtualcam with Quicktime anymore.

@gxalpha
Copy link
Collaborator

gxalpha commented Nov 23, 2020

oh i see, cool

EDIT: For me it still works... 🤔 But I have SIP disabled, so that might be a problem

@PatTheMav
Copy link

Cameo works great as a test suite, especially as it loads all DAL plugins and gives you debug output.

@dodgepong
Copy link

If you'd like to test a fix, there's a build artifact of OBS with this plugin pre-installed, with the namespace fix applied here: obsproject/obs-studio#3758 (Go to Checks > CI Multiplatform Build > macOS 64-bit > Artifacts in the upper right corner > choose the macOS .dmg file)

@johnboiles
Copy link
Owner

@timbl @PatTheMav yep that looks like the problem. Interesting find that Canon is using my code! I wonder how many others are too.

@PatTheMav thanks for the fix! I can't wait for that official OBS build with the mac virtualcam built in! @dodgepong @jp9000 do you expect to release OBS w/ macOS virtual cam soon, or should I apply the same fix to this repo as a fix for folks in the meantime?

@dodgepong
Copy link

We expect a release soon, probably a beta/RC within the next week or two.

@johnboiles
Copy link
Owner

@timbl @amirher can you wait that long? ;)

This plugin will be deprecated/archived as soon as the official OBS release goes out with this code in it.

@johnboiles
Copy link
Owner

I also added a note to my sample code to encourage people to change the class names before shipping https://github.com/johnboiles/coremediaio-dal-minimal-example/blob/master/README.md#before-shipping-code

@PatTheMav
Copy link

@timbl @amirher can you wait that long? ;)

This plugin will be deprecated/archived as soon as the official OBS release goes out with this code in it.

Does the plugin work on macOS 10.12 or 10.11 and older OBS versions? Because then it would be the only way for people to use virtual webcam output on older Macs that OBS 26+ does not support anymore. Still your choice to just "freeze" the plugin as-is.

@johnboiles
Copy link
Owner

I've never really focused on supporting anything below OBS 25.0.8 and macOS below 10.15. So i'm not totally sure. I seem to remember seeing reports of it working on 10.14, but I'd be surprised if it worked on 10.12 without modifications. It definitely wasn't ever a focus of mine.

@johnboiles
Copy link
Owner

Ok I went ahead and fixed the namespaces. @amirher @timbl go try the latest v1.3.1 release!

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

Successfully merging a pull request may close this issue.

6 participants