Fix test criteria to fix paqa_latency.c - #1111
Conversation
|
After discussion with Ross, the plan is to:
|
deb402c to
fbecb61
Compare
I added that test. But we are seeing failures where the latency hits the maximum and then keeps going up! also |
|
NEXT STEP: confirm that rounding error is the problem. investigate source of rounding error. consider revising the spec I think that the test is valid with respect to the current spec. I think the failing tests reflect a bug in the code in the sense that the test results indicate a violation of the current spec for Lines 570 to 580 in 5d01510 I suspect the issue is that there is rounding down when the spec says to always round up. This could easily be a bug in PA/CoreAudio. It would be good to know whether the test also fails with other host APIs. We are undecided whether rounding down within some epsilon should be in specification . It would be user friendly to allow for +/- half (or 1/4 or 0.1) sample period of slop to allow for incorrect rounding in floating point calculations. I definitely think that the actual latency should be reported as accurately as possible, so the code should not "pretend" to have honoured the suggested latency when it actually rounded down, even a little bit. |
|
Suggestions for improving the test:
|
|
Print the delta value between final and suggested latency with scientific notation. |
RossBencina
left a comment
There was a problem hiding this comment.
Phil and I agreed to merge this as a failing test once the following two improvements are made:
- Print in seconds (next to sample rate) 1/sampleRate
- Print suggested, final delta
Just expect monotonic increases, and not much higher latency than suggested. Fixes #742
|
I made the suggested changes. Now I get this: See attachment for the full log: qa_latency_PR1111_20160716.txt |
|
TODO Could add a test for more serious failures, "smoke". Call this monotonic test paqa_latency_monotonic.c Suggest 0.0, get >= defaultMinLatency. |
|
I think test could be merged now, but I agree that making the output easier to interpret would be helpful. We also discussed splitting out a smoke test:
|
This allows the rest of paqa_latency.c to pass.
|
I pulled out the monotonic test that was failing. |
RossBencina
left a comment
There was a problem hiding this comment.
Looks good. I've made some suggestions to improve readability.
RossBencina
left a comment
There was a problem hiding this comment.
Approved modulo two comments and also, please add to qa/CMakeLists.txt
| if( err != paNoError ) goto error; | ||
|
|
||
| err = Pa_CloseStream( stream ); | ||
| Pa_Sleep( 1 * 1000 ); | ||
|
|
||
|
|
||
| printf("-------------------------------------\n"); | ||
| printf("-------------------------------------\n\n"); | ||
| return err; |
There was a problem hiding this comment.
This code is identical to the error path. Consider whether to remove lines 180-186 and fall through to label error:.
| printf(" detectedMaximumLatency = %8.6f\n", detectedMaximumLatency ); | ||
| } | ||
| } | ||
| /* If we are not at maximum then we should be rounding up. */ |
There was a problem hiding this comment.
The comment is not well worded and is redundant with existing comments below. Suggest:
| /* If we are not at maximum then we should be rounding up. */ | |
| /* Now check that reported latency behaves correctly: */ |
It was failing because the latency was too low.
Now we allow lower latency.
Fixes #742