keijiro / Lasp

Low-latency Audio Signal Processing plugin for Unity
The Unlicense
1.57k stars 121 forks source link

Can't get Lasp deviceselector example working as build on Mac M1 #46

Closed isaacjoy closed 2 years ago

isaacjoy commented 3 years ago

Hi there,

I'm sort of new to Unity so apologies if this is a silly mistake but I can't get the deviceselector example to work on my Mac M1 as a build. It works in the Unity editor if I hit play (I'm using a guitar signal to control some animations and have checked it).

I would love to get the build to work so I can use Lasp with multiple screens in my performance.

Here is a video to show..

https://user-images.githubusercontent.com/22734574/135540039-90841d9f-c31a-423b-9b92-a4c3b79a230b.mp4

Thanks for making an awesome package though! Exactly what I need Isaac

SilverXenolupus commented 2 years ago

I'm not sure if this is the right place to put this, but I am having a similar problem. I think I know why LASP isn't working on M1 and ARM devices in general, but would appreciate some confirmation from Keijiro. LASP has a dependency, libsoundio, which according to its system requirements, only works on devices with Intel Architecture. The M1 runs on ARM architecture, therefore libsoundio won't work. And if I am correct, this is what is causing LASP to not work. Is this correct, or should LASP actually be working on the M1, and I am doing something wrong?

keijiro commented 2 years ago

Lasp 2.1.4 and later support Apple silicon.

https://github.com/keijiro/Lasp/releases/tag/2.1.4

SilverXenolupus commented 2 years ago

Based on my testing, this library needs to be built and installed in order to build for Apple Silicon. https://github.com/keijiro/libsoundio Otherwise, Lasp will not work.

It is not needed to run the finished app though. It is only needed for building.

keijiro commented 2 years ago

I found an issue with the plugin .meta file that excludes itself from the Apple silicon standalone player. I fixed this issue in the latest update (v2.1.6).

keijiro commented 2 years ago

I'm closing this issue now. Please reopen it if it still reproduces.

aleannox commented 1 year ago

Thanks @keijiro for the great plugin as always! :)

I am still having issues to get it working in a build on an M1 Max w/ Unity 2021.3.13, but editor works fine.

In the build, I can select the device but there is no signal, laspStream?.GetChannelLevel(0, _filterType) always returns -256. There are no errors in the Player.log only messages like Thread 0x16fd3b000 may have been prematurely finalized

keijiro commented 1 year ago

@aleannox Does it reproduce with the sample project in this repository?

aleannox commented 1 year ago

@keijiro Good point, I can build the sample project with 2021.3.13 and it works. With my other project I don't even get the macOS question to allow the built app to use the microphone. Do you have an idea which components of my project could be in conflict with Lasp or libsoundio? Thanks!

aleannox commented 1 year ago

@keijiro OK I found the solution. If I enter something in the player settings / Mac configuration / Microphone usage description then it works. :) Thanks!