Skip to contentSkip to conversation

Question: PCM short and long sync formats

PATCH In review Omair Mohammed Abdullah 3 participants 11 messages Mar 21, 2012 – Mar 27, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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?

#1 lore raw
Quoted 3 lines · Omair Mohammed Abdullah

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"?

#2 lore raw
Quoted 8 lines · Mark Brown
Quoted 3 lines · Omair Mohammed Abdullah

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.

#3 lore raw
Quoted 7 lines · Omair Mohammed Abdullah
Quoted 2 lines · Mark Brown

What do you mean when you say "PCM short frame sync" and "PCM long frame sync"?

Sorry for the late reply, I was away.

Quoted 8 lines

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.

#4 lore raw
Quoted 14 lines · Mark Brown
Quoted 12 lines · Omair Mohammed Abdullah
Quoted 2 lines · Mark Brown

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.

Quoted 6 lines
Quoted 2 lines

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

#5 lore raw
Quoted 8 lines · Omair Mohammed Abdullah
Quoted 3 lines · Mark Brown

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?

#6 lore raw
Quoted 7 lines · Mark Brown
Quoted 5 lines · Omair Mohammed Abdullah
Quoted 3 lines · Mark Brown

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.

Quoted 5 lines
Quoted 2 lines

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.

#7 lore raw
Quoted 8 lines · Omair Mohammed Abdullah
Quoted 2 lines · Mark Brown

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.

#8 lore raw

PATCH 1/1 ASoC: Added PCM short and long frame sync formats

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.

---
 include/sound/soc-dai.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
include/sound/soc-dai.h +2 -0
index c429f24..dc94b25 100644
@@ -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
Signature · 1 line
1.7.4.1
#9 lore raw

Re: [PATCH] ASoC: Added PCM short and long frame sync formats

Quoted 14 lines · Omair Mohammed Abdullah

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.

---
  include/sound/soc-dai.h |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
include/sound/soc-dai.h +0 -0
index c429f24..dc94b25 100644

include/sound/soc-dai.h struct snd_soc_dapm_widget; · line 39

Quoted 8 lines
include/sound/soc-dai.h +2 -0
@@ -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.

#10 lore raw

Re: [PATCH] ASoC: Added PCM short and long frame sync formats

Quoted 21 lines · Omair Mohammed Abdullah
Quoted 20 lines · Omair Mohammed Abdullah

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.

---
  include/sound/soc-dai.h |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
include/sound/soc-dai.h +2 -0
index c429f24..dc94b25 100644
@@ -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 */
 
Quoted 5 lines

include/sound/soc-dai.h struct snd_soc_dapm_widget; · line 39

Quoted 2 lines
include/sound/soc-dai.h +0 -0
  /* 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.