• 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: Multichannel Devices With mChannelsPerFrame == 1?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multichannel Devices With mChannelsPerFrame == 1?


  • Subject: Re: Multichannel Devices With mChannelsPerFrame == 1?
  • From: Jeff Moore <email@hidden>
  • Date: Tue, 15 Apr 2008 17:35:58 -0700

Basically what you have here is a device that has multiple mono streams. The reason you are having problems with it is that you are not dealing with the HAL properly with respect to getting the format information. Basically, you've already shot yourself in the foot before even getting out of the gate.

Stream format information is just that, stream information. Asking the device about it is not what you want to do. Rather, you need to get the list of of the streams in the direction you are interested in and get the format for each one. It's best to think of the format of an audio device as an array of ASBDs, one for each stream. In order to render to each stream in your IOProc, you will need to construct and manage an AudioConverter for each stream and deal with breaking apart your data and feeding it in properly depending on the stream layout.

Of course it's a shame you say you can't use AUHAL. Because if you were, this wouldn't be a problem. It takes care dealing with all of this so you don't have to. Instead you are going to be writing and testing a lot of code for a lot of different devices that have lots of wacky stream layouts. Good luck. You've chosen a difficult path.

On Apr 15, 2008, at 5:26 PM, Puhl, Scott wrote:
I'm using an AudioConverter to send my app's internal audio data stream to the output device, and am seeing some odd behavior with several pieces of external audio hardware. These problem units are reporting their format description to be lpcm with only one channel per frame.

For instance, the Focusrite Saffire LE external firewire device exhibits the following:

dataSize = sizeof(formatDesc);
err = AudioDeviceGetProperty(deviceID, 0, false, kAudioDevicePropertyStreamFormat, &dataSize, &formatDesc);


formatDesc
.mSampleRate == 48000
.mFormatID == 'lpcm'
.mFormatFlags == 11
.mBytesPerPacket == 4
.mFramesPerPacket == 1
.mBytesPerFrame == 4
.mChannelsPerFrame == 1
.mBitsPerChannel == 32
.mreserved == 149


Most devices report >1 (usually 2-10) for mChannelsPerFrame. When a converter is created using this single-channel data, the resultant stream is then also single-channel.


I know the Saffire is a multiple channel device, but it doesn't report itself to be one through AudioDeviceGetProperty() for the kAudioDevicePropertyStreamFormat property id.

Is there another way I should be querying this info from the device?

This code cannot at this time be modified to use AUGraph technology to handle audio output, so that is not a workable solution for me.



--

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
References: 
 >Multichannel Devices With mChannelsPerFrame == 1? (From: "Puhl, Scott" <email@hidden>)

  • Prev by Date: Multichannel Devices With mChannelsPerFrame == 1?
  • Next by Date: Re: Multichannel Devices With mChannelsPerFrame == 1?
  • Previous by thread: Multichannel Devices With mChannelsPerFrame == 1?
  • Next by thread: Re: Multichannel Devices With mChannelsPerFrame == 1?
  • Index(es):
    • Date
    • Thread