• 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
Recording and streaming in a HAL plugin/driver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Recording and streaming in a HAL plugin/driver


  • Subject: Recording and streaming in a HAL plugin/driver
  • From: Joel Reymont <email@hidden>
  • Date: Fri, 25 Jan 2013 19:55:48 +0000

I have written a HAL plugin (driver) for 10.8.x that talks to a
networked device to record and stream audio.

I have two issues at the moment.

1) When CoreAudio starts IO, I cannot detect whether it's input or output.

I have to initialize the device for input or output by issuing HTTP
requests and opening sockets according to data I get back. Since the
StartIO callback does not tell me whether IO is starting for input or
output, I set up my device for both.

Interestingly enough, CoreAudio seems to feed me zero-samples even
when I press the Record button in Audacity. That is, I try to record
but CoreAudio feeds data to my output streams regardless.

Yes, I do distinguish between kAudioServerPlugInIOOperationReadInput
and kAudioServerPlugInIOOperationWriteMix. The issue is that
kAudioServerPlugInIOOperationWriteMix is getting invoked with
zero-samples.

Any suggestions on why and how to work around this?

Then there's a more interesting problem...

2) If I Record in Audacity and then start output via the File Player
window in HALLab, my effective sample rate on the driver output side
goes up 10-fold.

CoreAudio normally invokes my output callback using a frame size of
512 samples. But if I start recording in Audacity and then streaming
from HALLab, I get both 512 zero-samples from Audacity (see issue #1
above) AS WELL as 8192 samples from HALLab.

This doesn't happen if I record and stream in Audacity at the same
time, e.g. by using the same input and output device and using overdub
from the first track while recording.

Is this a normal situation and if so how should I handle it?

Should I multiplex between samples from both streams by alternating
between them, e.g. by looking at the client id?

Should I merge the two streams instead?

Should I try to somehow stop CoreAudio from feeding me zero samples on
output while I'm recording in Audacity?

    Thanks, Joel

--------------------------------------------------------------------------
for hire: mac osx device driver ninja. kernel, usb and coreaudio drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------
 _______________________________________________
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: Recording and streaming in a HAL plugin/driver
      • From: Joel Reymont <email@hidden>
  • Prev by Date: Re: iPhone hardware assisted AAC > PCM conversion using ExtAudioFileRead
  • Next by Date: kExtAudioFileError_AsyncWriteBufferOverflow
  • Previous by thread: Replacement for RegisterComponentFileRef()
  • Next by thread: Re: Recording and streaming in a HAL plugin/driver
  • Index(es):
    • Date
    • Thread