• 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: AudioUnit problem: CFRunLoopRunInMode() spins after first thread exits, and second thread begins?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AudioUnit problem: CFRunLoopRunInMode() spins after first thread exits, and second thread begins?


  • Subject: Re: AudioUnit problem: CFRunLoopRunInMode() spins after first thread exits, and second thread begins?
  • From: Jeremy Friesner <email@hidden>
  • Date: Thu, 16 Oct 2008 09:17:17 -0700

Hi Jeff,

Jeff Moore wrote:
>According to the documentation for CFRunLoopRunInMode(), kCFRunLoopRunFinished is returned whenever the 
>run loop doesn't have any sources or timers installed on it. That makes me think that there is a problem 
>with how you are setting things up.

I think you're probably right, but it's not obvious to me what I'm doing wrong.  The setup and teardown code is the same code in both the first (working) thread and the second (CPU-spinning) thread.

To make it easier to figure out, I've boiled my code down to a simple unit test.  If you compile the standalone .cpp file at the following URL ("g++ coreaudio_unit_test.cpp -framework AudioUnit -framework CoreServices") and run it with no arguments, it should reproduce the problem.

   http://public.msli.com/lcs/jaf/coreaudio_unit_test.cpp

Expected behavior of the unit test:
   (1) Play an ugly sine wave for 5 seconds, with minimal CPU usage
   (2) Pause for two seconds of silence
   (3) Goto (1)

Observed behavior of the unit test (on my 8-core Xeon MacPro, with Leopard/10.5.5):
   (1) Plays an ugly sine wave for 5 seconds, with minimal CPU usage
   (2) Pauses for two seconds of silence
   (3) Plays the ugly sine wave for 5 more seconds, but now it uses 100% CPU on one core, according to Activity Monitor (!!!)
   (4) Goto (2)

Can anyone reproduce this problem using the program at the URL above?  If so, any ideas as to what is going wrong?

Thanks,
Jeremy

 _______________________________________________
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: AudioUnit problem: CFRunLoopRunInMode() spins after first thread exits, and second thread begins?
      • From: Stephen Davis <email@hidden>
  • Prev by Date: Re: Splitting stereo to 2 audiobuffers with AudioConverter
  • Next by Date: Re: AudioUnit problem: CFRunLoopRunInMode() spins after first thread exits, and second thread begins?
  • Previous by thread: Re: handling inequal in and out sample counts
  • Next by thread: Re: AudioUnit problem: CFRunLoopRunInMode() spins after first thread exits, and second thread begins?
  • Index(es):
    • Date
    • Thread