• 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: sample data types (iOS)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sample data types (iOS)


  • Subject: Re: sample data types (iOS)
  • From: Gregory Wieber <email@hidden>
  • Date: Tue, 14 Feb 2012 08:32:32 -0800

I don't think you can use float in a remoteIO, that has to be native format AFAIK. You would use floats in a mixer connected to the remoteIO.

Those effect units are ios 5, so you're not going to be able to run on earlier versions anyway.

Apple's conversion units are really fast; the point is that if you do any math at all, floating point is going to be much faster. Just try to only convert twice at most (loading audio and sending audio out).

The official guidance is to use floating point math. It is native. I think the confusion is that the canonical audio format is integer, leading many to believe they should use integer math. I know I did for a long time.

If you're target doesn't have native floating point processing obviously that's something you'll have to consider. But I think native floating point has been around for a long time now. The issue in the armv6 devices was really about not using Thumb (because it would cause all floating point operations to be done through emulation).



Sent from my iPhone

On Feb 14, 2012, at 6:57 AM, Chris Adamson <email@hidden> wrote:

Maybe it matters what you want to do in your callback? I'd figure Int16s are going to be faster until the callback starts doing heavy maths, right?

My question on this: I was surprised to see the new iOS effect units used floats, because I didn't think floats generally worked with Audio Units on iOS 4 and earlier (and that was why we were made to use 8.24 as the unit canonical type). So that makes me wonder if we start using floats, we'll find we have AUGraphs that work on iOS 5 but throw a '?fmt' error on iOS 4 or earlier. That would suck.

Also, since a lot of the older units default to 8.24 or Int16, I wonder if the cost of format conversion (either by using AUConverters or setting kAudioUnitStreamFormat where possible) is going to cancel out the advantages of using real floats.

Sounds like we could use some official guidance on formats and their performance considerations… maybe a nice topic for a technical Q&A or a few WWDC slides (please?)

--Chris

On Feb 14, 2012, at 8:44 AM, Morgan Packard wrote:

So this means I'm better off setting up my remoteIO callback so it uses a buffer of floats rather than Int16's as it does now, correct?
-m-

On Tue, Feb 14, 2012 at 5:52 AM, Hari Karam Singh <email@hidden> wrote:

Thanks Gregory.  I remember reading that now.   I can attest to the Accelerate framework too!

 

HKS

 

From: Gregory Wieber [mailto:email@hidden]
Sent: 12 February 2012 20:07
To: Hari Karam Singh
Cc: email@hidden
Subject: Re: sample data types (iOS)

 

Apple states that arm supports floating point natively. Quote:

 

"The ARM processor in iOS devices processes floating-point instructions natively. Your application should use floating-point instead of fixed point math whenever possible. If you are porting an application that uses fixed-point operations, rewrite the code to use floating-point types."

 

Also, the accelerate framework makes it possible to vectorize certain operations, and gain orders of magnitude increases in performance. 

Just watch out for how you're getting data back and forth to the native audio format, because that can be a bottleneck.

 


 _______________________________________________
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




--
===============
Morgan Packard
cell: (720) 891-0122
aim: mpackardatwork

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: sample data types (iOS)
      • From: Doug Wyatt <email@hidden>
References: 
 >Re: sample data types (iOS) (From: Hari Karam Singh <email@hidden>)
 >Re: sample data types (iOS) (From: Gregory Wieber <email@hidden>)
 >RE: sample data types (iOS) (From: Hari Karam Singh <email@hidden>)
 >Re: sample data types (iOS) (From: Morgan Packard <email@hidden>)
 >Re: sample data types (iOS) (From: Chris Adamson <email@hidden>)

  • Prev by Date: Re: sample data types (iOS)
  • Next by Date: Need to access/manipulate mixed output: MultiChannelMixer + AudioConverter, or mix manually?
  • Previous by thread: Re: sample data types (iOS)
  • Next by thread: Re: sample data types (iOS)
  • Index(es):
    • Date
    • Thread