diff options
-rw-r--r-- | projdoc.cls | 3 | ||||
-rw-r--r-- | reqs.toml | 16 | ||||
-rw-r--r-- | research.tex | 79 | ||||
-rwxr-xr-x | scripts/reqs2tex.py | 2 | ||||
-rw-r--r-- | sources.bib | 44 |
5 files changed, 121 insertions, 23 deletions
diff --git a/projdoc.cls b/projdoc.cls index ee94835..16b1790 100644 --- a/projdoc.cls +++ b/projdoc.cls @@ -397,3 +397,6 @@ } \makeatother +% missing reference marker +\def\mref{\textsuperscript{\textit{\,ref?}}} + @@ -62,7 +62,9 @@ The public audio \gls{api} allows the game programmer to control the volume of audio samples. ''' -[aux:license] +# TODO: audio encoding support? + +[lib:license] type = 'system' priority = 'must' description = ''' @@ -70,3 +72,15 @@ External libraries must have a license that is MIT-compatible, or one that allows linking against MIT code. ''' +[lib:platform] +type = 'system' +priority = 'must' +description = ''' +External libraries must have cross-platform support for at least Linux and +Windows. +''' + +# TODO: library popularity as quality factor? +# TODO: library documentation as quality factor? +# TODO: modularity over less libraries? (i.e. why don't we just SDL2 everything?) + diff --git a/research.tex b/research.tex index 5340bf5..f3424c4 100644 --- a/research.tex +++ b/research.tex @@ -240,46 +240,83 @@ for audio some options could be: FMOD, Wwise, or iirKlang \subsection{Conclusion} -% TODO: this entire section \section{Audio} -% should audio research be scoped down to SDL2 (if that's what we're going with) or -% standalone libraries only (for modularity?). +The game engine is required to have an audio system +\autocite[\ref{req:audio}]{crepe:requirements}. Since writing a custom real-time +audio mixing engine is outside the scope of this project\mref, this section compares +various standalone audio libraries for suitability in the engine. + +\Cref{sec:audio:libs} details which libraries were considered, +\cref{sec:audio:benchmark} compares their performance, and +\cref{sec:audio:conclusion} concludes with a recommendation for most performant audio +library. -The game engine is required to have an audio system with support for playing multiple -audio streams (i.e.~tracks or samples) simultaniously. Since writing a custom live -audio mixing engine is outside the scope of this project, this section compares -various standalone audio engines that could be used in the engine. +\subsection{Libraries} +\label{sec:audio:libs} -% TODO: requirements first! +\Cref{tab:audio:libs} lists the standalone audio engine libraries that fit +\cref{req:audio,req:lib:license}. -% REQ ~ is cross-platform -% REQ ~ supports multiple audio formats (TODO: which) -% REQ ~ supports simultanious playback / mixing -% REQ ~ has an open-source license \begin{table} \centering \begin{tabular}{llc} \toprule \textbf{Library} & \textbf{License} & \textbf{API}\\ \midrule - miniaudio & MIT-0 & C\\ - YSE & EPL & C++\\ - SoLoud & Zlip/LibPng & C++\\ + miniaudio \autocite{lib:miniaudio} & MIT-0 & C\\ + YSE \autocite{lib:yse} & EPL & C++\\ + SoLoud \autocite{lib:soloud} & Zlip/LibPng & C++\\ \bottomrule \end{tabular} \caption{Audio engine library comparison} - \label{tab:audio-engines} + \label{tab:audio:libs} \end{table} -% TODO: ref https://miniaud.io/ -% TODO: ref https://www.attr-x.net/yse/ -Not considered further: +Other popular libraries that were researched but are unsuitable for this project +include:\noparbreak \begin{description} - \item[FMOD] is proprietary - \item[PortAudio] requires manual mixing + \item[FMOD \autocite{lib:fmod}] Is proprietary (violates \cref{req:lib:license}) + \item[PortAudio \autocite{lib:portaudio}] Does not handle mixing \end{description} +\subsection{Benchmarks} +\label{sec:audio:benchmark} + +The same benchmark application was written for each of the libraries listed in +\cref{tab:audio:libs}. The application does the following:\noparbreak +\begin{enumerate} + \item Load a background track (Ogg Vorbis) + \item Load three short samples (WAV) + \item Start the background track + \item Play each sample sequentially while pausing and resuming the background track + \item Play all samples simultaniously + \item Stop all audio and exit +\end{enumerate} + +Each benchmark was profiled using \emph{perf} \autocite{tool:perf} and compared based +on total CPU and memory utilization. The results of these benchmarks are listed in +\cref{tab:audio:benchmark}. + +\begin{table} + \centering + \begin{tabular}{lr} + \toprule + \textbf{Library} & \textbf{???}\\ + \midrule + miniaudio &\\ + YSE &\\ + SoLoud &\\ + \bottomrule + \end{tabular} + \caption{Audio engine library benchmark results} + \label{tab:audio:benchmark} +\end{table} + +\subsection{Conclusion} +\label{sec:audio:conclusion} + + \section{Physics} \subsection{Introduction} diff --git a/scripts/reqs2tex.py b/scripts/reqs2tex.py index 1863b0d..0a43acf 100755 --- a/scripts/reqs2tex.py +++ b/scripts/reqs2tex.py @@ -73,7 +73,7 @@ def convert(reqs): reqs = [item for item in reqs if item[KEY.DELETED] == False] # sort by label - reqs = sorted(reqs, key=lambda req: req[KEY.LABEL]) + reqs = sorted(reqs, key=lambda item: item[KEY.LABEL]) return reqs diff --git a/sources.bib b/sources.bib index bf04165..bb68067 100644 --- a/sources.bib +++ b/sources.bib @@ -47,6 +47,50 @@ date = {2024-09-10}, } +@report{crepe:requirements, + author = {Loek Le Blansch and Wouter Boerenkamps and Jaro Rutjes and Max Smits and Niels Stunnebrink}, + title = {Requirements}, + date = {2024-09-18}, +} + +@online{lib:miniaudio, + title = {miniaudio - A single file audio playback and capture library.}, + % author = {David Reid}, + url = {https://miniaud.io}, + urldate = {2024-09-18}, +} + +@online{lib:yse, + title = {YSE - cross-platform sound engine}, + url = {https://www.attr-x.net/yse}, + urldate = {2024-09-18}, +} + +@online{lib:soloud, + title = {SoLoud}, + % author = {Jari Komppa}, + url = {https://solhsa.com/soloud}, + urldate = {2024-09-18}, +} + +@online{lib:fmod, + title = {FMOD}, + url = {https://www.fmod.com}, + urldate = {2024-09-18}, +} + +@online{lib:portaudio, + title = {PortAudio - an Open-Source Cross-Platform Audio API}, + url = {https://www.portaudio.com}, + urldate = {2024-09-18}, +} + +@online{tool:perf, + title = {\texttt{perf:} Linux profiling with performance counters}, + url = {https://perf.wiki.kernel.org/index.php/Main_Page}, + urldate = {2024-09-18}, +} + @misc{github:awesome-ecs, author = {Sangjun Lee}, title = {Awesome Entity Component System}, |