Re: Difference in behavior between 10.5 and 10.6 in Logic
Re: Difference in behavior between 10.5 and 10.6 in Logic
- Subject: Re: Difference in behavior between 10.5 and 10.6 in Logic
- From: Jeff Moore <email@hidden>
- Date: Sat, 19 Dec 2009 11:11:34 -0800
If the problem happens in Logic but not in HALLab, the implication is that there is something particular to what is going on in Logic that is causing the issue. I don't know what an "I/O plug" is, how it makes the measurements you are describing or how hit interacts with Logic, so I can't really offer any specific advice given the information at hand.
That said, the main change to the HAL in 10.6 that has caused the most mischief for apps was the change to the handling of the HAL's notification thread. Prior to 10.6, the HAL spawned it's own thread for this job by default. In 10.6, the HAL was changed to use a process's main thread for the job. The net effect is that if the main thread gets busy or it's run loop doesn't get tasked at all (which is the case in a lot of command line tools), the HAL won't be able to receive notifications from the driver in a timely way.
Your description of the issue sounds like it might fall into this category. But it's hard to say for sure as Logic lacks the other, more visible problems I have seen in apps that have been adversely affected by this change. For example, an app that has been hit badly by this change will have something like a sample rate change either take a really long time to complete or just cause the app to completely hang depending on how the app handles things.
At any rate, filing a bug is always a good first step in any case.
On Dec 18, 2009, at 11:11 PM, B.J.Buchalter wrote:
> I am seeing an odd difference in behavior between 10.5 and 10.6 in Logic with respect to my driver and I am wondering if there is anything I can do in our driver to work around this behavior in 10.6, or if this is simply a bug in 10.6 that needs fixing. It definitely is occurring in 10.6.2 with Logic 9.
>
> I have examined the open source code for IOAudioFamily for both 10.5.8 and 10.6.2 and I don't see any changes that could could cause the issue. I am wondering if it is possible that it is in the HAL (not in open source).
>
> So here is the problem:
>
> When the Sample Rate of the driver is changed, the reported latencies are also changed. This happens in my IOAudioEngine::performFormatChange method. Pseudo code is:
>
> if (changeSampleRate) {
> beginConfigurationChange();
> SetHardwareSampleRate(newSampleRate);
> setSampleOffset(newSampleOffset);
> setInputSampleLatency(newInputLatency);
> setOutputSampleLatency(newOutputLatency);
> completeConfigurationChange();
> }
>
> In my case, both the SampleOffset and the OutputLatency are changing. In the sequence below, both of those changes appear to be ignored in step #3.
>
> I have a Logic 9 session with my device as the audio device; the session has an I/O plug inserted and I have the audio looped back.
>
> My test is as follows:
>
> 1) With the sample rate at 96k, I ping the latency using the I/O plug and I get back the expected result.
> 2) I switch the sample rate of the session via Project Settings:Audio:Sample Rate to 192k
> 3) I click ping in the I/O plug, and the reported latency in the I/O shifts by the change in the latency reported by the driver (e.g. the change in reported latency is being ignored by Logic/HAL and not compensated)
> 4) I hit play in Logic and then hit stop.
> 5) I click ping in the I/O plug, and the reported latency goes back the expected result (now Logic/HAL has picked up the change in latency reported by the driver).
>
> If I do the same sequence of steps on 10.5, in step #3, the reported latency is correct (e.g. Logic/HAL has picks up the change in latency reported by the driver). So this is definitely an regression from 10.5 to 10.6. It almost seems like the HAL is not noticing the change in those properties and is not sending out a notification to the CA clients.
>
> If I point HAL Lab at the device while I am doing the steps above, the changes in the latency are immediately reported under 10.5. They are also immediately reported in 10.6, so maybe it is not that they are not being reported, but perhaps the timing of the reporting has changed in such a way that Logic is not capturing the change under 10.6.
>
> In reality, this issue is simply annoying -- once the user has hit play, it all works properly. But the problem is that if the user switches between projects at different sample rate and then pings an I/O plug to compensate for an external process loop, then the latency will be wrong and it is possible for the user to get (very) confused.
>
> Any suggestions about how to resolve this would be appreciated, even if the answer is to file a Radar.
--
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