mirror of
https://github.com/OpenVoiceOS/OpenVoiceOS
synced 2025-06-05 22:19:21 +02:00
[WIP] More work on the SJ201 support.
Output all ok now Input still a lot of static noise (trying to figure it out)
This commit is contained in:
28
buildroot-external/rootfs-overlay/usr/libexec/ovos-i2csound
Normal file → Executable file
28
buildroot-external/rootfs-overlay/usr/libexec/ovos-i2csound
Normal file → Executable file
@ -25,33 +25,39 @@ RPI_HATS="seeed-2mic-voicecard seeed-4mic-voicecard seeed-8mic-voicecard"
|
||||
|
||||
# Scanning the I2C bus for know addresses
|
||||
is_1a=$(i2cdetect -y 1 0x1a 0x1a | egrep "(1a|UU)" | awk '{print $2}') # ReSpeaker 2-mic / WM8960
|
||||
if [ $is_1a == "1a" ] || [ $is_1a == "UU" ] ; then
|
||||
if [ "${is_1a}" == "1a" ] || [ "${is_1a}" == "UU" ] ; then
|
||||
RESPEAKER2=found
|
||||
echo "ReSpeaker 2-mic $RESPEAKER2"
|
||||
fi
|
||||
|
||||
is_35=$(i2cdetect -y 1 0x35 0x35 | egrep "(35|UU)" | awk '{print $2}') # ReSpeaker 4-mic squared
|
||||
if [ $is_35 == "35" ] || [ $is_35 == "UU" ] ; then
|
||||
if [ "${is_35}" == "35" ] || [ "${is_35}" == "UU" ] ; then
|
||||
RESPEAKER4=found
|
||||
echo "ReSpeaker 4-mic $RESPEAKER4"
|
||||
fi
|
||||
|
||||
is_3b=$(i2cdetect -y 1 0x3b 0x3b | egrep "(3b|UU)" | awk '{print $2}') # ReSpeaker 4-mic lineair / 6-mic
|
||||
if [ $is_3b == "3b" ] || [ $is_3b == "UU" ] ; then
|
||||
if [ "${is_3b}" == "3b" ] || [ "${is_3b}" == "UU" ] ; then
|
||||
RESPEAKER6=found
|
||||
echo "ReSpeaker 6-mic $RESPEAKER6"
|
||||
fi
|
||||
|
||||
is_4b=$(i2cdetect -y 1 0x4b 0x4b | egrep "(4b|UU)" | awk '{print $2}') # Adafruit
|
||||
if [ $is_4b == "4b" ] || [ $is_4b == "UU" ] ; then
|
||||
if [ "${is_4b}" == "4b" ] || [ "${is_4b}" == "UU" ] ; then
|
||||
ADAFRUIT=found
|
||||
echo "Adafruit $ADAFRUIT"
|
||||
fi
|
||||
|
||||
is_2f=$(i2cdetect -y 1 0x2f 0x2f | egrep "(2f|UU)" | awk '{print $2}') # TAS5806
|
||||
if [ $is_2f == "2f" ] || [ $is_2f == "UU" ] ; then
|
||||
if [ "${is_2f}" == "2f" ] || [ "${is_2f}" == "UU" ] ; then
|
||||
TAS5806=found
|
||||
echo "Texas Instruments 5806 $TAS5806"
|
||||
fi
|
||||
|
||||
is_04=$(i2cdetect -y -a 1 0x04 0x04 | egrep "(04|UU)" | awk '{print $2}') # SJ201 Led Ring
|
||||
if [ $is_04 == "04" ] || [ $is_04 == "UU" ] ; then
|
||||
if [ "${is_04}" == "04" ] || [ "${is_04}" == "UU" ] ; then
|
||||
SJ201LED=found
|
||||
echo "Mark2 SJ201 Leds $SJ201LED"
|
||||
fi
|
||||
|
||||
|
||||
@ -69,14 +75,14 @@ if [ -f /etc/pulse/daemon.conf ] ; then
|
||||
rm /etc/pulse/daemon.conf
|
||||
fi
|
||||
|
||||
if [ $RESPEAKER2 == "found" ] && [ $RESPEAKER4 != "found" ] ; then
|
||||
if [ "$RESPEAKER2" == "found" ] && [ "$RESPEAKER4" != "found" ] ; then
|
||||
echo "Installing and configuring ReSpeaker 2-mic"
|
||||
modprobe snd-soc-wm8960
|
||||
OVERLAY=seeed-2mic-voicecard
|
||||
ASOUND_STATE=/etc/voicecard/wm8960_asound.state
|
||||
fi
|
||||
|
||||
if [ $RESPEAKER6 == "found" ] && [ $RESPEAKER4 != "found" ] ; then
|
||||
if [ "${RESPEAKER6}" == "found" ] && [ "${RESPEAKER4}" != "found" ] ; then
|
||||
echo "Installing and configuring ReSpeaker 4-mic"
|
||||
modprobe snd-soc-seeed-voicecard
|
||||
modprobe snd-soc-ac108
|
||||
@ -86,7 +92,7 @@ if [ $RESPEAKER6 == "found" ] && [ $RESPEAKER4 != "found" ] ; then
|
||||
PULSE_DAEMON=/etc/pulse/seeed-voicecard-4mic-daemon.conf
|
||||
fi
|
||||
|
||||
if [ $RESPEAKER6 == "found" ] && [ $RESPEAKER4 == "found" ] ; then
|
||||
if [ "{$RESPEAKER6}" == "found" ] && [ "${RESPEAKER4}" == "found" ] ; then
|
||||
echo "Installing and configuring ReSpeaker 6mic"
|
||||
modprobe snd-soc-seeed-voicecard
|
||||
modprobe snd-soc-ac108
|
||||
@ -96,12 +102,12 @@ if [ $RESPEAKER6 == "found" ] && [ $RESPEAKER4 == "found" ] ; then
|
||||
PULSE_DAEMON=/etc/pulse/seeed-voicecard-8mic-daemon.conf
|
||||
fi
|
||||
|
||||
if [ $ADAFRUIT == "found" ] ; then
|
||||
if [ "$ADAFRUIT" ] ; then
|
||||
echo "Installing and configuring Adafruit"
|
||||
/usr/sbin/i2cset -y 1 0x4b 30 # Set maximum volume to 30
|
||||
fi
|
||||
|
||||
if [ $TAS5860 == "found" ] && [ $SJ201LED == "found" ]; then
|
||||
if [ "$TAS5806" ] && [ "$SJ201LED" ]; then
|
||||
echo "Installing and configuring SJ201"
|
||||
# Initializing XMOS xvf3510
|
||||
/usr/sbin/xvf3510-start
|
||||
|
Reference in New Issue
Block a user