This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

audio noise

Other Parts Discussed in Thread: CDCE925

Hi,

1 . I use audio ADC CS5346to capture the audio input, it just supports 24-bit data, but it seems that the driver about McASP on 6467 side doesn't support it. So I change it,see below.but noise still exists.Does anyone have any idea? or something else need to be changed?

(now I use the command "arecord --file-type=wav --format=S32_LE --rate=48000 > test.wav" to capture the audio, if I use 24-bit format, there are a lot of noise)

--- /workdir/DVSDK_3_10_00/git/sound/soc/davinci/davinci-mcasp.c 2010-01-11 17:52:58.000000000 -0800
+++ kernel_aic32/sound/soc/davinci/davinci-mcasp.c 2010-03-21 23:24:00.000000000 -0700
@@ -635,7 +635,7 @@
  for (i = 0; i < active_slots; i++)
   mask |= (1 << i);
 
- mcasp_clr_bits(dev->base + DAVINCI_MCASP_ACLKXCTL_REG, TX_ASYNC);
+ mcasp_set_bits(dev->base + DAVINCI_MCASP_ACLKXCTL_REG, TX_ASYNC);//DigiLink
 
  if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
   /* bit stream is MSB first  with no delay */
@@ -740,6 +740,11 @@
   dma_params->data_type = 2;
   word_length = DAVINCI_AUDIO_WORD_16;
   break;

+ case SNDRV_PCM_FORMAT_S24_LE:
+  dma_params->data_type = 3;
+  word_length = DAVINCI_AUDIO_WORD_24;
+  break;
 
  case SNDRV_PCM_FORMAT_S32_LE:
   dma_params->data_type = 4;
@@ -804,7 +809,7 @@
    .channels_min = 2,
    .channels_max  = 2,
    .rates   = DAVINCI_MCASP_RATES,
-   .formats  = SNDRV_PCM_FMTBIT_S8 |
+   .formats  = SNDRV_PCM_FMTBIT_S24_LE |
       SNDRV_PCM_FMTBIT_S16_LE |
       SNDRV_PCM_FMTBIT_S32_LE,
   },
@@ -812,7 +817,7 @@
    .channels_min  = 2,
    .channels_max  = 2,
    .rates   = DAVINCI_MCASP_RATES,
-   .formats = SNDRV_PCM_FMTBIT_S8 |
+   .formats = SNDRV_PCM_FMTBIT_S24_LE |
       SNDRV_PCM_FMTBIT_S16_LE |
       SNDRV_PCM_FMTBIT_S32_LE,
   },

2 . about timing issue . our ADC IC  MCLK is from cdce925 IC, we set it to 24.51MHz , but the exact frequency that needed is 24.5760MHz, we can not set cdce925 to produce 
     this frequency successfully,  so it will cause many noises, right?

we made cs5346 as master,when work on 48KHz sample, MCLK is 24.4667MHz, LRCLK is 47.7865KHz,BCLK is 3.0583MHz.

  • Hi Rai Peng,

    TI McASP will support 24bit audio.

     REGARDING 24BIT:

    The timing information you have mentioned in the #2 - indicates that the CS5346 - is sending out 2 slot 32 bit widh each at Fs of 47.7864Khz - which makes to 3.0583.

    That means the slot width is 32bit but the data contained in it is 24bit (as per your note). The content may be L-justified and R-justified. 

    Option A (if you can work with un-packed 24bit data)

    1. This requires mcasp/EDMA to be configured for 32 bit slot/transfers
    2. In this case the problem would be the data format in the buffer  (a) unpacked and (b) where is the data in each set of 32 bit - L/R justified?
    3. if the application you use to play this raw buffer know to handle -unpacked 24bit data and has configuration of R/L -justifcation this buffer can be used as is. Else it needs processing.
    4. Because of the issues mentioned in #2 you might have got noise - the player used to play this buffer would not know about the buffer format  issues  

    Option B (if you had to work with 24bit packed data)

    1. Program Mcasp for 2 * 32 slots
    2. Program masp to mask unwanted 8 btis
    3. Rotate the data to right by 8bit if the data is left justified
    4. program EDMA to read 3 bytes for each event (a-count)
    5. With this your buffer gets the packed 24bit data.

     

    REGARDING TIMING ISSUES:

    1) I see contrary information  (a) MCLK is from cdce925 IC, we set it to 24.51MHz   (B)MCLK is 24.4667MHz from your query. Please clarify.

    2) If you set the ADC as master - changes in MCLK will only affect Fs of the ADC. The relation between MCLK and Fs would have been covered in ADC documentation and too much variance in the MCLK might affect the ADC performance (like introduction error in sampling / noise etc).

    Regards

    Vichu

  • Hi Vichu,

    Thanks for your reply.

    I use Option B (if you had to work with 24bit packed data), and solved the problems,and also let it work with 16 bit.

    Thanks,

    Rain