Service Failed Error when I try to start share the audio

I have found if I manually copy ZoomAudioDevice.driver from my application bundle to “/Library/Audio/Plug-Ins/HAL” and then restart CoreAudio

sudo launchctl stop com.apple.audio.coreaudiod
sudo launchctl start com.apple.audio.coreaudiod

And then launch my app and share audio, I no longer receive the Error: 3 issue and audio share works.

Obviously this isn’t something a customer would be doing.

But I am still unsure of how to achieve this as MacOS requires root access to install to that directory. Also unsure if this is something the SDK should be attempting to do or if it is something our client is supposed to do.

Hi @KieranAC,

Looking into this further, the only change you should need to make is copying the ZoomAudioDevice.driver file into ${YOUR_PROJECT}/Contents/Plugins. The build phase should not be necessary. If you are still seeing issues after doing this, we’ll need the SDK logs to further investigate. If they were not found at the path I previously mentioned, they may be available at ~/Library/Logs/${YOUR_PROJECT}.

Thanks!

@jon.zoom

I was able to get logs of this after enabling sandboxing mode (Otherwise I couldn’t find the logs)

I confirmed that the built app that is running does have the ZoomAudioDevice.driver file at:
/Users/me/src/MyApp/Bin/Release/myapp.app/Contents/PlugIns/ZoomAudioDevice.driver

Logs are here:

Hi @KieranAC,

Thanks for providing that! We’ll investigate this and keep you updated as soon as we have any new information.

Thanks!

Hi @KieranAC,

We have identified that the SDK does have some unexpected behavior if the driver was manually removed from a device. A fix has been identified and will be available in the next release of the SDK.

Thanks!

Thanks for looking into this. Do you know when the next SDK may be available?

Hi @KieranAC,

You are very welcome! We are working on finalizing a hotfix release, so it should be available pretty soon. As always, for the most up-to-date release information you can check #new-releases or our release notes.

Thanks!

@jon.zoom I was able to confirm that the latest SDK does fix the issue.

I am still have problems with packaging the driver with the app build.

Earlier in this thread you mentioned

Looking into this further, the only change you should need to make is copying the ZoomAudioDevice.driver file into ${YOUR_PROJECT}/Contents/Plugins .

Could you elaborate on this? Do you mean in the project directory? How does xcodebuild know to copy the file to the build product? If I follow this process, the built .app file does not contain the driver. Is there some other step?

The only way I was able to test this feature was to add a build phase to copy the driver to Content/PlugIns/ in the build output like this:

This is how I was able to test previously, and how I was able to test the new SDK.

The big problem I am having now though, is an xcode crash (meaning xcode itself is crashing) while attempting to upload this build for notarization. This only occurs if the audio driver is included in this way.

This thread seems to be related:

Hi @KieranAC,

That’s great to hear that the issue is resolved in the latest version!

Could you elaborate on this? Do you mean in the project directory? How does xcodebuild know to copy the file to the build product? If I follow this process, the built .app file does not contain the driver. Is there some other step?

Including the driver in the project’s directory should be the only required step. This may be a long shot, but can you try removing the driver from your project, cleaning the build folder, and then re-adding it only by putting the file in the previously mentioned path?

The big problem I am having now though, is an xcode crash (meaning xcode itself is crashing) while attempting to upload this build for notarization. This only occurs if the audio driver is included in this way.

Which version of Xcode are you currently running? And to clarify, is this crash happening when using the approach we have recommended, or after adding it to your build phases?

Thanks!

@jon.lieblich

I have made some progress but I am still getting error 3

Add the driver to source directory:

kieran@kierans-mbp-2 MyApp % ls Contents/Plugins/
ZoomAudioDevice.driver

Add the driver to Xcode:

image

At this point it is automatically added to build phases ‘Copy Bundle Resources’ phase:

image

When I build the app, the binary file from:
ZoomAudioDevice.driver/Contents/MacOS/ZoomAudioDevice

…is copied to the built app bundle in
MyApp.app/Contents/Resources/ZoomAudioDevice

…automatically along with ‘ZoomAudioIcon.icns’.

This seems like progress, but when testing audio share, I still get ‘Error 3’ just like before.

If I add a new build phase to copy ZoomAudioDevice.driver to /Content/PlugIns folder

image

Then the AudioDevice.driver file shows up in the built application:

Then the ‘Error 3’ goes away and audio sharing works:

