Hi,
on-board audio codec is capable of 96kHz/24bit.
The reason why the clock is 44.1kHz is because digital I/O and analog I/O are also clocked by the audio codec and these tasks take time to complete and if the audio sampling rate was higher there would not be enough time for them to run. If you were to disable analog and digital I/O you could probably easily get to 48kHz without further modifications.
The reason why the bit-depth in use is 16bit is because the noise floor on the board would make the additional 8bits pretty much useless. Also, operating on 16bit values simplifies the code and requires less memory (the PRU, which handles the I/O, has access to 12kB of RAM only), allowing larger blocksizes. Similarly, another good reason for 44.1kHz is that the """"upgrade"""" to 48kHz would probably go unnoticed given the noise floor and it would just require more computations.
All of this said, if you add this in render.cpp
#include <I2c_Codec.h>
extern I2c_Codec *gAudioCodec;
and then in the render()
function you add
static bool init = false;
if(init == false){
init = true;
gAudioCodec->setPllD(5277);
gAudioCodec->setPllP(7);
gAudioCodec->setAudioSamplingRate(48000);
printf("sampling rate: %f\n",gAudioCodec->getAudioSamplingRate());
}
there you should have your codec running at 48kHz.
To understand what this does, have a look at the comments in core/I2c_Codec.cpp
Note that this does not change the value returned by context->audioSamplingRate