[alsa-devel] Question: PCM short and long sync formats
I was looking for PCM short frame sync and PCM long frame sync, but they are not present in soc-dai.h (FORMAT_MASK). Is there a way to derive them from other formats or should I just add them?
On Wed, Mar 21, 2012 at 03:51:36PM +0530, Omair Mohammed Abdullah wrote:
I was looking for PCM short frame sync and PCM long frame sync, but they are not present in soc-dai.h (FORMAT_MASK). Is there a way to derive them from other formats or should I just add them?
What do you mean when you say "PCM short frame sync" and "PCM long frame sync"?
On Wednesday 21 March 2012 05:21 PM, Mark Brown wrote:
On Wed, Mar 21, 2012 at 03:51:36PM +0530, Omair Mohammed Abdullah wrote:
I was looking for PCM short frame sync and PCM long frame sync, but they are not present in soc-dai.h (FORMAT_MASK). Is there a way to derive them from other formats or should I just add them?
What do you mean when you say "PCM short frame sync" and "PCM long frame sync"?
Sorry for the late reply, I was away.
What I mean by short/long frame sync is: the frame sync lasts for 1 bit/1 word wide.
Eg.: For short frame sync, we get a frame sync signal for 1 clock before the first bit on the RX/TX.
It is different from I2S mode where the frame sync is inverted and the transition starts 1 clock before the bits and lasts till bit 1.
On Mon, Mar 26, 2012 at 02:36:53PM +0530, Omair Mohammed Abdullah wrote:
On Wednesday 21 March 2012 05:21 PM, Mark Brown wrote:
What do you mean when you say "PCM short frame sync" and "PCM long frame sync"?
Sorry for the late reply, I was away.
What I mean by short/long frame sync is: the frame sync lasts for 1 bit/1 word wide.
Eg.: For short frame sync, we get a frame sync signal for 1 clock before the first bit on the RX/TX.
It is different from I2S mode where the frame sync is inverted and the transition starts 1 clock before the bits and lasts till bit 1.
I'm sorry but I still have no idea what you're talking about. You've described PCM mode but not explained what "short frame sync" and "long frame sync" mode are.
On Monday 26 March 2012 03:56 PM, Mark Brown wrote:
On Mon, Mar 26, 2012 at 02:36:53PM +0530, Omair Mohammed Abdullah wrote:
On Wednesday 21 March 2012 05:21 PM, Mark Brown wrote:
What do you mean when you say "PCM short frame sync" and "PCM long frame sync"?
Sorry for the late reply, I was away.
What I mean by short/long frame sync is: the frame sync lasts for 1 bit/1 word wide.
Eg.: For short frame sync, we get a frame sync signal for 1 clock before the first bit on the RX/TX.
It is different from I2S mode where the frame sync is inverted and the transition starts 1 clock before the bits and lasts till bit 1.
I'm sorry but I still have no idea what you're talking about. You've described PCM mode but not explained what "short frame sync" and "long frame sync" mode are.
This diagram may explain things better: http://picpaste.com/pcm_fs-7dBlrkuW.png
On Mon, Mar 26, 2012 at 05:37:15PM +0530, Omair Mohammed Abdullah wrote:
On Monday 26 March 2012 03:56 PM, Mark Brown wrote:
I'm sorry but I still have no idea what you're talking about. You've described PCM mode but not explained what "short frame sync" and "long frame sync" mode are.
This diagram may explain things better: http://picpaste.com/pcm_fs-7dBlrkuW.png
Sorry, that's not really clarifying things. It looks like "long frame sync" is just I2S but presumably there's some difference?
On Monday 26 March 2012 05:38 PM, Mark Brown wrote:
On Mon, Mar 26, 2012 at 05:37:15PM +0530, Omair Mohammed Abdullah wrote:
On Monday 26 March 2012 03:56 PM, Mark Brown wrote:
I'm sorry but I still have no idea what you're talking about. You've described PCM mode but not explained what "short frame sync" and "long frame sync" mode are.
This diagram may explain things better: http://picpaste.com/pcm_fs-7dBlrkuW.png
Sorry, that's not really clarifying things. It looks like "long frame sync" is just I2S but presumably there's some difference?
Yes, in I2S mode, according to the spec I have, the frame sync leads the MSB of the data by 1 bit clock cycle. Whereas the 'long frame sync' mode starts with the MSB of the data.
On Mon, Mar 26, 2012 at 06:59:43PM +0530, Omair Mohammed Abdullah wrote:
On Monday 26 March 2012 05:38 PM, Mark Brown wrote:
Sorry, that's not really clarifying things. It looks like "long frame sync" is just I2S but presumably there's some difference?
Yes, in I2S mode, according to the spec I have, the frame sync leads the MSB of the data by 1 bit clock cycle. Whereas the 'long frame sync' mode starts with the MSB of the data.
This is probably left justified mode but I'm really not clear what your question is here. Please ask a *specific* question, with reference to what you find unclear in the code.
The PCM short frame sync sends a short (1 clock length) sync signal before the MSB of data. The PCM long frame sync sends a 1 word length sync signal along with the data.
Signed-off-by: Omair Mohammed Abdullah omair.m.abdullah@linux.intel.com --- include/sound/soc-dai.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index c429f24..dc94b25 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -32,6 +32,8 @@ struct snd_soc_dapm_widget; #define SND_SOC_DAIFMT_DSP_B 5 /* L data MSB during FRM LRC */ #define SND_SOC_DAIFMT_AC97 6 /* AC97 */ #define SND_SOC_DAIFMT_PDM 7 /* Pulse density modulation */ +#define SND_SOC_DAIFMT_SHORT_SYNC 8 /* FRM for 1 clock before MSB */ +#define SND_SOC_DAIFMT_LONG_SYNC 9 /* FRM for 1 word starting with MSB */
/* left and right justified also known as MSB and LSB respectively */ #define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J
On Tuesday 27 March 2012 09:02 AM, Omair Mohammed Abdullah wrote:
The PCM short frame sync sends a short (1 clock length) sync signal before the MSB of data. The PCM long frame sync sends a 1 word length sync signal along with the data.
Signed-off-by: Omair Mohammed Abdullahomair.m.abdullah@linux.intel.com
include/sound/soc-dai.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index c429f24..dc94b25 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -32,6 +32,8 @@ struct snd_soc_dapm_widget; #define SND_SOC_DAIFMT_DSP_B 5 /* L data MSB during FRM LRC */ #define SND_SOC_DAIFMT_AC97 6 /* AC97 */ #define SND_SOC_DAIFMT_PDM 7 /* Pulse density modulation */ +#define SND_SOC_DAIFMT_SHORT_SYNC 8 /* FRM for 1 clock before MSB */ +#define SND_SOC_DAIFMT_LONG_SYNC 9 /* FRM for 1 word starting with MSB */
/* left and right justified also known as MSB and LSB respectively */ #define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J
What I am looking for is something like this. But SND_SOC_DAIFMT_SHORT_SYNC might be the same as SND_SOC_DAIFMT_DSP_A.
On 03/27/2012 05:34 AM, Omair Mohammed Abdullah wrote:
On Tuesday 27 March 2012 09:02 AM, Omair Mohammed Abdullah wrote:
The PCM short frame sync sends a short (1 clock length) sync signal before the MSB of data. The PCM long frame sync sends a 1 word length sync signal along with the data.
Signed-off-by: Omair Mohammed Abdullahomair.m.abdullah@linux.intel.com
include/sound/soc-dai.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index c429f24..dc94b25 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -32,6 +32,8 @@ struct snd_soc_dapm_widget; #define SND_SOC_DAIFMT_DSP_B 5 /* L data MSB during FRM LRC */ #define SND_SOC_DAIFMT_AC97 6 /* AC97 */ #define SND_SOC_DAIFMT_PDM 7 /* Pulse density modulation */ +#define SND_SOC_DAIFMT_SHORT_SYNC 8 /* FRM for 1 clock before MSB */ +#define SND_SOC_DAIFMT_LONG_SYNC 9 /* FRM for 1 word starting with MSB */
/* left and right justified also known as MSB and LSB respectively */ #define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J
What I am looking for is something like this. But SND_SOC_DAIFMT_SHORT_SYNC might be the same as SND_SOC_DAIFMT_DSP_A.
Yes it is. And if you really only have two slots your long sync is SND_SOC_DAIFMT_LEFT_J, but with the bit clock inverted.
participants (3)
-
Lars-Peter Clausen
-
Mark Brown
-
Omair Mohammed Abdullah