Skip to content

[macOS] Crash when 'Audio Mode' is set to 'Unity' in MacOS 26.0+ #2403

@michaelj909

Description

@michaelj909

Unity version

6000.2.7f2

Unity editor platform

macOS

AVPro Video edition

Core

AVPro Video version

3.3.4

Device hardware

MacBook Pro 2020 M1 8GB, and MacBook Air 2022 M2 8GB

Which macOS version are you using?

Tahoe 26.1

Texture format

BGRA

Audio output

Unity

Any other Media Player component configuration required to reproduce the issue.

Screenshot of MacOS audio settings in MediaPlayer component attached. Through much testing we have identified the MacOS 'Audio Mode' setting as being the one that sets off the crash. When set to 'SystemDirect' our application runs without issue. When set to 'Unity' the crash occurs.

Image

Which output component(s) are you using?

Audio Output, Display uGUI

Any other component configuration required to reproduce the issue.

Files (both video and audio) are always opened via script, from arbitrary (user-selected) locations on the user's drive, using the 'mediaplayer.OpenMedia(MediaPathType.AbsolutePathOrURL, [path])' method.

An 'AudioOutput' component is always present with each MediaPlayer instance, and a 'DisplayUGUI' instantiated as needed when the file in question is a video rather than mere audio.

The issue

Occasionally when playing a file (either video or audio) a segmentation fault will occur (see Log Output for an example) causing our application to close unexpectedly.

This issue doesn't occur every time that a file is played, but based on debug statements in our software when it does occur it always coincides with a 'mediaPlayer.Control.Play()' method call. Anecdotally it seems to occur more often on repeat plays of a file (even if other files are played between the first play of a file and its repeat play), though we haven't been able to definitively confirm this correlation in testing.

It should be noted that there are often multiple MediaPlayer component instances active at any one given time in our software (to allow for smoother crossfading/looping of media, and to layer different media on top of each other). The crash does seem to happen more often in more complex scenarios, but it is unclear to us whether it's the complexity of the scene itself contributing to the crash, or if it's simply a case that with more players the 'mediaPlayer.Play()' method is getting called more often thus meaning there are more opportunities for the segmentation fault to occur.

Through our testing we have also determined that this bug only started happening following the MacOS 26 'Tahoe' update. It did not seem to occur at all in MacOS 15.6.1 or earlier.

The bug is not related to Unity 6 specifically - we also experienced the exact same crash when building from Unity 2022.3.30f1.

Additionally, the bug is not unique to recent AVPro versions. We first encountered it with AVPro Video Core v2.9.3. We actually updated to Core v3.3.4 as a hail-Mary in the hopes that the new version of the asset would resolve it, but alas the issue is still there in the current version of AVPro too.

EDIT: Just to add, this bug only occurs in our built application. We have never experienced the crash in Unity Editor. Additionally, we compile from Unity Editor to an Xcode Project, then compile it from Xcode to the final .app.

Media information

The bug does not seem to be correlated to any one file or file format.

Our software uses AVPro to allow users to play back video and audio files from their file system. The bug in question has been reported in connected to multiple files of varying formats (including but not limited to mp4, mp3, wav, and m4a).

Log output

=================================================================
	Native Crash Reporting
=================================================================
Got a segv while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
	Native stacktrace:
