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.

How to Interfacing BeagleBone Black with a "fixed" codec?

Other Parts Discussed in Thread: PCM5102A

Dear all,

I am trying to connect my BeageBone Black board with a "fixed" code. By "fixed" codec, I mean this codec works at only one configuration with no control interface (neither two-wire I2C nor three-wire SPI). The sampling rate is set as only 8 Khz, data 8 bits (voice a-law). Data interface is completely the same as other normal voice codecs (BLCK, datain, dataout, framesyn-in DSP mode).

There is one more requirement that the sound ALSA model must be used, application must see the "fixed" codec as a ALSA sound device.

Could you all here have any suggestion to  get this task done optimally together with steps' descriptions? If I start with a normal sound driver and try adapt to the new device, any stuff I have to pay attention due to the "fixed" configuration of the codec?

I would like to thank you in advance,

Brgs,

  • Hi, 

    Nguyen Anh Duc said:
    By "fixed" codec, I mean this codec works at only one configuration with no control interface (neither two-wire I2C nor three-wire SPI). The sampling rate is set as only 8 Khz, data 8 bits (voice a-law). Data interface is completely the same as other normal voice codecs (BLCK, datain, dataout, framesyn-in DSP mode).

    Which BBB interface do you use to connect the codec to the Beaglebone? I guess McASP, right? 

    If so then you can start by checking the audio DAC example provided bellow, and adjust to your use case: 

    http://processors.wiki.ti.com/index.php/Sitara_Linux_Audio_DAC_Example

    Hope this helps. 


    Best Regards, 

    Yordan

  • Dear Yordan,

    Thank you very much for your response.

    Yes, I have planned to use McASP and I had a look on the guidance at the link you mentioned. Still, I have some doubts that
    1. If follow the guidance, is there any things affecting the standard use of ALSA/ASoC model due to the fixed configuration (there is no control interface), how to initialize system with sampling rate, data format etc?

    2. There are two key differences that my fixed codec differs from Audio DAC PCM5102a
    - My codec is configured in Master mode (clock and frame signals are provided by the codecs) - It is more like the Beagle Audio Cape RevA I guess
    - My system is two-way full-duplex while PCM5102a only receives the data and converts to the corresponding analog signal

    In addition, I am new to ASoc, if possible, could you please point me to some reference resources on ASoC with the triple (machine, platform, codec drivers)? My major resources have been /Documentation/sound/alsa and /Documentation/sound/alsa/soc in the Linux kernel source; however, it is rather unclear to grasp the details

    I look forward to hear from you soon,

    Brgs,
  • Hi,

    I don't think you should modify the alsa because you use "fixed" codec.

    However you will need to configure the mcasp to work as a slave, this is done by setting the appropriate format in snd_soc_dai_link evm_dai_pcmXXX, see the audio dac example from the above link. Also check the davinci_mcasp_set_dai_fmt() function in davinci_mcasp.c in order to see which formats allow the mcasp to act as a slave.

    Hope this helps.

    Best Regards,
    Yordan