• 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: Buffer overrun management with TPCircularBuffer.. best way to do so?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Buffer overrun management with TPCircularBuffer.. best way to do so?


  • Subject: Re: Buffer overrun management with TPCircularBuffer.. best way to do so?
  • From: Frederic De Jaeger <email@hidden>
  • Date: Wed, 14 May 2014 12:28:09 +0200

Hi,

AUDeferredRenderer is the same kind of AudioUnit as AUConverter.  You would feed data to it in the exact same way, with a callback (like renderModuleCallback in your gist).
AUDeferredRenderer's job is to call your callback in an auxiliary thread.  From here, you are free to call libxmp directly without the need of using TCPCircularBuffer (In fact, there is some kind of a TCPCircularBuffer inside AUDeferredRenderer).

You probably need to have an intermediate buffer because the number of  frames returned by xmp_get_frame_info might not be  the same  as what is requested to your callback.  Or you may also have a look to kAudioUnitProperty_DeferredRendererPullSize, and set it to the number of frames returned by xmp_get_frame_info (provided it is a constant you can access when you configure the AUGraph)

If libxmp renders faster than the AUGraph, you should not have any issue (provided that you set kAudioUnitProperty_DeferredRendererExtraLatency to a value big enough.  This property corresponds more or less to the size of the internal TCPCircularBuffer)
Hope that helps.

Fred




2014-05-14 10:48 GMT+02:00 Douglas Carmichael <email@hidden>:
Kyle et al.:

How would I feed audio data into the DeferredRenderer?

I tried using Mach semaphores in this example (https://gist.github.com/douglas-carmichael/4be36ec58bcea62ea8d2) but still have the stutter effect.

(For offline rendering to a file, I’m using Audio File Services.)

—Douglas

On May 12, 2014, at 4:28 PM, Kyle Sluder <email@hidden> wrote:

> On Mon, May 12, 2014, at 01:24 PM, Fastepholier Philgarlic wrote:
>> By the way, why not using AUDeferredRenderer and let it manage all this
>> theading/sync nightmare?  It looks design exactly for what you're trying
>> to
>> achieve (AFAIU).
>
> That's pretty neat, but this comment from AudioUnitProperties.h (which
> seems to be the only existing documentation on this audio unit) is
> problematic:
>
>> It is possible, at Render time, for the producer thread to have not yet
>> finished rendering the necessary data. This generates an error.
>
> The "DeferredRendererWaitFrames" property can help mitigate this
> scenario, but it's still possible to get an error.
>
> (Getting an error is probably preferable to stuttering in realtime
> scenarios, but in offline mode it would be nice to just stall.)
>
> --Kyle Sluder


 _______________________________________________
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

  • Follow-Ups:
    • Re: Buffer overrun management with TPCircularBuffer.. best way to do so?
      • From: Douglas Carmichael <email@hidden>
References: 
 >Re: Buffer overrun management with TPCircularBuffer.. best way to do so? (From: Fastepholier Philgarlic <email@hidden>)
 >Re: Buffer overrun management with TPCircularBuffer.. best way to do so? (From: Kyle Sluder <email@hidden>)
 >Re: Buffer overrun management with TPCircularBuffer.. best way to do so? (From: Douglas Carmichael <email@hidden>)

  • Prev by Date: Re: Buffer overrun management with TPCircularBuffer.. best way to do so?
  • Next by Date: Converting to the canonical audio unit format
  • Previous by thread: Re: Buffer overrun management with TPCircularBuffer.. best way to do so?
  • Next by thread: Re: Buffer overrun management with TPCircularBuffer.. best way to do so?
  • Index(es):
    • Date
    • Thread