[alsa-devel] [PATCH BAT V1 0/7] BAT: Add Basic Audio Tester command line tool

Caleb Crome caleb at crome.org
Fri Sep 18 00:40:33 CEST 2015


The more I think of this channel synchronization issue, the thorinier it gets.

Basically, with the TLV320AIC series of codecs, whenever any of the
DAC or ADC channels are powered up on any codec, the MCLK needs to be
stopped, all DACs/ADCs turned off, then configuration can happen, then
all DACs/ADCs can be turned back on, then MCLK starts again.  That's
the only way to ensure phase/delay accuracy among several codecs.

So, going from play-only to play+record requires MCLK be stopped, then
restarted.

Maybe it's not too terrible.  Any thoughts?

-Caleb



On Thu, Sep 17, 2015 at 11:50 AM, Caleb Crome <caleb at crome.org> wrote:
> On Thu, Sep 17, 2015 at 10:42 AM, Mark Brown <broonie at kernel.org> wrote:
>> On Thu, Sep 17, 2015 at 06:29:58AM -0700, Caleb Crome wrote:
>>
>>> > Yes, PM suspend and resume of device. We have some scripts (to be
>>> > upstreamed later) that would play audio, suspend the device, resume the
>>> > device and then retest the audio.
>>
>>> That seems particularly likely to result in multiple codecs getting
>>> out of phase alignment.  i.e. when restarting, you want to be sure to
>>> follow the same startup procedure as the first time to make sure all
>>> codecs are aligned.
>>
>> Why should resume be any different from initial system power up?
>
> Heh, perhaps only because I don't understand how it all works :-)
>
> The example I was thinking of is if the card gets partially powered
> down.  For example, start recording on 8 channels (4 codecs, called 0,
> 1, 2, 3 in this example).  At this point, all's well, and all 4 codecs
> are in perfect phase sync.
>
> Then switch to playing 2 channel mode with codec 0 only.  Since codecs
> 1, 2, 3 are no longer needed, then they could get powered down.
>
> Then, switch back to 8 channel mode -- codec 0 is up and running, and
> now you want to turn on codecs 1, 2, 3.  At this point it's literally
> impossible to resync them with codec 0 without powering down codec 0
> and starting from scratch.  This is true of the TLV320AIC seris of
> codecs.  The CS53L30 has a dedicated sync pin on the other hand, so
> could perhaps recover gracefully in this situation.
>
> -Caleb


More information about the Alsa-devel mailing list