Hi,

About the setFormat call in my CustomIOAudioEngine::performFormatChange, as
I'm in the case of a virtual audio driver, this call is useless, but I did
it for test purposes. With or without this call, after a format change
(from 16 to 24 bits or vice versa) sometimes the player still plays,
sometimes not.

Thanks in advance for any help.

Best regards.

2016-02-19 22:47 GMT+01:00 Matthieu Collette <[email protected]>:

> Hi,
>
> I have developed a virtual audio driver using the IOKit classes.
> It gets samples and sends those samples through the network.
> It works as expected but I am facing some issues with audio format changes.
>
> My driver has two streams, one for input and one for output.
> It can deal 16 bits and 24 bits depth with sample rates from 44kHz to
> 192kHz.
>
> While playing, if I change the sample rate using an external application
> such as Audio MIDI Setup, the sample rate is successfully changed and the
> audio engine continues playing.
>
> When I change the bit depth using the same external application, the
> player I use is paused and I am unable to play again until I change the
> sample rate again.
>
> I have wrapped some of my custom IOAudioEngine's virtual methods to
> understand what is going on.
>
> 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 ?
>
> In my CustomIOAudioEngine::performFormatChange, when the
> IOAudioStreamFormat is not null, I call the setFormat method on my output
> stream ... it sometimes works, sometimes don't.
>
> I am surely missing something but don't know what yet.
>
> I hope someone could help.
>
> Thanks in advance.
>
> Cheers.
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to