Hello,
I’m working on a laser absorbtion spectrometer.
I did a HAT with a pcm3060 to generate a current ramp for driving the laser with its dac.
The detectors voltage I plan to evaluate with the adc.
I sort of „abuse“ this codec for my task, but it fits all my requirements and is very cheap.
The actual linux kernel supports pcm3060 so I only had to include kernel module for rpi.
The pcm3060 has adc and dac on one chip.
I connected bclk and lrclk for i2s together and want to use pcm3060 ability to generate the clock from a master clock which comes from an oscillator on the HAT (see attached schematic).
The adc can be configured over i2c to be bitclk master and the dac to be slave.
Raspberry pi should be clk slave too (i2s consumer).
At the moment I struggle with the overlay where I use the simple-sound-card.
I already got it work that I can play a sine.
But playing and recording are not working with my actual overlay (see below).
I can't see the i2c command that sets the pcm3060 adc in bclk master mode.
With this overlay raspberry pi seems to be i2s master.
What could be the issue here?
I would be very thankful for help!
I would be very thankful for help!
// Definitions for pcm3060 audio card
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835";
fragment@0 {
target = <&i2s_clk_consumer>;
__overlay__ {
status = "okay";
};
};
fragment@1 {
target = <&i2c1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pcm3060: pcm3060@46 {
#sound-dai-cells = <1>;
compatible = "ti,pcm3060";
reg = <0x46>;
ti,out-single-ended = "false";
};
};
};
fragment@2 {
target = <&sound>;
slave_overlay: __overlay__ {
compatible = "simple-audio-card";
simple-audio-card,name = "pcm3060-soundcard";
status = "okay";
simple-audio-card,dai-link@0 {
format = "i2s";
cpu {
sound-dai = <&i2s_clk_consumer>;
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <32>;
};
pcm3060_dac: codec {
sound-dai = <&pcm3060 0>;
system-clock-frequency = <24576000>;
};
};
simple-audio-card,dai-link@2 {
format = "i2s";
bitclock-master = <&pcm3060_adc>;
frame-master = <&pcm3060_adc>;
cpu {
sound-dai = <&i2s_clk_consumer>;
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <32>;
};
pcm3060_adc: codec {
sound-dai = <&pcm3060 1>;
system-clock-frequency = <24576000>;
};
};
};
};
__overrides__ {
alsaname = <&slave_overlay>,"simple-audio-card,name";
compatible = <&pcm3060>,"compatible";
};
};