add devicetree overlay for i2s and asound.conf

This commit is contained in:
2025-11-05 18:06:53 +01:00
parent c0ce8eeebe
commit a83ca982cf
5 changed files with 50 additions and 3 deletions

3
.gitignore vendored
View File

@@ -46,3 +46,6 @@ src/auracast/server/certs/ca/ca_cert.srl
src/auracast/server/credentials.json
pcm1862-i2s.dtbo
test.wav
both.wav
vin1.wav
vin2.wav

39
src/misc/asound.conf Normal file
View File

@@ -0,0 +1,39 @@
# --- raw HW by card ID (no sharing) ---
pcm.adc_hw_stereo {
type hw
card "i2s" # from `arecord -l`: card 2: i2s [pcm1862 on i2s]
device 0
}
# --- mono splits (do the routing here) ---
pcm.adc_in1 {
type route
slave.pcm "adc_hw_stereo"
slave.channels 2
ttable.0.0 1.0 # left -> mono
ttable.1.0 0.0
}
pcm.adc_in2 {
type route
slave.pcm "adc_hw_stereo"
slave.channels 2
ttable.0.0 0.0
ttable.1.0 1.0 # right -> mono
}
# --- diagnostics: exact slot taps (bypass any sharing/conversion) ---
pcm.adc_ch0 {
type route
slave.pcm "adc_hw_stereo"
slave.channels 2
ttable.0.0 1.0
ttable.1.0 0.0
}
pcm.adc_ch1 {
type route
slave.pcm "adc_hw_stereo"
slave.channels 2
ttable.0.0 0.0
ttable.1.0 1.0
}

View File

@@ -0,0 +1 @@
sudo cp src/misc/asound.conf /etc/asound.conf

View File

@@ -7,24 +7,28 @@
/* Enable the I²S controller */
fragment@0 {
target = <&i2s>;
__overlay__ { status = "okay"; };
__overlay__ {
status = "okay";
};
};
/* PCM1862 on I2C1 at 0x4a */
/* PCM1862 on I2C1 at 0x4a (change if your bus/address differ) */
fragment@1 {
target = <&i2c1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
pcm1862: adc@4a {
compatible = "ti,pcm1862";
reg = <0x4a>;
#sound-dai-cells = <0>;
/* Rails are hard-powered on your board, so no regulators here */
};
};
};
/* Link bcm2835-i2s <-> pcm1862 with simple-audio-card */
/* Link bcm2835-i2s <-> pcm1862 via simple-audio-card */
fragment@2 {
target-path = "/";
__overlay__ {