-
Notifications
You must be signed in to change notification settings - Fork 616
Add audio performance to AdpfWrapper #2330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| bool adpfEnabled, | ||
| bool adpfWorkloadIncreaseEnabled, | ||
| bool hearWorkload) { | ||
| int32_t targetDurationMs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why all indents are changed? should be 8 spaces instead of 4.
| std::shared_ptr<oboe::AudioStream> oboeStream = engine.getCurrentActivity()->getStream(streamIndex); | ||
| if (oboeStream != nullptr) { | ||
| oboe::PerformanceHintConfig cfg; | ||
| cfg.highPerformanceAudio = (highPerformance == JNI_TRUE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it is needed to compare to JNI_TRUE?
| mNumVoicesSlider.getValue(), mAlternateNumVoicesSlider.getValue(), | ||
| mAlternatingPeriodMsSlider.getValue(), mEnableAdpfBox.isChecked(), | ||
| mEnableAdpfWorkloadIncreaseBox.isChecked(), mHearWorkloadBox.isChecked(), | ||
| mHighPerformanceAudioBox.isChecked(), reportActualDurationEnabled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If adpf box is not checked, is reporting duration still needed?
| // If the platform does not support the high-performance-audio APERF feature, | ||
| // hide or disable the UI control so users don't attempt to enable it. | ||
| boolean hpSupported = NativeEngine.isHighPerformanceAudioSupported(); | ||
| if (!hpSupported && mHighPerformanceAudioBox != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: when will mHighPerformanceAudioBox be null?
| android:layout_height="wrap_content" | ||
| android:layout_marginRight="8sp" | ||
| android:text="Hear Workload" /> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe there are some common part of the UI can be extracted to a common class.
| --ez use_workload {true, false} // if true and using ADPF then report workload changes. Default is false. | ||
| --ez scroll_graphics {true, false} // if true then continually update the power scope. Default is false. | ||
| --ez use_workload_increase_api {true, false} // if true and using ADPF, notify adpf with workload increase/reset apis. Default is false. | ||
| --ez use_high_performance_audio {true, false} // if true, request highPerformanceAudio in the performance hint session creation config. Default is false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: do you also want the option for reporting duration?
| --ez use_workload {true, false} // if true and using ADPF then report workload changes. Default is false. | ||
| --ez scroll_graphics {true, false} // if true then continually update the power scope. Default is false. | ||
| --ez use_workload_increase_api {true, false} // if true and using ADPF, notify adpf with workload increase/reset apis. Default is false. | ||
| --ez use_high_performance_audio {true, false} // if true, request highPerformanceAudio in the performance hint session creation config. Default is false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the implementation of use_high_performance_audio, I cannot find it from the code.
| } | ||
|
|
||
| void setReportActualDurationEnabled(bool enabled) override { | ||
| // Public API expects 'enabled'; internally we manage a 'disabled' flag. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the benefit of managing disable flag internally? This looks easily cause issue in the future because of inconsistency.
When using Oboe, apps can now see if the power HAL supports a special audio performance mode with ADPF and use it.