image

But this method causes an xcode crash problem when trying to export the app from organizer:


(Xcode 13.1 - I believe I also tested on Xcode 12 with the same results)

Summary:

So it seems like the first method does copy the driver to the built app, but it copies it to /Contents/Resources for some reason instead of /Contents/PlugIns, and 'Error 3
still occurs regardless.

Using the second method, you can force xcode to copy the file to /Content/PlugIns and the ‘Error 3’ goes away, but then there is some sort of issue with the Organizer/Notarization/Export process.

I also tried adding the ZoomAudioDevice.driver as a folder reference which results in the .driver directory being copied to /Contents/Resources:

This still doesn’t launch the audio service and results in ‘Error 3’

The only way I have ever seen audio share work is when the ZoomAudioDevice.driver is included in Content/PlugIns.

I noticed that the official Zoom app does place the audio driver in the PlugIns folder:

image

Hi @KieranAC,

Thanks for the additional information. We will need to investigate this and get back to you. In the meantime, definitely let me know if you come across any new information.

Thanks!

@jon.zoom

I tried this again with the latest SDK (v5.9.0.3495). I have also updated Xcode since the last test, to 13.2 (13C90)

I have been able to get this fully working, end to end, with these two updates. I don’t know if there was a fix in the latest Zoom SDK or if it was a problem in Xcode or both, but I am able to get audio sharing to work IF I include a copy plugins phase in my Xcode build.

If I try to do it the ‘other way,’ with your recommendation above - the driver file gets copied to the Resources folder in the end product build, and I still get an error 3 when attempting to share on a machine without the driver pre-installed.

If I do it ‘my way’ with the copy build phase, the driver gets placed in the PlugIns folder and everything now works file. Previously, this WAS working fine, functionally, but Xcode was crashing while attempting to notarize / upload an archived build. This doesn’t seem to be an issue any more, one way or another.

Hi @KieranAC,

That’s great to hear it’s fully working!

It’s strange that the copy plugins phase is required, as the sample app can successfully share audio with only the approach mentioned previously with Xcode 13.2. At this point, maybe we should take the “if it isn’t broken, don’t fix it” approach though. :slightly_smiling_face:

Thanks!

@jon.zoom

I think I am still seeing two issues with the previous fix

Setup steps for both issues:

// Remove ZoomAudioDevice Driver
sudo rm -r /Library/Audio/Plug-Ins/HAL/ZoomAudioDevice.driver

// Restart Core Audio
sudo /bin/launchctl kill SIGTERM system/com.apple.audio.coreaudiod || /usr/bin/killall coreaudiod
sudo launchctl stop com.apple.audio.coreaudiod
sudo launchctl start com.apple.audio.coreaudiod

// Start playing computer sound from some source (Youtube etc)

// Give app screen recording permissions in MacOS preferences

Issue #1

1) Complete setup steps above
2) Start app
3) Join meeting with app + some other device
4) Start *Desktop* screen share with audio enabled (see below code block for summary)

End result: Desktop share works. The audio driver installation window does not appear. No sound is shared. Restarting app / re-sharing doesn't work.

Code used to start desktop share with audio

[asController isAbleToShareComputerAudio]) // Returns YES
{
    zError = [asController enableShareComputerSound:YES] // No error, returns SUCCESS

    zError = [asController startMonitorShare:monitorID.unsignedIntValue];

Issue #2

1) Complete setup steps above
2) Start app
3) Join meeting with app + some other device
4) Start *Audio Share* with the app
5) The audio device driver installation popup *does* appear
6) Other client (zoom app on iPad for my test) says "Other user is sharing audio"

End result: No audio is shared, but the other client believes sharing has started.

If the app is stopped and restarted, then Issue #2 is resolved.

Issue #1 is resolved as long as the process from Issue #2 is completed at least once. Installation of the audio driver does not seem to work unless the user shares audio only at least once and then restarts the app.

Hi @KieranAC,

Are you still using v5.9.0, or are you up to the latest version of the SDK? I know there have been some audio-related changes, so it is worth updating if you aren’t already on 5.9.3.

Thanks!

The above was tested on 5.9.3.

The same issues may have been present in 5.9.1, but I didn’t test it as extensively. It’s easy to cover up both of those issues if you either have the audio driver installed previously, or if you attempt share using ‘Share Audio’ first. (Desktop share + audio would work after this)