• 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: Speeding HAL plugin loop rate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Speeding HAL plugin loop rate


  • Subject: Re: Speeding HAL plugin loop rate
  • From: Jeff Moore <email@hidden>
  • Date: Wed, 21 Jan 2009 09:44:27 -0800

There isn't any sample code to help you out here. Every bit of hardware is going to be different so it is difficult to generalize this area of the driver. However, the infrastructure in the sample code supporting this are the two clocking methods, HP_Device::GetCurrentTime() and HP_Device::TranslateTime(). Your driver needs to override these methods to implement whatever strategy you come up with for handling your clock.

It would probably be educational for you to take a look at how IOAudio drivers do this. Basically, these kernel drivers circle around a ring buffer. Each time the driver wraps around to the beginning of the the ring buffer, it drops a time stamp for the HAL. This time stamp tells the HAL the host time that the wrap around happenned. The HAL uses theses time stamps as the input to a predictor that allows the HAL to measure the rate scalar that the time stamps describe and to provide the clock for the IOThread and to generate all the time stamps.

I don't know much about your hardware, but this scheme for clocking is very flexible. It should be adaptable to pretty much any situation.

--
Jeff Moore
Sent from my iPhone



On Jan 21, 2009, at 4:28 AM, Mike Kluev <email@hidden> wrote:

On Tue, 20 Jan 2009 11:11:35 Jeff Moore wrote:

.... If your driver was providing proper timing services, the IO thread would just naturally track what your hardware is doing.
So, what you need to do is to figure a way to provide the sort of timing services that a driver is required to. This means that you need to figure out a way to measure the true rate at which your hardware is running and to feed that into your driver.

Is there sample code or other documentation that shows how to feed time info into driver?

As for your sample rate problem with the sample code, ....
Feel free to file a feature request on the former problem and a bug about the latter problem.

I'll file both issues shortly.

Mike

_______________________________________________
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: Speeding HAL plugin loop rate (From: "Mike Kluev" <email@hidden>)
 >Re: Speeding HAL plugin loop rate (From: "Mike Kluev" <email@hidden>)
 >Re: Speeding HAL plugin loop rate (From: "Mike Kluev" <email@hidden>)

  • Prev by Date: Re: Few sample rate conversion questions
  • Next by Date: Re: Few sample rate conversion questions
  • Previous by thread: Re: Speeding HAL plugin loop rate
  • Next by thread: Re: Speeding HAL plugin loop rate
  • Index(es):
    • Date
    • Thread