From a4353c83a2d230d0992feedbf462cc243ab37126 Mon Sep 17 00:00:00 2001 From: Andrew Geissler Date: Fri, 25 Jun 2021 14:23:27 -0500 Subject: meta-raspberrypi: subtree update:ffc402ef5e..17b56ab075 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Andreas Müller (1): pi-bluetooth: upgrade 0.1.12 -> 0.1.17 Devendra Tewari (1): Add WM8960 soundcard support Paul Barker (1): rpi-cmdline: Package is machine-specific Pierre-Jean Texier (1): kas: remove 'image-mklibs' from USER_CLASSES list Signed-off-by: Andrew Geissler Change-Id: I08366a667f191efd45b717be5bd530ae1af782b5 --- meta-raspberrypi/conf/machine/include/rpi-base.inc | 1 + meta-raspberrypi/docs/extra-build-config.md | 21 ++++++++++ meta-raspberrypi/kas-poky-rpi.yml | 2 +- .../recipes-bsp/bootfiles/rpi-cmdline.bb | 2 + .../recipes-bsp/bootfiles/rpi-config_git.bb | 8 ++++ ...er-correct-path-for-hciconfig-under-Yocto.patch | 33 ++++++++++----- .../pi-bluetooth/pi-bluetooth_0.1.12.bb | 47 ---------------------- .../pi-bluetooth/pi-bluetooth_0.1.17.bb | 47 ++++++++++++++++++++++ .../recipes-kernel/linux/files/wm8960.cfg | 2 + .../recipes-kernel/linux/linux-raspberrypi.inc | 1 + 10 files changed, 106 insertions(+), 58 deletions(-) delete mode 100644 meta-raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth_0.1.12.bb create mode 100644 meta-raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth_0.1.17.bb create mode 100644 meta-raspberrypi/recipes-kernel/linux/files/wm8960.cfg (limited to 'meta-raspberrypi') diff --git a/meta-raspberrypi/conf/machine/include/rpi-base.inc b/meta-raspberrypi/conf/machine/include/rpi-base.inc index a80007847..75c37271a 100644 --- a/meta-raspberrypi/conf/machine/include/rpi-base.inc +++ b/meta-raspberrypi/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/meta-raspberrypi/docs/extra-build-config.md b/meta-raspberrypi/docs/extra-build-config.md index 1caf904fd..ec3bd6ab8 100644 --- a/meta-raspberrypi/docs/extra-build-config.md +++ b/meta-raspberrypi/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/meta-raspberrypi/kas-poky-rpi.yml b/meta-raspberrypi/kas-poky-rpi.yml index d629e817f..3e43e2e75 100644 --- a/meta-raspberrypi/kas-poky-rpi.yml +++ b/meta-raspberrypi/kas-poky-rpi.yml @@ -45,7 +45,7 @@ local_conf_header: CONF_VERSION = "1" PACKAGE_CLASSES = "package_rpm" SDKMACHINE = "x86_64" - USER_CLASSES = "buildstats image-mklibs image-prelink" + USER_CLASSES = "buildstats image-prelink" PATCHRESOLVE = "noop" debug-tweaks: | EXTRA_IMAGE_FEATURES = "debug-tweaks" diff --git a/meta-raspberrypi/recipes-bsp/bootfiles/rpi-cmdline.bb b/meta-raspberrypi/recipes-bsp/bootfiles/rpi-cmdline.bb index 3ebd1e61c..13fe304a5 100644 --- a/meta-raspberrypi/recipes-bsp/bootfiles/rpi-cmdline.bb +++ b/meta-raspberrypi/recipes-bsp/bootfiles/rpi-cmdline.bb @@ -49,3 +49,5 @@ do_deploy() { addtask deploy before do_build after do_install do_deploy[dirs] += "${DEPLOYDIR}/${BOOTFILES_DIR_NAME}" + +PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bb b/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bb index 052206acf..e84456c7a 100644 --- a/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bb +++ b/meta-raspberrypi/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/meta-raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth/0001-bthelper-correct-path-for-hciconfig-under-Yocto.patch b/meta-raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth/0001-bthelper-correct-path-for-hciconfig-under-Yocto.patch index 45b43c725..079377e0e 100644 --- a/meta-raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth/0001-bthelper-correct-path-for-hciconfig-under-Yocto.patch +++ b/meta-raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth/0001-bthelper-correct-path-for-hciconfig-under-Yocto.patch @@ -8,20 +8,33 @@ Signed-off-by: Peter A. Bigot Signed-off-by: Andrei Gherzan --- - usr/bin/bthelper | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) + usr/bin/bthelper | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr/bin/bthelper b/usr/bin/bthelper -index af597e5..5de84f6 100755 +index 2133fbc..1fc9245 100755 --- a/usr/bin/bthelper +++ b/usr/bin/bthelper -@@ -10,7 +10,7 @@ fi +@@ -12,8 +12,8 @@ fi + dev=$1 - dev="$1" # Need to bring hci up before looking at MAC as it can be all zeros during init --/bin/hciconfig "$dev" up --/bin/hciconfig "$dev" | grep -qE "BD Address: (B8:27:EB|DC:A6:32):" || exit 0 -+/usr/bin/hciconfig "$dev" up -+/usr/bin/hciconfig "$dev" | grep -qE "BD Address: (B8:27:EB|DC:A6:32):" || exit 0 - /usr/bin/hcitool -i "$dev" cmd 0x3f 0x1c 0x01 0x02 0x00 0x01 0x01 > /dev/null +-/bin/hciconfig $dev up +-if ! /bin/hciconfig $dev | grep -q "Bus: UART"; then ++/usr/bin/hciconfig $dev up ++if ! /usr/bin/hciconfig $dev | grep -q "Bus: UART"; then + echo Not a UART-attached BT Modem + exit 0 + fi +@@ -26,7 +26,7 @@ if ( /usr/bin/hcitool -i $dev dev | grep -q -E '\s43:4[35]:' ); then + BDADDR=`printf '0x%02x 0x%02x 0x%02x 0xeb 0x27 0xb8' $((0x$B3 ^ 0xaa)) $((0x$B2 ^ 0xaa)) $((0x$B1 ^ 0xaa))` + /usr/bin/hcitool -i $dev cmd 0x3f 0x001 $BDADDR +- /bin/hciconfig $dev reset ++ /usr/bin/hciconfig $dev reset + else + echo Raspberry Pi BDADDR already set + fi +-- +2.31.1 + diff --git a/meta-raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth_0.1.12.bb b/meta-raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth_0.1.12.bb deleted file mode 100644 index ccf714baf..000000000 --- a/meta-raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth_0.1.12.bb +++ /dev/null @@ -1,47 +0,0 @@ -SUMMARY = "Script to properly configure BT-HCI on Raspberry Pi" -HOMEPAGE = "https://github.com/RPi-Distro/pi-bluetooth" -SECTION = "kernel" -LICENSE = "BSD-3-Clause" -LIC_FILES_CHKSUM = "\ - file://debian/copyright;md5=6af8de3c8ee71f8e91e9b22f84ff2022 \ -" - -SRC_URI = "\ - git://github.com/RPi-Distro/pi-bluetooth \ - file://0001-bthelper-correct-path-for-hciconfig-under-Yocto.patch \ -" -SRCREV = "cbdbcb66bcc5b9af05f1a9fffe2254c872bb0ace" - -S = "${WORKDIR}/git" - -# hciuart.service replaces what was brcm43438.service -inherit systemd -SYSTEMD_SERVICE_${PN} = "\ - hciuart.service \ - bthelper@.service \ -" - -do_install() { - install -d ${D}${sysconfdir}/udev/rules.d - install -m 0644 ${S}/lib/udev/rules.d/* ${D}${sysconfdir}/udev/rules.d - - install -d ${D}${bindir} - install -m 0755 ${S}/usr/bin/bthelper ${D}${bindir} - install -m 0755 ${S}/usr/bin/btuart ${D}${bindir} - - if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then - install -d ${D}${systemd_system_unitdir} - install -m 0644 ${S}/debian/pi-bluetooth.bthelper@.service ${D}${systemd_system_unitdir}/bthelper@.service - install -m 0644 ${S}/debian/pi-bluetooth.hciuart.service ${D}${systemd_system_unitdir}/hciuart.service - fi -} - -FILES_${PN} = "\ - ${bindir} \ - ${sysconfdir} \ - ${systemd_unitdir}/system \ -" - -RDEPENDS_${PN} += " \ - udev-rules-rpi \ -" diff --git a/meta-raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth_0.1.17.bb b/meta-raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth_0.1.17.bb new file mode 100644 index 000000000..a1eb97fe8 --- /dev/null +++ b/meta-raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth_0.1.17.bb @@ -0,0 +1,47 @@ +SUMMARY = "Script to properly configure BT-HCI on Raspberry Pi" +HOMEPAGE = "https://github.com/RPi-Distro/pi-bluetooth" +SECTION = "kernel" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "\ + file://debian/copyright;md5=6af8de3c8ee71f8e91e9b22f84ff2022 \ +" + +SRC_URI = "\ + git://github.com/RPi-Distro/pi-bluetooth \ + file://0001-bthelper-correct-path-for-hciconfig-under-Yocto.patch \ +" +SRCREV = "fd4775bf90e037551532fc214a958074830bb80d" + +S = "${WORKDIR}/git" + +# hciuart.service replaces what was brcm43438.service +inherit systemd +SYSTEMD_SERVICE_${PN} = "\ + hciuart.service \ + bthelper@.service \ +" + +do_install() { + install -d ${D}${sysconfdir}/udev/rules.d + install -m 0644 ${S}/lib/udev/rules.d/* ${D}${sysconfdir}/udev/rules.d + + install -d ${D}${bindir} + install -m 0755 ${S}/usr/bin/bthelper ${D}${bindir} + install -m 0755 ${S}/usr/bin/btuart ${D}${bindir} + + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${S}/debian/pi-bluetooth.bthelper@.service ${D}${systemd_system_unitdir}/bthelper@.service + install -m 0644 ${S}/debian/pi-bluetooth.hciuart.service ${D}${systemd_system_unitdir}/hciuart.service + fi +} + +FILES_${PN} = "\ + ${bindir} \ + ${sysconfdir} \ + ${systemd_unitdir}/system \ +" + +RDEPENDS_${PN} += " \ + udev-rules-rpi \ +" diff --git a/meta-raspberrypi/recipes-kernel/linux/files/wm8960.cfg b/meta-raspberrypi/recipes-kernel/linux/files/wm8960.cfg new file mode 100644 index 000000000..936080083 --- /dev/null +++ b/meta-raspberrypi/recipes-kernel/linux/files/wm8960.cfg @@ -0,0 +1,2 @@ +CONFIG_I2C_BCM2835=y +CONFIG_SND_SOC_WM8960=y diff --git a/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc b/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc index 5ad9b781b..683253cef 100644 --- a/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc +++ b/meta-raspberrypi/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" -- cgit v1.2.3