Iām getting an overrun error at this point and not an underflow. I am also measuring 24MHz on MCLK regardless of what I specify.
These clocks are defined within the default am335x-boneblack.dtb. I pay special attention to the clk_mcasp0 as it specified the gpio-gate-clock which uses external oscillator, Y4, on the BBB to generate that signal. Iāve attempted modifying the clock-frequency value but it does not have an effect, I still see 24MHz on the output.
`
clk_mcasp0_fixed {
#clock-cells = <0x0>;
compatible = āfixed-clockā;
clock-frequency = <0x1770000>;
linux,phandle = <0x51>;
phandle = <0x51>;
};
clk_mcasp0 {
#clock-cells = <0x0>;
compatible = āgpio-gate-clockā;
clocks = <0x51>;
enable-gpios = <0x48 0x1b 0x0>;
linux,phandle = <0x54>;
phandle = <0x54>;
};
`
Also Iāve specified the clock within the simple-card binding as follows:
`
sound_master:simple-audio-card,codec {
sound-dai = <&tlv320aic3104_aq1>;
clocks = <0x54>;
/* system-clock-frequency = <12000000>; */
};
`
This allows me to use the defined clock, referenced by its phandle, for my codec. In this configuration it is the codec that is doing the clock generation as it is defined as the master. In my case, it is generating a BCLK and a WCLK but at a much higher frequency that what is expected, i.e, I issue an arecord test.wav, I should see BCLK at 8KHz but it is instead at 16KHz. Or is that what I should expect for BCLK considering Nyquist Theorem, etc, need to sample at twice the desired frequency? On second thought, this entire thing is configured for TDM and I am not very familiar with what I should be seeing vs. what I am seeing.
Iād also like to add that I am seeing data on both AIN and AOUT but its coming in much faster than weād expect hence the:
root@beaglebone:~# arecord test.wav
Recording WAVE ātest.wavā : Unsigned 8 bit, Rate 8000 Hz, Mono
overrun!!! (at least 0.109 ms long)
overrun!!! (at least 0.064 ms long)
overrun!!! (at least 0.754 ms long)
or the
root@beaglebone:~# speaker-test
speaker-test 1.0.28
Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 256 to 32768
Period size range from 128 to 16384
Using max buffer size 32768
Periods = 4
was set period_size = 8192
was set buffer_size = 32768
0 - Front Left
Write error: -32,Broken pipe
Write error: -32,Broken pipe
Write error: -32,Broken pipe
Time per period = 0.101305
0 - Front Left
Write error: -32,Broken pipe
Write error: -32,Broken pipe
Time per period = 0.054033
Not sure what to make of the Broken Pipe but there you have it.