diff --git a/buildroot-external/board/ovos/raspberrypi/rootfs-overlay/etc/modprobe.d/bcm2835-alsa.conf b/buildroot-external/board/ovos/raspberrypi/rootfs-overlay/etc/modprobe.d/bcm2835-alsa.conf new file mode 100644 index 00000000..d53bfc21 --- /dev/null +++ b/buildroot-external/board/ovos/raspberrypi/rootfs-overlay/etc/modprobe.d/bcm2835-alsa.conf @@ -0,0 +1,3 @@ +options snd_soc_simple_card index=0 +options snd_bcm2835 index=1 +options snd slots=snd-soc-simple-card,snd-bcm2835 diff --git a/buildroot-external/board/ovos/raspberrypi/rootfs-overlay/usr/libexec/ovos-i2csound b/buildroot-external/board/ovos/raspberrypi/rootfs-overlay/usr/libexec/ovos-i2csound index 6c4b4f2f..7660e244 100755 --- a/buildroot-external/board/ovos/raspberrypi/rootfs-overlay/usr/libexec/ovos-i2csound +++ b/buildroot-external/board/ovos/raspberrypi/rootfs-overlay/usr/libexec/ovos-i2csound @@ -16,10 +16,10 @@ ########################################################################## # Scanning the I2C bus for know addresses -is_1a=$(i2cdetect -y 1 0x1a 0x1a | grep -E "(1a|UU)" | awk '{print $2}') # ReSpeaker 2-mic / WM8960 +is_1a=$(i2cdetect -y 1 0x1a 0x1a | grep -E "(1a|UU)" | awk '{print $2}') # ReSpeaker 2-mic / WM8960 based if [ "${is_1a}" == "1a" ] || [ "${is_1a}" == "UU" ] ; then - RESPEAKER2=found - echo "ReSpeaker 2-mic $RESPEAKER2" + WM8960=found + echo "WM8960 based 2-mic $WM8960" fi is_35=$(i2cdetect -y 1 0x35 0x35 | grep -E "(35|UU)" | awk '{print $2}') # ReSpeaker 4-mic squared @@ -59,30 +59,31 @@ if [ "${is_04}" == "04" ] || [ "${is_04}" == "UU" ] ; then fi # Configure found devices -if [ "$RESPEAKER2" == "found" ] && [ "$RESPEAKER4" != "found" ] ; then +if [ "$WM8960" == "found" ] && [ "$RESPEAKER4" != "found" ] ; then echo "Installing and configuring WM8960 based 2-mic HAT" dtoverlay wm8960-soundcard echo "Configuring board" - amixer cset numid=1 34,34 - amixer cset numid=26 3 - amixer cset numid=27 4 - amixer cset numid=30 5 - amixer cset numid=32 5 - amixer cset numid=33 5 - amixer cset numid=34 25 - amixer cset numid=35 on - amixer cset numid=9 3 - amixer cset numid=8 3 - amixer cset numid=49 on - amixer cset numid=51 on - amixer cset numid=37 0 - amixer cset numid=38 0 - amixer cset numid=39 5 - amixer cset numid=48 on - amixer cset numid=50 on - amixer cset numid=54 on - amixer cset numid=16 5 - amixer cset numid=15 4 + amixer -c "wm8960soundcard" cset numid=1 34,34 + amixer -c "wm8960soundcard" cset numid=26 3 + amixer -c "wm8960soundcard" cset numid=27 4 + amixer -c "wm8960soundcard" cset numid=30 5 + amixer -c "wm8960soundcard" cset numid=32 5 + amixer -c "wm8960soundcard" cset numid=33 5 + amixer -c "wm8960soundcard" cset numid=34 25 + amixer -c "wm8960soundcard" cset numid=35 on + amixer -c "wm8960soundcard" cset numid=9 3 + amixer -c "wm8960soundcard" cset numid=8 3 + amixer -c "wm8960soundcard" cset numid=49 on + amixer -c "wm8960soundcard" cset numid=51 on + amixer -c "wm8960soundcard" cset numid=37 0 + amixer -c "wm8960soundcard" cset numid=38 0 + amixer -c "wm8960soundcard" cset numid=39 5 + amixer -c "wm8960soundcard" cset numid=48 on + amixer -c "wm8960soundcard" cset numid=50 on + amixer -c "wm8960soundcard" cset numid=54 on + amixer -c "wm8960soundcard" cset numid=16 5 + amixer -c "wm8960soundcard" cset numid=15 4 + alsactl store fi if [ "${RESPEAKER6}" == "found" ] && [ "${RESPEAKER4}" != "found" ] ; then diff --git a/buildroot-external/package/respeaker/respeaker.mk b/buildroot-external/package/respeaker/respeaker.mk index c82166e3..fb52a8ce 100644 --- a/buildroot-external/package/respeaker/respeaker.mk +++ b/buildroot-external/package/respeaker/respeaker.mk @@ -20,6 +20,8 @@ define RESPEAKER_INSTALL_TARGET_CMDS mkdir -p $(BINARIES_DIR)/rpi-firmware/overlays $(INSTALL) -D -m 0644 $(@D)/seeed-4mic-voicecard.dtbo $(BINARIES_DIR)/rpi-firmware/overlays/ $(INSTALL) -D -m 0644 $(@D)/seeed-8mic-voicecard.dtbo $(BINARIES_DIR)/rpi-firmware/overlays/ + $(INSTALL) -D -m 0644 $(BR2_EXTERNAL_OPENVOICEOS_PATH)/package/respeaker/wm8960-button-overlay.dtbo \ + $(BINARIES_DIR)/rpi-firmware/overlays/ mkdir -p $(TARGET_DIR)/usr/share/pulseaudio/alsa-mixer/profile-sets/ $(INSTALL) -D -m 0644 $(@D)/pulseaudio/pulse_config_4mic/seeed-voicecard.conf \ diff --git a/buildroot-external/package/respeaker/wm8960-button-overlay.dtbo b/buildroot-external/package/respeaker/wm8960-button-overlay.dtbo new file mode 100644 index 00000000..9da9a74f Binary files /dev/null and b/buildroot-external/package/respeaker/wm8960-button-overlay.dtbo differ diff --git a/buildroot-external/package/respeaker/wm8960-button-overlay.dts b/buildroot-external/package/respeaker/wm8960-button-overlay.dts new file mode 100644 index 00000000..a8ee97d2 --- /dev/null +++ b/buildroot-external/package/respeaker/wm8960-button-overlay.dts @@ -0,0 +1,39 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; + + fragment@0 { + target = <&gpio>; + __overlay__ { + wm8960_key_pin: wm8960_key_pin { + brcm,pins = <11>; + brcm,function = <0>; /* input mode */ + brcm,pull = <0>; /* pull up/down disabled */ + }; + }; + }; + + fragment@1 { + target-path = "/soc"; + __overlay__ { + wm8960_button: wm8960_button { + compatible = "gpio-keys"; + // #address-cells = <1>; + // #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&wm8960_key_pin>; + status = "okay"; + debounce-interval = <50>; + + button_wake_up: button@11 { + gpios = <&gpio 11 1>; + linux,code = <143>; // KEY_WAKEUP + label = "Wake Up"; + gpio-key,wakeup; + }; + }; + }; + }; +};