Re: AUGraph deadlocks
Re: AUGraph deadlocks
- Subject: Re: AUGraph deadlocks
- From: Doug Wyatt <email@hidden>
- Date: Fri, 2 Dec 2011 12:09:33 -0800
AUGraphNodeInfo is (obviously) taking a lock and so it shouldn't be called on the audio render thread. I'd suggest fetching and caching whatever information you need from it beforehand.
On Dec 2, 2011, at 8:01 , patrick machielse wrote:
> In my app I'm using an AUGraph. This graph can be manipulated / inspected from both the audio rendering thread and the main thread.
>
> Occasionally I encounter deadlocks like this:
>
> ** MAIN THREAD **
> #0 0x9ac29876 in __psynch_mutexwait ()
> #1 0x93bfb6af in pthread_mutex_lock ()
> #2 0x92698cae in HALB_Mutex::Lock ()
> #3 0x926b5865 in HALC_ProxyIOContext::StopIOProc ()
> #4 0x926ab024 in __HAL_HardwarePlugIn_DeviceStop_block_invoke_30 ()
> #5 0x9269bb9b in HALB_Executor::DoIt ()
> #6 0x9269bb45 in HALB_Executor::Run ()
> #7 0x926cb238 in HAL_HardwarePlugIn_DeviceStop ()
> #8 0x926d8294 in HALPlugIn::DeviceStopIOProc ()
> #9 0x926d3e1b in HALDevice::StopIOProc ()
> #10 0x926aaeb3 in AudioDeviceStop ()
> #11 0x7000b048 in AUHAL::StopHardware ()
> #12 0x7000be1f in AUHAL::Stop ()
> #13 0x700a3e8d in AUMethodStop ()
> #14 0x985220ea in _AT_AudioOutputUnitStop ()
> #15 0x98532a71 in AudioUnitGraph::Stop ()
> #16 0x98534eb6 in AUGraphStop ()
> #17 0x0002d05b in ** MY_CODE **
>
> ** AUDIO THREAD **
> #0 0x9ac29876 in __psynch_mutexwait ()
> #1 0x93bfb6af in pthread_mutex_lock ()
> #2 0x9851ba87 in CAMutex::Lock ()
> #3 0x98534958 in AUGraphGetNodeInfo_Imp ()
> #4 0x98534a95 in AUGraphNodeInfo ()
> #5 0x0002b612 in getUnitByNode [inlined] () ** MY_CODE **
>
>
> In the documentation on AUGraph I found the following statement:
>
> "A graph object’s state can be manipulated in both the rendering thread and in other threads. Consequently, any activities that affect the state of the graph are guarded with locks and a messaging model between any calling thread and the thread upon which the graph object’s output unit is called (the render thread)."
>
> I think it means that it calling AUGraphNodeInfo() and AUGraphStop() should be allowed, and that locking is handled by the framework. However, it seems not to work that way...
>
> Should I synchronize all graph access?
_______________________________________________
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