Closed johnboiles closed 3 years ago
Have you tested this :D? I was looking into this for the last couple days but got stuck at the OBS libs, which I assumed needed to be compiled for arm64, which meant OBS needed to be compiled for arm64, which meant QT5 needed to be (where I got stuck with trying to find which patches I needed).
To run the OBS plugin as arm64 yes, you'd need OBS and all of OBS's dependencies to support arm64. BUT that's probably not what you want, you probably just want the DAL plugin compiled as universal so that it can run inside other universal apps as arm64. So you'd still have OBS running as x86 under Rosetta, but it could communicate to a DAL plugin compiled as a universal binary.
But no I haven't tested this! I don't have an M1 Mac yet. Just trying to create a binary so folks like you and @MatteAce in #239 can test. I can build something locally, and it looks right to me:
file src/dal-plugin/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam
src/dal-plugin/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit bundle x86_64] [arm64:Mach-O 64-bit bundle arm64]
src/dal-plugin/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam (for architecture x86_64): Mach-O 64-bit bundle x86_64
src/dal-plugin/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam (for architecture arm64): Mach-O 64-bit bundle arm64
I am typing this on an M1 machine and will be first in line to let you know!
Hmm I'm struggling to get the GitHub build to work, but you could try compiling yourself using these instructions
https://github.com/johnboiles/obs-mac-virtualcam/wiki/Developing
Except use this to compile the dal-plugin:
cmake -DLIBOBS_INCLUDE_DIR:STRING=$OBS_DIR/libobs -DLIBOBS_LIB:STRING=$OBS_DIR/build/libobs/libobs.dylib -DOBS_FRONTEND_LIB:STRING=$OBS_DIR/build/UI/obs-frontend-api/libobs-frontend-api.dylib -DQTDIR:STRING=$QTDIR -D CMAKE_OSX_ARCHITECTURES="arm64;x86_64" ..
make -j dal-plugin
On it!
Brew is pretty broken on M1 machines, I've got it running in experimental mode but lots of formulas fail (which is why I was trying to built QT from scratch). Do I need to install all those deps from the document?
Running the cmake
command seems to fail looking for QT which is why I ask.
I'll update here if I have any success!
Hmmm I see. All those dependencies aren't required for the dal-plugin
target, but maybe CMake will fail without them. I wonder if there's a way to tell CMake to ignore everything but a specific target, in which case you can probably leave all those flags about OBS and QT blank.
You could always hack up the CMakeLists.txt
files to remove the obs-plugin build all together
Hahaha, I literally tried that seconds before you commented. The build did succeed then. I'm testing it now.
I tried replacing the plugin in /Library/CoreMediaIO/Plug-Ins/obs-mac-virtualcam.plugin with the new one but Safari still doesn't pick it, even after a reboot. I did resign it with my own developer key as well to try and give it more system credence.
Do you mean /Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin
?
Any logs in Console.app about it? What if you run file /Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam
β build git:(bfc405a) β file /Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam
/Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit bundle x86_64] [arm64:Mach-O 64-bit bundle arm64]
/Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam (for architecture x86_64): Mach-O 64-bit bundle x86_64
/Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam (for architecture arm64): Mach-O 64-bit bundle arm64
β build git:(bfc405a) β lipo -archs /Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam
x86_64 arm64
β build git:(bfc405a) β
Checking console now
I wonder if there's something we need to add to the Info.plist to mark that it's universal
I just tried Firefox (x86_64) and the the virtual camera does show up there still which may be useful to know.
Ok! So the universal binary didn't break both architectures at least. That's good.
This doc mentions setting LSRequiresNativeExecution
or LSArchitecturePriority
to tell the system it definitely should use arm64. But doesn't seem like it should be necessary.
What universal browser are you testing in? Does Chrome have a universal build?
Ha! I found something at least, it works in Chrome (Universal, going to confirm its running arm64), it does not work in Safari.
Awesome!!! I bet Safari just disabled plugins all-together and Apple didn't feel like it was worth it to implement plugins correctly and just disabled them instead.
(I've seen reports they did that for QuickTime in Big Sur)
I bet you that's it.
Ok so why isn't the GH action working? :)
I ran Chrome manually using arch -arch arm64 /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
so I'm quite sure. Bummer about Safari but what you going to do eh?
Oh haha I guess that's been the case for a while. Safari is listed as No
on the Compatibility list: https://github.com/johnboiles/obs-mac-virtualcam/wiki/Compatibility
I think it might be because 10.15 doesn't have ARM (there has never been a system with ARM and anything less than Big Sur)
Sorry, even after all this time I still suck at RTFM.
I can build for arm64 on my 10.15.7 laptop with the latest Xcode. But also I tried using macos-11.0
as the runner
and it failed with the same error.
I missed this earlier, but the failing check seems to be skipped when I run the build locally. But it's not skipped running on the GH action runner
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
I've never been very good at Cmake (even though it's what osquery uses ironically). Does that check try to run the code the built? If so it makes sense why it would fail :p
ok i think i got it, i have to force update xcode in the github action for it to build!
Your dedication is inspiring, thank you so much for all your hard work
ok! @obelisk @MatteAce ok! I think this should do it now!
Can y'all go download the plugins here, and download the raw-plugins.zip artifact. And then copy raw-plugins/obs-mac-virtualcam.plugin
to /Library/CoreMediaIO/Plug-Ins/DAL/
and see if everything works as expected?
hey!! sorry for being late, but I wouldn't have been much of an help here, since I have a background in web developing and know nothing about compiling! :) I'm dowloading the plugins right now, I'll test and check back! thank you so much for your help!!
Gives what looks like a notarization error
Same for me, I've been able to bypass it in the Security & Privacy pane, but it still won't show up
Here is the issue I think:
First the the artifact downloaded, second is the old version. Tl;dr, not signed with a developer certificate
β DAL codesign -dvvv obs-mac-virtualcam.plugin
Executable=/Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam
Identifier=com.johnboiles.obs-mac-virtualcam.dal-plugin
Format=bundle with Mach-O universal (x86_64 arm64)
CodeDirectory v=20100 size=1949 flags=0x2(adhoc) hashes=55+3 location=embedded
Hash type=sha256 size=32
CandidateCDHash sha256=b09aaed152fd282a19ed3517c06f038b86ad886b
CandidateCDHashFull sha256=b09aaed152fd282a19ed3517c06f038b86ad886b5372217b53ccb7d0ecdc2759
Hash choices=sha256
CMSDigest=b09aaed152fd282a19ed3517c06f038b86ad886b5372217b53ccb7d0ecdc2759
CMSDigestType=2
CDHash=b09aaed152fd282a19ed3517c06f038b86ad886b
Signature=adhoc
Info.plist entries=13
TeamIdentifier=not set
Sealed Resources version=2 rules=13 files=0
Internal requirements count=0 size=12
β DAL codesign -dvvv obs-mac-virtualcam.plugin
Executable=/Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/MacOS/obs-mac-virtualcam
Identifier=com.johnboiles.obs-mac-virtualcam.dal-plugin
Format=bundle with Mach-O thin (x86_64)
CodeDirectory v=20200 size=1964 flags=0x0(none) hashes=55+3 location=embedded
Hash type=sha256 size=32
CandidateCDHash sha256=310a54efc1504b13b4cf0eb8487c30fafabe4e8f
CandidateCDHashFull sha256=310a54efc1504b13b4cf0eb8487c30fafabe4e8f15fe1d03a11c620769059094
Hash choices=sha256
CMSDigest=310a54efc1504b13b4cf0eb8487c30fafabe4e8f15fe1d03a11c620769059094
CMSDigestType=2
CDHash=310a54efc1504b13b4cf0eb8487c30fafabe4e8f
Signature size=8971
Authority=Developer ID Application: John Boiles (62G85M9ZN5)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Timestamp=Oct 21, 2020 at 2:44:39 PM
Info.plist entries=13
TeamIdentifier=62G85M9ZN5
Sealed Resources version=2 rules=13 files=0
Internal requirements count=1 size=204
β DAL
Ok! I'll go ahead and make a release-y build so all the notarization stuff happens.
@MatteAce still won't show up where? What app are you using to try it?
Ok! I'll go ahead and make a release-y build so all the notarization stuff happens.
@MatteAce still won't show up where? What app are you using to try it?
Chrome Universal Binary, on streamyard.com
Ok try the notarized .pkg version here.
Ok try the notarized .pkg version here.
still not showing up... should I reboot?
Yeah try that
On Thu, Nov 26, 2020 at 3:34 PM MatteAce notifications@github.com wrote:
Ok try the notarized .pkg version here https://github.com/johnboiles/obs-mac-virtualcam/actions/runs/386104525.
still not showing up... should I reboot?
β You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/johnboiles/obs-mac-virtualcam/pull/240#issuecomment-734507520, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABVN7BYY7DGMY5ATXOYR5LSR3QZHANCNFSM4UEEXNXQ .
Yeah try that β¦
nope. but I think something happened with chrome x86... when I launched it, it told me about obs virtualcam being from an unknown dev. inside the browser, the virtualcam plugin is showing black, not the usual blue test screen that appears before you start the virtual cam from OBS. I'll try and uninstall everything and then reinstall the pkg
Works for me with the small caveat I had to manually remove the old version first.
@MatteAce are you running on an M1? If so you want to be running it arm64 mode, not x86_64 which will run through rosetta2.
@MatteAce are you running on an M1? If so you want to be running it arm64 mode, not x86_64 which will run through rosetta2.
yeah I know, but since the universal app wasn't working, I tried the x86 app as well
Works for me with the small caveat I had to manually remove the old version first.
YES!! it works now! I just removed the old files from the DAL folder!
Ok! That's probably because I haven't bumped the version in master
yet. It seems like the pkg installer won't overwrite what exists unless it is an older version. Ok! I'll cut a real release!
Ok! That's probably because I haven't bumped the version in
master
yet. It seems like the pkg installer won't overwrite what exists unless it is an older version. Ok! I'll cut a real release!
just FYI, the old x86 plugin won't work together with the new Universal plugin. I've put the old plugin back in the DAL folder, renamed as obs-mac-virtualcam-x86.plugin and it just shows a black screen UPDATE: the Universal plugin won't work either if the old x86 version exists in the folder
Because the binary is universal, it should work in both, testing now.
Edit: Confirmed, starting chrome in x86_64, it still works.
Because the binary is universal, it should work in both, testing now.
Edit: Confirmed, starting chrome in x86_64, it still works.
you're right! my bad, it works for both
confirmed working on Firefox-x86 too
Yep confirmed on my Intel Mac too. Still works just fine for me.
This change separates out the dal-plugin build from x86-only obs-plugin build so that the dal-plugin can work on M1 Macs in universal applications.