• 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
Re: PerformDeviceConfigurationChange sequence
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PerformDeviceConfigurationChange sequence


  • Subject: Re: PerformDeviceConfigurationChange sequence
  • From: Ploytec <email@hidden>
  • Date: Tue, 04 Mar 2014 19:00:00 +0100

Hi Jeff,

As I could reproduce this problem with null_audio, I filed a bug #16223753

Best regards
Eric Gorouben
Le 3 mars 2014 à 22:41, Ploytec <email@hidden> a écrit :

Sorry Jeff... Of course, I meant "on different threads". The sentence was indeed stupid without this missing word, and this certainly doesn't help! 

1) StartIO, StopIO, PerformDeviceConfigurationChange are running in different threads. Just tracing the TID in each of these methods, or breaking with a debugger shows it.
2) However, you tell me that the sequence StopIO/PerformDeviceConfigurationChange/StartIO is guaranteed.
Is this correct?

Thanks for helping
Eric Gorouben
Le 3 mars 2014 à 19:33, Jeff Moore <email@hidden> a écrit :

I’m not sure I understand what you are saying. Of course they are called from threads. Everything is called from a thread.

PerformDeviceConfigurationChange() is spec’d to not return until the driver has completed the configuration change. Only when that routine returns does IO get restarted.

--

Jeff Moore
Core Audio
Apple


On Mar 3, 2014, at 3:42 AM, Ploytec <email@hidden> wrote:

Hi Jeff

Thanks for your reply.

No the driver is not dispatching asynchronously. 
The HAL stops IO, calls PerformDeviceConfigurationChange() and then restarts IO all in a series on the same thread (actually, from the same function in HAL’s implementation to be precise). 
However, I notice that StartIO, StopIO, PerformDeviceConfigurationChange are called on threads (I verified this with the latest Null_audio as well).

Did I miss something?
Thanks
Eric Gorouben.
Le 28 févr. 2014 à 19:52, Jeff Moore <email@hidden> a écrit :

I was referring to what the driver is doing inside its implementation of the PerformDeviceConfigurationChange method. If the driver is dispatching that work asynchronously to another thread and simply returning from the call to PerformDeviceConfigurationChange, it will get the behavior you describe.

--

Jeff Moore
Core Audio
Apple


On Feb 28, 2014, at 10:21 AM, Ploytec <email@hidden> wrote:

Hi Jeff,

Thanks for the reply.
I'm not sure I understand your suggestion.

28/02/2014 15:55:03,228 coreaudiod[511]: +PerformDeviceConfigurationChange
28/02/2014 15:55:03,228 coreaudiod[511]: +StartIO
28/02/2014 15:55:03,987 coreaudiod[511]: -PerformDeviceConfigurationChange
28/02/2014 15:55:04,013 coreaudiod[511]: -StartIO

shows that the driver returns from PerformDeviceConfigurationChange at 03,987. 
I use 
           AudioObjectID theDeviceObjectID = GetObjectID();
            CADispatchQueue::GetGlobalSerialQueue().Dispatch(false, ^{
                PtASPlugInPlugIn::Host_RequestDeviceConfigurationChange(theDeviceObjectID, myChangeAction, &mConfigChangeInfo);
            });

to request the change.

Eric Gorouben
Le 28 févr. 2014 à 19:08, Jeff Moore <email@hidden> a écrit :

The HAL stops IO, calls PerformDeviceConfigurationChange() and then restarts IO all in a series on the same thread (actually, from the same function in HAL’s implementation to be precise). So it seems like the only way you could get the behavior you are describing is if your driver returns from PerformDeviceConfigurationChange() before the change has actually completed. Could this be the case here?

--

Jeff Moore
Core Audio
Apple

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
References: 
 >Re: PerformDeviceConfigurationChange sequence (From: Ploytec <email@hidden>)
 >Re: PerformDeviceConfigurationChange sequence (From: Jeff Moore <email@hidden>)
 >Re: PerformDeviceConfigurationChange sequence (From: Ploytec <email@hidden>)

  • Prev by Date: Re: PerformDeviceConfigurationChange sequence
  • Next by Date: How to use AudioComponentRegister()?
  • Previous by thread: Re: PerformDeviceConfigurationChange sequence
  • Next by thread: How to use AudioComponentRegister()?
  • Index(es):
    • Date
    • Thread