[Raspbian-devel] Possible I2S master/slave bug in RPi3.

Stuart MacLean stuart at hifiberry.com
Wed Mar 2 23:58:21 UTC 2016


Hi

I am currently investigating a number of issues within our sound drivers 
concerning the playback of sound via our HiFiBerry Digi+ and DAC-Pro. 
After a series of initial investigations we think there might be some 
conflict on the I2S bus line between the bcm2708_i2s and the (pcm512x 
and hifiberry_dacplus) modules.

Both the Digi+ and DAC-Pro modules set the

dai->dai_fmt = SND_SOC_DAIFMT_CBM_CFM |SND_SOC_DAIFMT_I2S | 
SND_SOC_DAIFMT_NB_NF;

With hifiberry_dacplus module it is initially configured to

dai->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | 
SND_SOC_DAIFMT_CBS_CFS;

This is done so the PCM512x on the DAC+ acts as an I2S slave. On the 
start in snd_rpi_hifiberry_dacplus_init it detects that wither or not a 
given board is a DAC-Pro and thus changes the dai_fmt to master 
(SND_SOC_DAIFMT_CBM_CFM).

Also the same hifiberry_dacplus module works with the DAC+ sound card 
where it is the I2S slave.

The attached image shows the output from my logic analyser of the I2S 
bus where it shows errors in reading the samples due to incorrect bit 
number in a given sample. This is also analysis is also consistent with 
the what is actually heard during playback: i.e. Sometimes the sound can 
be heard with distortion, other times there is too much distortion to 
here any music.

My best guess, at this moment in time, is that a bug has been introduced 
in the bcm2708_i2s module or associated architecture somewhere between 
4.1.7 and 4.1.18+7 where-by when the dai_fmt flag is set to 
SND_SOC_DAIFMT_CBM_CFM then both the bcm2708 and associated the 
snd_soc_codec module both try to send an I2S clock signal. Where as, I 
would expect only the snd_soc_codec DSP to configure to setup the I2S 
clock signal.

I'm currently expanding my investigation of this issue to cover the 4.4 
kernel branch.

Let me know if you have ideas but how I can go about resolving this issue?

Cheers,

Stuart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2016-03-02_17-15-04.png
Type: image/png
Size: 51939 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/raspbian-devel/attachments/20160302/1cacaa44/attachment-0001.png>


More information about the Raspbian-devel mailing list