• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Application crash when calling AudioUnitUninitialize
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Application crash when calling AudioUnitUninitialize


  • Subject: Application crash when calling AudioUnitUninitialize
  • From: Bartosz Nowotny <email@hidden>
  • Date: Thu, 03 Jan 2019 18:13:11 +0100

Hello

I have an application that plays midi songs with different instruments.
When the user picks a song, a new MIDISynth node is added to the audio
graph and the related soundfont is loaded. When user decides to play a
different song, he has to go back which causes audio unit to be
uninitialized and the graph is updated. Then, the user can pick a new song
to play.

The issue is that sometimes when user decides to go back (which removes and
uninitializes a node), the application crashes.

When the application crashes, the last call I make is to:
AudioUnitUninitialize. The crashing thread is AURemoteIO::IOThread,
crashing at SamplerBaseElement::IncrementActiveLayerVoiceCount. Last thing
I see in the logs is: '238: Illegal decrement of empty layer bin count'

The uninitialization flow my app uses is this:
1. Disconnect synth node from the mixer (AUGraphDisconnectNodeInput)
2. Remove synth node from the graph (AUGraphRemoveNode)
3. Uninitialize the synth audio unit (AudioUnitUninitialize) - crash
4. Update the graph (AUGraphUpdate)

From my testing, the crash is seemingly random - it takes anywhere between
2 to 20 repeats to reproduce (pick a song, go back, then again). The music
plays as intended. Tested on iPhone XS with iOS 12.1.2.

I haven't tested this on a mono iPhone yet. Will try to reproduce and get
back with findings.

Any ideas what's wrong here? Could this be a threading issue?

Regards,
Bartosz Nowotny
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Will AVAudioConverter use the hardware decoder?
  • Next by Date: Re: [macOS] Discover and select AirPlay devices for audio output
  • Previous by thread: Re: Will AVAudioConverter use the hardware decoder?
  • Next by thread: Re: [macOS] Discover and select AirPlay devices for audio output
  • Index(es):
    • Date
    • Thread