=================================================================
	0x11c0b938c - /Applications/[APP NAME].app/Contents/Frameworks/libmonobdwgc-2.0.dylib : monovm_shutdown
	0x11c07b60c - /Applications/[APP NAME].app/Contents/Frameworks/libmonobdwgc-2.0.dylib : mono_unity_backtrace_from_context
	0x11c003d60 - /Applications/[APP NAME].app/Contents/Frameworks/libmonobdwgc-2.0.dylib : mono_jit_set_domain
	0x19cd1f744 - /usr/lib/system/libsystem_platform.dylib : _sigtramp
	0x1b06a908c - /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox : _ZN2AQ3API6V2Impl37AudioQueueProcessingTapGetSourceAudioEP29OpaqueAudioQueueProcessingTapjP14AudioTimeStampPjS6_P15AudioBufferList
	0x1afd9ec98 - /System/Library/Frameworks/MediaToolbox.framework/Versions/A/MediaToolbox : FigAssetWriterCreateWithURL
	0x126982ce8 - /Applications/[APP NAME].app/Contents/PlugIns/AVProVideo.bundle/Contents/MacOS/AVProVideo : AVPPlayerGetCachedMediaStatusForURL
	0x1af96ce28 - /System/Library/Frameworks/MediaToolbox.framework/Versions/A/MediaToolbox : MTAudioProcessingTapGetStreamMediaTimeRange
	0x1b06c39b4 - /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox : _ZN5caulk12thread_proxyINSt3__15tupleIJNS_6thread10attributesEZN2AQ3API20ProcessingTapManager7RTStateC1ERKN10applesauce3xpc6objectERNS6_23ProcessingTapAttributesERiE3$_0NS2_IJEEEEEEEEPvSK_
	0x19cd15c08 - /usr/lib/system/libsystem_pthread.dylib : _pthread_start
	0x19cd10ba8 - /usr/lib/system/libsystem_pthread.dylib : thread_start

=================================================================
	Telemetry Dumper:
=================================================================
Thread 0x17086b000 may have been prematurely finalized* Assertion at mono-threads.c:702, condition `info' not met, function:mono_thread_info_current, 

An error has occured in the native fault reporting. Some diagnostic information will be unavailable.

=================================================================
	Native stacktrace:
=================================================================
	0x11c0b938c - /Applications/[APP NAME].app/Contents/Frameworks/libmonobdwgc-2.0.dylib : monovm_shutdown
	0x11c211610 - /Applications/[APP NAME].app/Contents/Frameworks/libmonobdwgc-2.0.dylib : monoeg_assertion_message
	0x11c2054e4 - /Applications/[APP NAME].app/Contents/Frameworks/libmonobdwgc-2.0.dylib : mono_thread_info_current_unchecked
	0x11c206bf8 - /Applications/[APP NAME].app/Contents/Frameworks/libmonobdwgc-2.0.dylib : mono_thread_info_set_flags
	0x11c1ae684 - /Applications/[APP NAME].app/Contents/Frameworks/libmonobdwgc-2.0.dylib : mono_threads_detach_coop
	0x11c0b95d4 - /Applications/[APP NAME].app/Contents/Frameworks/libmonobdwgc-2.0.dylib : monovm_shutdown
	0x11c07b60c - /Applications/[APP NAME].app/Contents/Frameworks/libmonobdwgc-2.0.dylib : mono_unity_backtrace_from_context
	0x11c003d60 - /Applications/[APP NAME].app/Contents/Frameworks/libmonobdwgc-2.0.dylib : mono_jit_set_domain
	0x19cd1f744 - /usr/lib/system/libsystem_platform.dylib : _sigtramp
	0x1b06a908c - /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox : _ZN2AQ3API6V2Impl37AudioQueueProcessingTapGetSourceAudioEP29OpaqueAudioQueueProcessingTapjP14AudioTimeStampPjS6_P15AudioBufferList
	0x1afd9ec98 - /System/Library/Frameworks/MediaToolbox.framework/Versions/A/MediaToolbox : FigAssetWriterCreateWithURL
	0x126982ce8 - /Applications/[APP NAME].app/Contents/PlugIns/AVProVideo.bundle/Contents/MacOS/AVProVideo : AVPPlayerGetCachedMediaStatusForURL
	0x1af96ce28 - /System/Library/Frameworks/MediaToolbox.framework/Versions/A/MediaToolbox : MTAudioProcessingTapGetStreamMediaTimeRange
	0x1b06c39b4 - /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox : _ZN5caulk12thread_proxyINSt3__15tupleIJNS_6thread10attributesEZN2AQ3API20ProcessingTapManager7RTStateC1ERKN10applesauce3xpc6objectERNS6_23ProcessingTapAttributesERiE3$_0NS2_IJEEEEEEEEPvSK_
	0x19cd15c08 - /usr/lib/system/libsystem_pthread.dylib : _pthread_start
	0x19cd10ba8 - /usr/lib/system/libsystem_pthread.dylib : thread_start

=================================================================
	External Debugger Dump:
=================================================================

Exiting early due to double fault.

Metadata

Metadata

Assignees

Labels

macOSmacOS platform

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions