BBB - Audio D2A with McASP (I2S) very 'scratchy' - help?


I am trying to interface a D2A (Ti PCM3070) to a BBB, over I2S.

Annoyingly - it very nearly works - but the audio that results is “scratchy”. I can’t quite tell why this is the case (or what exactly the mode of failure is) or what I need to do next.

Basically it’s interfaced in the same way the HDMI chip is for audio, and has a secondary I2C connection for configuring the chip. After boot, I can fire in the various required register settings into the chip with i2cset, and then just ffplay and - success - audio coming out. But not quite right audio. Very nearly there audio. It sounds a bit like it’s clipped (but adjusting that makes no difference), or a signed/unsigned issue, but it’s really hard to tell.

At first I suspected the output was down to the MCLK not being right in my initial tests (the 3070 assumes a different MCLK by default), but after setting the dividers in the PCM3070 it made no particular difference. I’m also trying to send 48kHz/24-bit audio (I do not need particular flexibility for my application) as per the MCLK, but that made no difference either. In fact it rather sounds the same even if I send 44.1kHz files.

I have read reference to MCLK perhaps being the ‘wrong phase’. I’m also digging into and the kernel sources for McASP on the BBB - but I’m keen to avoid having to do custom kernel builds et al unless it’s strictly necessary.