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:
12
README.md
12
README.md
@@ -218,6 +218,18 @@ sudo ldconfig # refresh linker cache
|
|||||||
- echo i2c-dev | sudo tee -a /etc/modules
|
- echo i2c-dev | sudo tee -a /etc/modules
|
||||||
- read temp /src/scripts/temp
|
- 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
|
# test recording
|
||||||
arecord -f cd -c 1 -D record_left left.wav -r48000
|
arecord -f cd -c 1 -D record_left left.wav -r48000
|
||||||
arecord -f cd -c 1 -D record_right right.wav -r48000
|
arecord -f cd -c 1 -D record_right right.wav -r48000
|
||||||
|
|||||||
@@ -6,12 +6,13 @@ pcm.ch1 {
|
|||||||
channels 2
|
channels 2
|
||||||
rate 48000
|
rate 48000
|
||||||
format S16_LE
|
format S16_LE
|
||||||
period_size 240 # 5 ms @ 48 kHz
|
period_size 120 # 2.5ms
|
||||||
buffer_size 480 # 2 periods (≈10 ms total)
|
buffer_size 360
|
||||||
}
|
}
|
||||||
bindings.0 0
|
bindings.0 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pcm.ch2 {
|
pcm.ch2 {
|
||||||
type dsnoop
|
type dsnoop
|
||||||
ipc_key 2241234
|
ipc_key 2241234
|
||||||
@@ -20,8 +21,8 @@ pcm.ch2 {
|
|||||||
channels 2
|
channels 2
|
||||||
rate 48000
|
rate 48000
|
||||||
format S16_LE
|
format S16_LE
|
||||||
period_size 240 # 5 ms @ 48 kHz
|
period_size 120
|
||||||
buffer_size 480 # 2 periods (≈10 ms total)
|
buffer_size 360
|
||||||
}
|
}
|
||||||
bindings.0 1
|
bindings.0 1
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user