Hi,
Here are some other informations about my problem.
My driver is able to deal multiple format (44,1kHz to 192kHz in either 16 or 24 bits).
When I start playing, no problem, and when I change the sample rate, no problem, the change is done and the player still plays.
When I change the bit depth, the player stops, and if I change the sample rate, it plays again.
I have wrapped some IOAudioEngine calls to check for any differences between changing the sample rate and the bit depth.
In both cases, everything is similar until IOAudioEngine::performFormatChange is called:
IOAudioEngine::sendFormatChangeNotification(IOAudioStream *audioStream)
IOAudioEngine::resumeAudioEngine()
IOAudioEngine::setState( Resumed )
IOAudioEngine::sendNotification( kIOAudioEngineResumedNotification )
The only difference between changing the sample rate / bit depth occurs after the resume notification is sent, ONLY when I change the sample rate, the following sequence is called:
IOAudioEngine::stopAudioEngine()
IOAudioEngine::setState( Stopped )
IOAudioEngine::sendNotification( kIOAudioEngineStoppedNotification )
The IOAudioEngine::stopAudioEngine() is called from IOAudioDevice from IOAudioDevice::deactivateAllAudioEngines() called from IOAudioDevice::stop().
Why sample rate and bit depth are not processed the same way ?
Is there any way to have the IOAudioDevice::stop() called after a bit depth change ?
In most audio driver sample code I have seen, there is always one format (i.e. bit depth) dealt, so I wonder if there is something special to do when dealing multiple audio formats and switching from one another ?
Thanks in advance for any help !
Cheers