• 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
Do not want multiple clients mixing my audio
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Do not want multiple clients mixing my audio


  • Subject: Do not want multiple clients mixing my audio
  • From: John Johnson <email@hidden>
  • Date: Fri, 14 May 2010 08:53:12 -0500

I'm trying to figure out if there's a way to prevent audio streams from mixing data, whether by one client having exclusive access or whatever. I've tried making the format not mixable, but then I get a panic in clipOutputSamples:
IOReturn Engine::clipOutputSamples(const void *mixBuf, void *sampleBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream)
{
<snip>
UInt32 offset = firstSampleFrame * (streamFormat->fBitWidth / 8) * streamFormat->fNumChannels;
UInt32 size = numSampleFrames * (streamFormat->fBitWidth / 8) * streamFormat->fNumChannels;
memcpy(&((SInt8 *)sampleBuf)[offset], &((SInt8 *)mixBuf)[offset], size); // panic here when !streamFormat->fIsMixable
<snip>
}

The panic doesn't occur when I hardcode a small size or don't add an offset to the mixBuf. I'm wondering if the math has to be done differently. 
However, maybe this is barking up the wrong tree here, anyway I've wasted a day or so on it. Perhaps it is better to override 
virtual IOReturn addClient(IOAudioClientBuffer *clientBuffer)???


Also, I found that when a user-space client connects, a debug property kIOUserClientCreatorKey is set in the IORegistry
IOUserClientCreator string pid XXXX, coreaudiod
Is this reliable? Currently I'm parsing the string to obtain just the client name, since pid_for_task() does not seem to exist in the kernel. Or maybe I'm missing something there too, and there's a way to get process name from the task_t passed in to the user client?
I've been scouring the IOAudioFamily source code, and have learned much but any help on these issues would be appreciated. Thanks again!
 _______________________________________________
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: Do not want multiple clients mixing my audio
      • From: Daniel Mack <email@hidden>
    • Re: Do not want multiple clients mixing my audio
      • From: Jeff Moore <email@hidden>
  • Prev by Date: Re: Disposing of the AUGraph
  • Next by Date: Re: Do not want multiple clients mixing my audio
  • Previous by thread: Re: Disposing of the AUGraph
  • Next by thread: Re: Do not want multiple clients mixing my audio
  • Index(es):
    • Date
    • Thread