[alsa-devel] [PATCH 1/4] ASoC: pxa-ssp: enhance I2S and add Left_J support

Eric Miao eric.y.miao at gmail.com
Tue Jun 9 11:39:18 CEST 2009

2009/6/9 Daniel Ribeiro <drwyrm at gmail.com>:
> Em Seg, 2009-06-08 às 19:06 +0100, Mark Brown escreveu:
>> Think about TDM mode for a minute here - there a separate configuration
>> for the sample size on the wire opens the way to using a lower sample
>> size in a given timeslot than the timeslot supports, reducing the need
>> for the CPU to rewrite data.  Or to put it another way, I can't see TDM
>> mode working unless the sample size is constrained to always be exactly
>> that desired so it seems sensible to have a standard way of doing that.
> Hum... Now I understood this. If i want to use network mode with 2
> different codecs, and they differ on the expected frame_size i have to
> use the smaller frame_size for both codecs.
> And indeed, in this case the best place to setup the frame size would be
> on set_tdm_slot().
>> I'd rather come up with a cleaner way of configuring the magician case
>> that's explicit about what it's trying to achieve.  It doesn't need to
>> be in user space, though.
> I dont know how to do this other than just changing the frame size... :)

OK, not having enough time to read all this thread, let's make sure
first we are on the same floor:

frame_width  = number of bit clocks per frame
sample_width = number of bits per sample

And the assumption that

frame_width = sample_width * channel ( = LRCLK for I2S )

is no longer (and ever) correct.

E.g. the frame width could be 64fs, meaning a whole frame is consisting
of 64 bitclks - that's saying, sample width from 1 - 64 are possible,
For typical 16-bit sample width I2S format, the envelope for each sample
is 32 bitclks, and offseting by 1 bitclk starts the 16-bit sample.

And the TDM mode is actually special for PXA-SSP to emulate the I2S
protocol, it's no way generic TDM in a common sense. So talking about
set_tdm_slots(), I'd really like to hide into the format setting code
of I2S/Left_J to avoid further confusion.

And I still didn't quite capture the issue of magician. Phillip, do
you have any HW reference to the audio codec and the connection on

More information about the Alsa-devel mailing list