Hi,
I am working with beaglebone/am335x and would like to use McASP (Creating human signal generator :)). I think I almost did it but it’s not working properly yet.
With a help form Ti-wiki. I do:
- create driver for PCM1690
- build driver to kernel
- configure ALSA machine layer
- add everything to Device Tree
- then enable it in kernel
As a platform I use sitarta-TI Linux Image and SDK from TI (great tools thx :P).
What is coming out from my processor (measure by oscilloscope):
-AHCLKX (~24MHz ~ 512xfs)
-FSX (50kHz)
-ACLKX(1.6MHz ~ 32xfs)
-AXR0 (Some data)
And my PCM1690 have register 69 (0x45) which is changing if PCM see any inputs. It’s works but I still see no output from my DAC.
From start I have 3 questions:
- When I play 48kHz wav files (example /usr/share/sound/alsa/Front_left.wav or speaker-test -c 2. My ‘fs’ is 48kHz right? So why my FSX is 50kHz? Shouldn’t be 48kHz?
- How to set properly AHCLKX? In wiki there was no need to even turn it on. My DAC needs it and I lunch it by adding this 2 lines in davinci-mcasp.c file to section:
“case SND_SOC_DAIFMT_CBS_CFS:
/* codec is clock and frame slave */”
//my code
mcasp_set_bits(mcasp, DAVINCI_MCASP_PDIR_REG, AHCLKX);
mcasp_set_bits(mcasp, DAVINCI_MCASP_AHCLKXCTL_REG, AHCLKXE);
But It’s let me only to output 24MHz, but I want to change it depends on my fs rate (I should have exactly 512xfs, now its only close to this) I guess It should be in davinci-evm.c where I set ACLKX. Here is my code where I do this:
unsigned int bclk_freq = evm_get_bclk(params);
unsigned sysclk = ((struct snd_soc_card_drvdata_davinci *)
snd_soc_card_get_drvdata(soc_card))->sysclk;
int ret;
ret = snd_soc_dai_set_clkdiv(cpu_dai, 1, sysclk/bclk_freq);
So I set divider from my sysclk (default 24MHz in sitara-TI procesors). So how to change also AHCLKX (Is there a mirror divider as I do with ACLKX?)
3.Why my PCM not working? xD Or more precise where you advise me to look for mistakes or answers? Maybe I should try with polarity of my signals? Or with PCM169 configuration?
If you need any more outputs, informations or even screen from oscilloscope, do not hesitate to ask me. I will replay as fast as I can and with all my knowledge I have/will get.