• 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: iTunes stuttering
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iTunes stuttering


  • Subject: Re: iTunes stuttering
  • From: William Stewart <email@hidden>
  • Date: Thu, 18 Aug 2005 17:19:57 -0700

There are really 2 possible places where you can have audio skipping.

(1) The I/O thread overloads
- aside from the obvious "trying to do too much", the main reason we've seen this miss is
(1) code unwittingly taking (or having on its behalf) locks that aren't available, so you wait, and wait, and...
(2) we have seen other problems where different parts of the OS or drivers do "weird things", and cause pre-emptions of the I/O thread


It should be understood, if it isn't already, that the audio I/O threads are basically the highest level priority threads on the system. So, for them to "miss" is a (or should be) an exceptional circumstance.

The only real way we've been able to debug these kinds of problems in the past is to enable kernel tracing when an I/O Overload occurs. We tend to do this more often than you would think = so for Tiger we added the facility to do tracing into HAL Lab (you have to run HAL Lab as root). A trace in HAL Lab can be taken on a number of circumstances - not just an overload, but also when you have a temporary spike of time spent in the I/O thread (for instance, lets say you are normally using 10% of the I/O thread, but every now and then for some reason, you measure a 50% load)

We would really and strongly encourage developers to both understand their code, and the expected behaviour they want from it, in order to be able to take these traces and hunt down these exceptional conditions. We are more than willing to help wade through kernel traces - its fun! really! :-)

(2) Producer short-falls
This is a little more difficult to diagnose, because there isn't the one-size-fits-all approach, and there aren't known places where you can say - if this happens take a trace. Because, really what you want to be able to do, is when an app (or framework) does notice a shortfall (below low-water mark, etc) you want to say (just like the overload described above) - take a trace here, find out what's holding me up.


So, really, at least for the moment, the only way to resolve these issues is to have reasonably reproducible cases (whether this is iTunes, QT, etc) that are reported to us via bugreporter, and then we can investigate this further.

As an example = the scenario Dave that you describe below of opening a new movie and causing a playing movie to skip - file a bug! That is something we should look at. Does the same thing happen (playback skips) when you say launch an app - if so, which app? have you launched it recently, or is it a "cold launch"?, etc. The more information you can provide us the better.

One of the tools we provided (with source) in our SDK for quite some time now is an app called "Million Monkees" This app is designed to simulate the CPU sides of these situations (not disk I/O problems), where you have a producer thread, a consistent work load, the ability to take traces when "normal conditions" are violated. I think this is a great app that can be used to both simulate the behaviour of your app, and to take traces. And of course, because the code is there - you could even use that to add this kind of code into your own development builds to trace those situations that cause problems. (For instance, I have this kind of code in the dev builds for AU Lab)

Thanks

Bill


-- mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________ __
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________ __


_______________________________________________
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: 
 >Re: iTunes stuttering (From: Dave Addey <email@hidden>)
 >Re: iTunes stuttering (From: Greg Chapman <email@hidden>)

  • Prev by Date: Re: iTunes stuttering
  • Next by Date: Re: Restarting MIDIServer?
  • Previous by thread: Re: iTunes stuttering
  • Next by thread: Restarting MIDIServer?
  • Index(es):
    • Date
    • Thread