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

Compile for macOS arm64? #26

Closed
yamyamyamyamyam opened this issue Apr 8, 2022 · 13 comments
Closed

Compile for macOS arm64? #26

yamyamyamyamyam opened this issue Apr 8, 2022 · 13 comments

Comments

@yamyamyamyamyam
Copy link

Hi, just was hoping you could offer a precompiled binary for arm64 macOS in the future. Will probably try to compile it myself but support would be great.

(provided macOS binary does not appear to work with arm64 OBS, and nor does linux aarch64)

@fzwoch
Copy link
Owner

fzwoch commented Apr 8, 2022

$ file macos/obs-teleport.so 
macos/obs-teleport.so: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit x86_64 dynamically linked shared library, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|NO_REEXPORTED_DYLIBS>] [arm64]

If it does not work you need to be more specific why. If it requires an Apple signed binary you would need to do that yourself as I don't have an Apple developer subscription.

@yamyamyamyamyam
Copy link
Author

Ah, my mistake. Let me look into it further and see why it isn't loading properly.

@yamyamyamyamyam
Copy link
Author

Hmm, I can't seem to get meaningful debug output from OBS; it doesn't appear to even be making an attempt to load the plugin, so frustratingly, I have no error output to work off of. I've inquired with OBS support and will update if I hear back. In the interim, would it be possible for you to provide a non-universal binary with just arm64 so I can test it? My 'hunch' is that for some reason OBS does not like universal binaries.

@fzwoch
Copy link
Owner

fzwoch commented Apr 8, 2022

You can use lipo tool to extract architectures from universal binaries. I would be surprised that would be an issue though. That is exactly the purpose of universal binaries.

It could be arm64 is not the correct arch for M1?

@yamyamyamyamyam
Copy link
Author

yamyamyamyamyam commented Apr 8, 2022

Yeah, extracting it with lipo had no effect.

It could be arm64 is not the correct arch for M1?

Hmm, I'm not sure. arm64/aarch64 are certainly the correct designations for M1 in most usages that I've seen. I suppose technically M1 uses arm64v8 which might be a separate compile target? I feel like that would be very odd if you needed to be that specific, though.

I wish I knew where to go from here; OBS not providing me any output about attempts to load the plugin is frustrating. I am in semi-uncharted territory having compiled OBS myself for arm64, I suppose, but from what I've read, plugins with these custom builds work fine on M1 as long as they've been compiled for arm64. Strange.

fwiw, here's the OBS log: https://obsproject.com/logs/yRG4Bw3t2_iT3rVH

@fzwoch
Copy link
Owner

fzwoch commented Apr 9, 2022

You will need this new structure it seems:

OBS.app/Contents/PlugIns/obs-teleport.plugin/Contents/MacOS/obs-teleport.so

This loaded fine for me and it was working, however it kept crashing all over the place for me.

@yamyamyamyamyam
Copy link
Author

yamyamyamyamyam commented Apr 9, 2022

Thanks. With that structure, the plugin loaded. I could also select the stream coming from my VM. However, the receiver does not appear to be picking up any video.

edit: If I also pick up the stream in the VM, I get the expected video feed, so presumably the feed is being transmitted correctly and the issue here is on the receiving end.

@fzwoch
Copy link
Owner

fzwoch commented Apr 9, 2022

It eventually started working for me after setting things up and restarting OBS. Feel free to debug whats happening, but I will probably wait until there are official betas out there.

@fzwoch
Copy link
Owner

fzwoch commented Apr 14, 2022

Closing this for now. More things will probably come up when OBS v28 will be released where we may have to change plugin layout and other shenanigans.

@fzwoch fzwoch closed this as completed Apr 14, 2022
@arcreigh
Copy link

Hey @fzwoch OBS has officially added support to the master branch for M1 mac's see obsproject/obs-studio#5155.

Right now us M1 folks are left with no options OBS-NDI folks are currently focused on NDIv5 support. I would be more than happy to help test this out.

@fzwoch
Copy link
Owner

fzwoch commented May 20, 2022

Try to copy the plugin to ~/Library/Application\ Support/obs-studio/plugins/obs-teleport/bin/obs-teleport.so.

From the code I hope it still picks up plugins from that location. You will probably have to convince Gatekeeper to load the plugin as it is not signed with a registered developer key. If that does not help, you may have to re-sign the plugin yourself with an ad-hoc signature for your local machine.

@arcreigh
Copy link

Try to copy the plugin to ~/Library/Application\ Support/obs-studio/plugins/obs-teleport/bin/obs-teleport.so.

From the code I hope it still picks up plugins from that location. You will probably have to convince Gatekeeper to load the plugin as it is not signed with a registered developer key. If that does not help, you may have to re-sign the plugin yourself with an ad-hoc signature for your local machine.

That did the trick!

@yamyamyamyamyam
Copy link
Author

Just wanted to note here that I got Teleport to work eventually. The problem was actually with my VM's network settings; I assumed that if the stream was discoverable, there shouldn't be a transmission issue, but after reconfiguring my VM's connection I could successfully get a feed out. Just dropping this here in case anyone else ever has the same issue.

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

No branches or pull requests

3 participants