Ticket #27 (closed enhancement: fixed)

Opened 21 months ago

Last modified 16 months ago

Provide channel mask for CoreAudio like ASIO has

Reported by: rossb Owned by: bjornroche
Priority: minor Milestone: V19-RC1
Component: host-api-coreaudio Version: 2.0
Keywords: Cc:

Description (last modified by bjornroche) (diff)

PaAsio provides an extension to only open a subset of channels on a multichannel device (leaving other channels available to other applications for example). A similar feature has been requested for PaCore.

For now, if users want to open channels n to m on a given device, them must open channels 0 to m on that device and pass zeros to channels 0 to (n-1). It has been suggested that apple provides an API for doing this more efficiently (channel mapping) and that API should be available. A simmilar API is available for ASIO, and that API should be mimicked if possible. This feature is often requested.

As suggested by Olivar Tristan, the following code may also be used for getting the channel names:

Hi,

I use this in my code.

struct PaUtilHostApiRepresentation? *hostApi; PaError? err; err = PaUtil?_GetHostApiRepresentation( &hostApi, (PaHostApiTypeId?)m_APIId); assert(err == paNoError); PaMacCoreHostApiRepresentation? *macCoreHostApi = (PaMacCoreHostApiRepresentation?*)hostApi; AudioDeviceID hostApiDevice = macCoreHostApi->devIds[m_Id]; char channelName[256]; UInt32 dataSize = sizeof(channelName); OSStatus error = AudioDeviceGetProperty?( hostApiDevice, index + 1, false, kAudioDevicePropertyChannelName, &dataSize, &channelName ); if (error == noErr) {

return String(channelName);

}

Where index is the channel id (zero based) and APIId the API id (only 1 on mac)

Also, see

http://lists.apple.com/archives/coreaudio-api/2006/Nov/msg00162.html

to figure out whether that is the right property or if instead you have to use kAudioDevicePropertyChannelNameCFString. I only skimmed the thread, but it looks to me like you might have to try both for best compatibility.

See:

Change History

Changed 21 months ago by bjornroche

  • status changed from new to assigned
  • milestone set to V19-RC1

Changed 21 months ago by rossb

  • summary changed from Provide channel mask for CoreAudio lie ASIO has to Provide channel mask for CoreAudio like ASIO has

Corrected typo in summary

Changed 17 months ago by bjornroche

For now, if users want to open channels n to m on a given device, them must open channels 0 to m on that device and pass zeros to channels 0 to (n-1). It has been suggested that apple provides an API for doing this more efficiently (channel mapping) and that API should be available. A simmilar API is available for ASIO, and that API should be mimicked if possible. This feature is often requested.

See:

Changed 17 months ago by bjornroche

  • description modified (diff)

Changed 17 months ago by bjornroche

  • description modified (diff)

added notes about channel naming.

Changed 16 months ago by bjornroche

  • status changed from assigned to closed
  • resolution set to fixed

Resolved in revision 1189.

Note: See TracTickets for help on using tickets.