feat: configure PCM1862 differential inputs and optimize audio buffer settings

- Added PCM1862 I2S interface setup with differential input configuration via I2C
- Reduced audio buffer latency by decreasing period_size from 240 to 120 samples (5ms to 2.5ms)
- Updated buffer_size to 360 samples for both channels to maintain stable audio capture
This commit is contained in:
2025-11-12 18:01:12 +01:00
parent e9e5a190f6
commit 178f75e735
2 changed files with 17 additions and 4 deletions

View File

@@ -218,6 +218,18 @@ sudo ldconfig # refresh linker cache
- echo i2c-dev | sudo tee -a /etc/modules
- read temp /src/scripts/temp
# configure the pcm1862 i2s interface
bash misc/build_pcm1862_dts.sh
bash misc/install_asoundconf.sh
- configure differential inputs
sudo modprobe i2c-dev
i2cdetect -y 1 | grep -i 4a || true
i2cset -f -y 1 0x4a 0x00 0x00 # Page 0
i2cset -f -y 1 0x4a 0x06 0x10 # Left = VIN1P/M [DIFF]
i2cset -f -y 1 0x4a 0x07 0x10 # Right = VIN2P/M [DIFF]
# test recording
arecord -f cd -c 1 -D record_left left.wav -r48000
arecord -f cd -c 1 -D record_right right.wav -r48000

View File

@@ -6,12 +6,13 @@ pcm.ch1 {
channels 2
rate 48000
format S16_LE
period_size 240 # 5 ms @ 48 kHz
buffer_size 480 # 2 periods (≈10 ms total)
period_size 120 # 2.5ms
buffer_size 360
}
bindings.0 0
}
pcm.ch2 {
type dsnoop
ipc_key 2241234
@@ -20,8 +21,8 @@ pcm.ch2 {
channels 2
rate 48000
format S16_LE
period_size 240 # 5 ms @ 48 kHz
buffer_size 480 # 2 periods (≈10 ms total)
period_size 120
buffer_size 360
}
bindings.0 1
}