|
Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Definition at line 41 of file audio_budget.hpp.
#include <audio_budget.hpp>
Public Member Functions | |
| void | init (uint32_t sample_rate, uint16_t block_size) |
| void | on_block_start () |
| Mark the start of audio processing (call first in callback) | |
| void | on_block_end () |
| Mark the end of audio processing (call last in callback) | |
| float | avg_load () const |
| Average load as fraction [0.0, 1.0+]. | |
| float | peak_load () const |
| Peak (worst-case) load since last reset. | |
| float | min_load () const |
| Minimum load since last reset. | |
| uint32_t | avg_ticks () const |
| Raw tick counts. | |
| uint32_t | peak_ticks () const |
| uint32_t | min_ticks () const |
| uint32_t | budget_ticks () const |
| uint32_t | overruns () const |
| Number of callbacks that exceeded the tick budget. | |
| uint32_t | count () const |
| Total callbacks measured. | |
| uint32_t | hist_bucket (size_t i) const |
| Read histogram bucket count (0-indexed, last bucket is >100%) | |
| void | reset () |
| Reset statistics (budget preserved) | |
Static Public Member Functions | |
| static constexpr size_t | hist_size () |
| Number of histogram buckets. | |
|
inline |
Configure budget from audio parameters. budget_ticks = (tick_rate() / sample_rate) * block_size
Definition at line 47 of file audio_budget.hpp.
References reset(), and sbl::diagnostics::tick_rate().
|
inline |
Mark the start of audio processing (call first in callback)
Definition at line 57 of file audio_budget.hpp.
References sbl::diagnostics::ticks().
|
inline |
Mark the end of audio processing (call last in callback)
Definition at line 64 of file audio_budget.hpp.
References sbl::diagnostics::ticks().
|
inline |
Average load as fraction [0.0, 1.0+].
Definition at line 87 of file audio_budget.hpp.
Referenced by sbl::diagnostics::format_report(), and sbl::diagnostics::format_tagged_report().
|
inline |
Peak (worst-case) load since last reset.
Definition at line 96 of file audio_budget.hpp.
Referenced by sbl::diagnostics::format_report(), and sbl::diagnostics::format_tagged_report().
|
inline |
Minimum load since last reset.
Definition at line 105 of file audio_budget.hpp.
Referenced by sbl::diagnostics::format_tagged_report().
|
inline |
Raw tick counts.
Definition at line 114 of file audio_budget.hpp.
|
inline |
Definition at line 122 of file audio_budget.hpp.
|
inline |
Definition at line 130 of file audio_budget.hpp.
|
inline |
Definition at line 138 of file audio_budget.hpp.
|
inline |
Number of callbacks that exceeded the tick budget.
Definition at line 147 of file audio_budget.hpp.
Referenced by sbl::diagnostics::format_report(), and sbl::diagnostics::format_tagged_report().
|
inline |
Total callbacks measured.
Definition at line 156 of file audio_budget.hpp.
Referenced by sbl::diagnostics::format_tagged_report().
|
inlinestaticconstexpr |
Number of histogram buckets.
Definition at line 167 of file audio_budget.hpp.
Referenced by sbl::diagnostics::format_tagged_histogram().
|
inline |
Read histogram bucket count (0-indexed, last bucket is >100%)
Definition at line 170 of file audio_budget.hpp.
Referenced by sbl::diagnostics::format_tagged_histogram().
|
inline |
Reset statistics (budget preserved)
Definition at line 179 of file audio_budget.hpp.
Referenced by init().