• 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: How to transmit customized data to IOAudioFamily
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to transmit customized data to IOAudioFamily


  • Subject: Re: How to transmit customized data to IOAudioFamily
  • From: Jeff Moore <email@hidden>
  • Date: Tue, 06 Jan 2009 12:16:03 -0800

If you want your device to be able to receive some kind of data that is non-standard, then you have to set your driver up properly to do that. This means that you need to make sure that the format of your streams is all set correctly and is using a unique format ID. If this data can't be mixed, you'll also need to be sure set the non-mixable flag in the format.

Once your device is advertising that it accepts a custom format, it is up to you to write the code to shovel the data to the device as I don't believe that we have any sample code that shows how to send non-linear PCM data to a device.

Basically, the key thing to keep in mind is that IOAudio/HAL only support constant bit rate formats. This means that all the packets of data have to be the same size. Further, the HAL will only do IO in single packet buffers. This means that each call to the IOProc is expected to produce exactly one packet of the non-linear PCM formated data.

This is just the overview of what's involved. I'm sure as you dig into the problem you'll have more questions, so feel free to ask.


On Jan 5, 2009, at 3:12 AM, David Tan wrote:

Now I’m working on an applet which can transmit customized samples data to my KEXT audio driver.
I found useful source code from AudioFileTools provided at /Developer/Examples/CoreAudio/Services/AudioFileTools. It seems that “afplay” is similar to what I expect.
After examining the source code, I thought I can replace the actual audio data from audio file with my customized data at CAAudioFilePlayer::InputProc(). There’s a parameter “AudioBufferList* ioData” of this callback function.
As I understood, actual audio data will be filled into ioData and then CAAudioFilePlayer will transfer them to KEXT audio driver via CoreAudio.
 
However, after I implemented the replacement, I cannot hear anything from the headphone. So I put a breakpoint at IOAudioEngine::clipOutputSample() in my kernel-driver, and found that the samples in mixbuf are always zero.
That means I cannot get customized audio data from my applet.
 
Is there anything I misunderstood or missed? Any advice and suggestion will be much appreciated. Thanks a lot!



-- 

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

  • Follow-Ups:
    • RE: How to transmit customized data to IOAudioFamily
      • From: "David Tan" <email@hidden>
References: 
 >How to transmit customized data to IOAudioFamily (From: "David Tan" <email@hidden>)

  • Prev by Date: Re: Question about stopAudioEngine()
  • Next by Date: Re: SampleHardwareDriver bug?
  • Previous by thread: How to transmit customized data to IOAudioFamily
  • Next by thread: RE: How to transmit customized data to IOAudioFamily
  • Index(es):
    • Date
    • Thread