diff --git a/conf/machine/include/rpi-base.inc b/conf/machine/include/rpi-base.inc index a800078..75c3727 100644 --- a/conf/machine/include/rpi-base.inc +++ b/conf/machine/include/rpi-base.inc @@ -50,6 +50,7 @@ RPI_KERNEL_DEVICETREE_OVERLAYS ?= " \ overlays/vc4-kms-dsi-7inch.dtbo \ overlays/w1-gpio.dtbo \ overlays/w1-gpio-pullup.dtbo \ + overlays/wm8960-soundcard.dtbo \ " RPI_KERNEL_DEVICETREE ?= " \ diff --git a/docs/extra-build-config.md b/docs/extra-build-config.md index 1caf904..ec3bd6a 100644 --- a/docs/extra-build-config.md +++ b/docs/extra-build-config.md @@ -349,3 +349,24 @@ Also, this will enable adding Contiguous Memory Allocation value in the cmdline. Ref.: * * + +## WM8960 soundcard support + +Support for WM8960 based sound cards such as the WM8960 Hi-Fi Sound Card HAT for Raspberry Pi from Waveshare, and ReSpeaker 2 / 4 / 6 Mics Pi HAT from Seeed Studio, can be enabled in `local.conf` + + ```conf + MACHINE_FEATURES += "wm8960" + ``` + +You may need to adjust volume and toggle switches that are off by default + + ```bash + amixer -c1 sset 'Headphone',0 80%,80% + amixer -c1 sset 'Speaker',0 80%,80% + amixer -c1 sset 'Left Input Mixer Boost' toggle + amixer -c1 sset 'Left Output Mixer PCM' toggle + amixer -c1 sset 'Right Input Mixer Boost' toggle + amixer -c1 sset 'Right Output Mixer PCM' toggle + ``` + +Audio capture on ReSpeaker 2 / 4 / 6 Mics Pi HAT from Seeed Studio is very noisy. diff --git a/recipes-bsp/bootfiles/rpi-config_git.bb b/recipes-bsp/bootfiles/rpi-config_git.bb index 052206a..e84456c 100644 --- a/recipes-bsp/bootfiles/rpi-config_git.bb +++ b/recipes-bsp/bootfiles/rpi-config_git.bb @@ -30,6 +30,8 @@ GPIO_IR_TX ?= "17" CAN_OSCILLATOR ?= "16000000" +WM8960="${@bb.utils.contains("MACHINE_FEATURES", "wm8960", "1", "0", d)}" + inherit deploy nopackages do_deploy() { @@ -251,6 +253,12 @@ do_deploy() { ;; esac fi + + # WM8960 support + if [ "${WM8960}" = "1" ]; then + echo "# Enable WM8960" >> $CONFIG + echo "dtoverlay=wm8960-soundcard" >> $CONFIG + fi } do_deploy_append_raspberrypi3-64() { diff --git a/recipes-kernel/linux/files/wm8960.cfg b/recipes-kernel/linux/files/wm8960.cfg new file mode 100644 index 0000000..9360800 --- /dev/null +++ b/recipes-kernel/linux/files/wm8960.cfg @@ -0,0 +1,2 @@ +CONFIG_I2C_BCM2835=y +CONFIG_SND_SOC_WM8960=y diff --git a/recipes-kernel/linux/linux-raspberrypi.inc b/recipes-kernel/linux/linux-raspberrypi.inc index 5ad9b78..683253c 100644 --- a/recipes-kernel/linux/linux-raspberrypi.inc +++ b/recipes-kernel/linux/linux-raspberrypi.inc @@ -14,6 +14,7 @@ require recipes-kernel/linux/linux-yocto.inc SRC_URI += " \ ${@bb.utils.contains("INITRAMFS_IMAGE_BUNDLE", "1", "file://initramfs-image-bundle.cfg", "", d)} \ ${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "file://vc4graphics.cfg", "", d)} \ + ${@bb.utils.contains("MACHINE_FEATURES", "wm8960", "file://wm8960.cfg", "", d)} \ " KCONFIG_MODE = "--alldefconfig"