From 0ec5e3c28f6e172e769d4ea00de4d9fb9db625ff Mon Sep 17 00:00:00 2001 From: Florian Asche Date: Sat, 21 Nov 2026 05:03:32 +0100 Subject: [PATCH] feat(2michat-v1): install picompose-driver-2michat-v1 from the APT repository Co-Authored-By: Claude Sonnet 5.5 --- .../01-driver/01-packages | 9 -- .../01-driver/02-run.sh | 19 --- .../01-driver/03-run-chroot.sh | 108 -------------- .../01-driver/files/51-disable-acp.conf | 14 -- .../01-driver/files/seeed-voicecard-v2 | 134 ------------------ .../01-driver/files/seeed-voicecard.service | 20 --- .../01-install-driver-package/01-run.sh | 7 + .../02-set-audio-volume/01-run.sh | 14 -- .../files/configure_audio.service | 15 -- .../files/configure_audio.sh | 102 ------------- CLAUDE.md | 6 +- README.md | 13 +- breaking_changes.md | 2 + docs/hardware_2mic_v1.md | 13 ++ 14 files changed, 31 insertions(+), 445 deletions(-) delete mode 100644 02-stage-audiodriver-2michat-v1/01-driver/01-packages delete mode 100755 02-stage-audiodriver-2michat-v1/01-driver/02-run.sh delete mode 100755 02-stage-audiodriver-2michat-v1/01-driver/03-run-chroot.sh delete mode 100644 02-stage-audiodriver-2michat-v1/01-driver/files/51-disable-acp.conf delete mode 100644 02-stage-audiodriver-2michat-v1/01-driver/files/seeed-voicecard-v2 delete mode 100644 02-stage-audiodriver-2michat-v1/01-driver/files/seeed-voicecard.service create mode 100755 02-stage-audiodriver-2michat-v1/01-install-driver-package/01-run.sh delete mode 100755 02-stage-audiodriver-2michat-v1/02-set-audio-volume/01-run.sh delete mode 100644 02-stage-audiodriver-2michat-v1/02-set-audio-volume/files/configure_audio.service delete mode 100644 02-stage-audiodriver-2michat-v1/02-set-audio-volume/files/configure_audio.sh diff --git a/02-stage-audiodriver-2michat-v1/01-driver/01-packages b/02-stage-audiodriver-2michat-v1/01-driver/01-packages deleted file mode 100644 index ae3af70..0000000 --- a/02-stage-audiodriver-2michat-v1/01-driver/01-packages +++ /dev/null @@ -1,9 +0,0 @@ -git -build-essential -dkms -curl -linux-headers-rpi-v8 -dkms -i2c-tools -libasound2-plugins -alsa-utils \ No newline at end of file diff --git a/02-stage-audiodriver-2michat-v1/01-driver/02-run.sh b/02-stage-audiodriver-2michat-v1/01-driver/02-run.sh deleted file mode 100755 index 39472b6..0000000 --- a/02-stage-audiodriver-2michat-v1/01-driver/02-run.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -e - -echo "installing respeaker systemd daemon" - -# Install the new seeed-voicecard-v2 script -install -v -m 755 files/seeed-voicecard-v2 "${ROOTFS_DIR}/usr/bin/seeed-voicecard-v2" - -# Copy the systemd service -install -v -m 644 files/seeed-voicecard.service "${ROOTFS_DIR}/etc/systemd/system/seeed-voicecard.service" - -# Enable the service directly -on_chroot << EOF -systemctl daemon-reload -systemctl enable seeed-voicecard.service -EOF - -# disable acp -mkdir -p "${ROOTFS_DIR}/etc/wireplumber/wireplumber.conf.d" -install -v -m 644 files/51-disable-acp.conf "${ROOTFS_DIR}/etc/wireplumber/wireplumber.conf.d/51-disable-acp.conf" diff --git a/02-stage-audiodriver-2michat-v1/01-driver/03-run-chroot.sh b/02-stage-audiodriver-2michat-v1/01-driver/03-run-chroot.sh deleted file mode 100755 index e259829..0000000 --- a/02-stage-audiodriver-2michat-v1/01-driver/03-run-chroot.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/bash -e - -# Installs drivers for the ReSpeaker 2mic and 4mic HATs on Raspberry Pi OS. -# Must be run with sudo. -# Requires: curl raspberrypi-kernel-headers dkms i2c-tools libasound2-plugins alsa-utils - -echo "Starting respeaker driver installation..." - -if [ -d "/seeedstudio_driver" ]; then - echo "/seeedstudio_driver directory already existent. I delete it now!" - rm -rf /seeedstudio_driver -fi -mkdir /seeedstudio_driver -cd /seeedstudio_driver - -ver="0.3" -OVERLAYS=/boot/overlays - -echo "Debug1" -ls -l /proc/version -echo "Debug2" -cat /proc/version -echo "Debug3" -ls -l /boot/ -echo "Debug4" -ls -l - -all_kernel_versions=$(ls /boot/vmlinuz-* | grep -oP '(?<=/boot/vmlinuz-)\K[0-9]+\.[0-9]+' | sort -u) - -# Schleife über alle gefundenen Kernel -for kernel_version in $all_kernel_versions; do - echo "Verarbeite Kernel: $kernel" - # Read the kernel version - #kernel_formatted="$(echo $kernel | grep -oP '\K[0-9]+\.[0-9]+' | sort -V | tail -n 1)" - - mkdir $kernel_version - cd $kernel_version - - echo "Checking download source" - driver_url_status="$(curl -ILs https://github.com/HinTak/seeed-voicecard/archive/refs/heads/v$kernel_version.tar.gz | tac | grep -o "^HTTP.*" | cut -f 2 -d' ' | head -1)" - if [ ! "$driver_url_status" = 200 ]; then - echo "Could not find driver for kernel $kernel_version" - exit 1 - fi - - # Download source code to temporary directory - # NOTE: There are different branches in the repo for different kernel versions. - echo 'Downloading source code' - wget "https://github.com/HinTak/seeed-voicecard/archive/refs/heads/v$kernel_version.tar.gz" - tar -xf v$kernel_version.tar.gz - cd "seeed-voicecard-$kernel_version" - - # 1. Build kernel module - echo 'Building kernel module' - mod='seeed-voicecard' - version="$kernel_version" # 6.6 - src='./' - marker='0.0.0' - - mkdir -p "/usr/src/${mod}-${version}" - cp -a "${src}"/* "/usr/src/${mod}-${version}/" - dkms add -m "${mod}" -v "${version}" - - # get all possible kernels for this version - kernels=$(ls /boot/vmlinuz-* | grep -oP '(?<=/boot/vmlinuz-).*' | grep $kernel_version) - - # build module for each possible kernel - for kernel in $kernels; do - dkms build -k "${kernel}" -m "${mod}" -v "${version}" && { - dkms install --force -k "${kernel}" -m "${mod}" -v "${version}" - } - done - - mkdir -p "/var/lib/dkms/${mod}/${version}/${marker}" - - # Copy Device Tree Overlays - cp seeed-*-voicecard.dtbo /boot/overlays - - #install config files - mkdir /etc/voicecard || true - cp *.conf /etc/voicecard - cp *.state /etc/voicecard - - cd .. - cd .. -done - -#set kernel modules -grep -q "^snd-soc-seeed-voicecard$" /etc/modules || \ - echo "snd-soc-seeed-voicecard" >> /etc/modules -grep -q "^snd-soc-ac108$" /etc/modules || \ - echo "snd-soc-ac108" >> /etc/modules -grep -q "^snd-soc-wm8960$" /etc/modules || \ - echo "snd-soc-wm8960" >> /etc/modules - -# detect boot config -CONFIG=/boot/config.txt -[ -f /boot/firmware/config.txt ] && CONFIG=/boot/firmware/config.txt -[ -f /boot/firmware/usercfg.txt ] && CONFIG=/boot/firmware/usercfg.txt - -# set boot params -sed -i -e 's:#dtparam=i2c_arm=on:dtparam=i2c_arm=on:g' $CONFIG || true -sed -i -e 's:#dtparam=i2s=on:dtparam=i2s=on:g' $CONFIG || true -sed -i -e 's:#dtparam=spi=on:dtparam=spi=on:g' $CONFIG || true -grep -q "^dtoverlay=i2s-mmap$" $CONFIG || \ - echo "dtoverlay=i2s-mmap" >> $CONFIG - -echo 'Done. Please reboot the system.' diff --git a/02-stage-audiodriver-2michat-v1/01-driver/files/51-disable-acp.conf b/02-stage-audiodriver-2michat-v1/01-driver/files/51-disable-acp.conf deleted file mode 100644 index 98ce8bd..0000000 --- a/02-stage-audiodriver-2michat-v1/01-driver/files/51-disable-acp.conf +++ /dev/null @@ -1,14 +0,0 @@ -monitor.alsa.rules = [ - { - matches = [ - { - device.name = "~alsa_card.*" - } - ] - actions = { - update-props = { - api.alsa.use-acp = false - } - } - } -] diff --git a/02-stage-audiodriver-2michat-v1/01-driver/files/seeed-voicecard-v2 b/02-stage-audiodriver-2michat-v1/01-driver/files/seeed-voicecard-v2 deleted file mode 100644 index 2813955..0000000 --- a/02-stage-audiodriver-2michat-v1/01-driver/files/seeed-voicecard-v2 +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2018 Baozhu Zuo -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -#set -x -#exec 1>/var/log/$(basename $0).log 2>&1 - -export PATH=$PATH:/opt/vc/bin - -check_pipewire() { - local MAX_TRIES=30 - local SLEEP_SEC=1 - local COUNT=0 - - while [ $COUNT -lt $MAX_TRIES ]; do - COUNT=$((COUNT + 1)) - - # Check if XDG_RUNTIME_DIR is set - if [ -z "$XDG_RUNTIME_DIR" ]; then - echo "❌ XDG_RUNTIME_DIR is not set" - return 1 - fi - - # Check if PipeWire is running - if pw-cli info 0 >/dev/null 2>&1; then - echo "✅ PipeWire is running (checked $COUNT/$MAX_TRIES)" - return 0 - fi - - echo "⏳ PipeWire not running yet ($COUNT/$MAX_TRIES), retrying in $SLEEP_SEC s..." - sleep $SLEEP_SEC - done - - echo "❌ PipeWire did not start after $MAX_TRIES seconds" - return 2 -} - -# Run pipewire check -check_pipewire - -# load i2c module -modprobe i2c-dev - -# detect boot config -CONFIG=/boot/config.txt -[ -f /boot/firmware/config.txt ] && CONFIG=/boot/firmware/config.txt -[ -f /boot/firmware/usercfg.txt ] && CONFIG=/boot/firmware/usercfg.txt - -# detect hardware -is_1a=$(i2cdetect -y 1 0x1a 0x1a | egrep "(1a|UU)" | awk '{print $2}') -is_35=$(i2cdetect -y 1 0x35 0x35 | egrep "(35|UU)" | awk '{print $2}') -is_3b=$(i2cdetect -y 1 0x3b 0x3b | egrep "(3b|UU)" | awk '{print $2}') - -RPI_HATS="seeed-2mic-voicecard seeed-4mic-voicecard seeed-6mic-voicecard" -overlay="" - -if [ "x${is_1a}" != "x" ] && [ "x${is_35}" == "x" ] ; then - echo "install 2mic" - overlay=seeed-2mic-voicecard - asound_conf=/etc/voicecard/asound_2mic.conf - asound_state=/etc/voicecard/wm8960_asound.state -fi - -if [ "x${is_3b}" != "x" ] && [ "x${is_35}" == "x" ] ; then - echo "install 4mic" - overlay=seeed-4mic-voicecard - asound_conf=/etc/voicecard/asound_4mic.conf - asound_state=/etc/voicecard/ac108_asound.state -fi - -if [ "x${is_3b}" != "x" ] && [ "x${is_35}" != "x" ] ; then - echo "install 6mic" - overlay=seeed-6mic-voicecard - asound_conf=/etc/voicecard/asound_6mic.conf - asound_state=/etc/voicecard/ac108_6mic.state -fi - -# config asound config and state -if [ "$overlay" ]; then - echo Configure $overlay driver - - # Remove any existing dtoverlay entries for seeed voice cards - if [ -f "$CONFIG" ]; then - sed -i '/^dtoverlay=seeed-2mic-voicecard/d' "$CONFIG" - sed -i '/^dtoverlay=seeed-4mic-voicecard/d' "$CONFIG" - sed -i '/^dtoverlay=seeed-6mic-voicecard/d' "$CONFIG" - - grep -q "^dtoverlay=$overlay$" $CONFIG || \ - echo "dtoverlay=$overlay" >> $CONFIG - fi - - echo "Remove old configuration" - rm /etc/asound.conf - rm /var/lib/alsa/asound.state - - echo "create $overlay asound configure file" - cp $asound_conf /etc/asound.conf - echo "create $overlay asound status file" - cp $asound_state /var/lib/alsa/asound.state -fi - -# restore alsa -echo "restore alsa sound settings" -alsactl restore - -# Force 3.5mm ('headphone') jack -echo "Force 3.5mm (headphone-jack)" -# The Raspberry Pi 4, released on 24th Jun 2019, has two HDMI ports, -# and can drive two displays with audios for two users simultaneously, -# in a "multiseat" configuration. The earlier single virtual ALSA -# option for re-directing audio playback between headphone jack and HDMI -# via a 'Routing' mixer setting was turned off eventually to allow -# simultaneous usage of all 3 playback devices. -if aplay -l | grep -q "bcm2835 ALSA"; then - amixer cset numid=3 1 || true -fi diff --git a/02-stage-audiodriver-2michat-v1/01-driver/files/seeed-voicecard.service b/02-stage-audiodriver-2michat-v1/01-driver/files/seeed-voicecard.service deleted file mode 100644 index de47f48..0000000 --- a/02-stage-audiodriver-2michat-v1/01-driver/files/seeed-voicecard.service +++ /dev/null @@ -1,20 +0,0 @@ -[Unit] -Description=Seeed Voicecard setup -After=user@1000.service sound.target alsa-restore.service -Wants=user@1000.service sound.target alsa-restore.service -Requires=user@1000.service -ConditionPathExists=!/var/lib/seeed-voicecard/success - -[Service] -Type=oneshot -User=root -Environment=XDG_RUNTIME_DIR=/run/user/1000 -ExecStart=/usr/bin/seeed-voicecard-v2 -ExecStartPost=/usr/bin/mkdir -p /var/lib/seeed-voicecard -ExecStartPost=/usr/bin/touch /var/lib/seeed-voicecard/success -ExecStartPost=/bin/systemctl --no-block reboot -Restart=on-failure -RestartSec=10s - -[Install] -WantedBy=multi-user.target diff --git a/02-stage-audiodriver-2michat-v1/01-install-driver-package/01-run.sh b/02-stage-audiodriver-2michat-v1/01-install-driver-package/01-run.sh new file mode 100755 index 0000000..da64f45 --- /dev/null +++ b/02-stage-audiodriver-2michat-v1/01-install-driver-package/01-run.sh @@ -0,0 +1,7 @@ +#!/bin/bash -e + +# The package brings the device tree overlay, the boot configuration and an ACP profile set for the ReSpeaker 2-Mics Pi HAT v1 +on_chroot << EOF2 +apt-get update +apt-get install -y picompose-driver-2michat-v1 +EOF2 diff --git a/02-stage-audiodriver-2michat-v1/02-set-audio-volume/01-run.sh b/02-stage-audiodriver-2michat-v1/02-set-audio-volume/01-run.sh deleted file mode 100755 index f0845ca..0000000 --- a/02-stage-audiodriver-2michat-v1/02-set-audio-volume/01-run.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -e - -# Install the compose-manager script -install -v -m 755 files/configure_audio.sh "${ROOTFS_DIR}/usr/bin/configure_audio.sh" - -# Copy the systemd service -install -v -m 644 files/configure_audio.service "${ROOTFS_DIR}/etc/systemd/system/configure_audio.service" - -on_chroot << EOF -# Enable services -echo "Enable audio services" -systemctl daemon-reload -systemctl enable configure_audio.service -EOF diff --git a/02-stage-audiodriver-2michat-v1/02-set-audio-volume/files/configure_audio.service b/02-stage-audiodriver-2michat-v1/02-set-audio-volume/files/configure_audio.service deleted file mode 100644 index baa3d2c..0000000 --- a/02-stage-audiodriver-2michat-v1/02-set-audio-volume/files/configure_audio.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=PiCompose - Configure Audio volume setting -After=user@1000.service sound.target alsa-restore.service seeed-voicecard.service -Wants=user@1000.service sound.target alsa-restore.service seeed-voicecard.service - -[Service] -Type=oneshot -Environment=XDG_RUNTIME_DIR=/run/user/1000 -ExecStart=/usr/bin/configure_audio.sh -RemainAfterExit=yes -Restart=on-failure -RestartSec=30s - -[Install] -WantedBy=multi-user.target diff --git a/02-stage-audiodriver-2michat-v1/02-set-audio-volume/files/configure_audio.sh b/02-stage-audiodriver-2michat-v1/02-set-audio-volume/files/configure_audio.sh deleted file mode 100644 index 326c235..0000000 --- a/02-stage-audiodriver-2michat-v1/02-set-audio-volume/files/configure_audio.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/bash -set -u - - -set_volume_safe() { - local volume="${1:-1.0}" - - if wpctl get-volume @DEFAULT_AUDIO_SINK@ >/dev/null 2>&1; then - wpctl set-volume @DEFAULT_AUDIO_SINK@ "$volume" - echo "Volume set to $volume" - return 0 - else - echo "No default audio sink available" - exit 1 - fi -} - -wait_for_audio() { - local max_tries="${1:-30}" - local sleep_time="${2:-1}" - - local i=0 - while [ $i -lt $max_tries ]; do - if wpctl get-volume @DEFAULT_AUDIO_SINK@ >/dev/null 2>&1; then - echo "Audio ready" - return 0 - fi - - echo "Waiting for audio... ($i/$max_tries)" - sleep "$sleep_time" - i=$((i+1)) - done - - echo "Timeout: Audio not ready" - exit 1 -} - -wait_for_card_and_control() { - local card="$1" - local control="$2" - local max_tries=30 - local sleep_sec=1 - local count=0 - - while [ "$count" -lt "$max_tries" ]; do - count=$((count + 1)) - - if amixer -c "$card" info >/dev/null 2>&1; then - if amixer -c "$card" scontrols | grep -Fq "'$control'"; then - echo "Card $card with control '$control' is ready ($count/$max_tries)" - return 0 - fi - echo "Card $card found, but control '$control' not ready yet ($count/$max_tries)" - else - echo "Card $card not ready yet ($count/$max_tries)" - fi - - sleep "$sleep_sec" - done - - echo "Card $card with control '$control' did not become ready" - return 1 -} - -set_control_if_exists() { - local card="$1" - local control="$2" - local value="$3" - - if amixer -c "$card" scontrols | grep -Fq "'$control'"; then - echo "Setting $control on $card to $value" - amixer -c "$card" set "$control" "$value" - return 0 - fi - - echo "Control '$control' not found on $card, skipping" - return 0 -} - -# Wait for audio system to be ready -wait_for_audio 30 1 - -# Check if the card is ok -if wait_for_card_and_control seeed2micvoicec Headphone; then - CARD="seeed2micvoicec" - echo "seeed2micvoicec found" -else - echo "No supported sound card became ready" - exit 1 -fi - -# Set volume -set_control_if_exists "$CARD" Headphone 100% -set_control_if_exists "$CARD" Speaker 100% -set_control_if_exists "$CARD" Master 100% -set_control_if_exists "$CARD" PCM 100% - -# Set pipewire sink volume -set_volume_safe 1.0 - -# Alsa save -alsactl store diff --git a/CLAUDE.md b/CLAUDE.md index ac02d29..bc1470f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -45,9 +45,9 @@ Every variant is `stage0 stage1 stage2 ./01-stage-base [] [./03- The images `PiCompose` and `PiCompose_Linux-Voice-Assistant` for hardware without a driver have no hardware stage. The volume default of a sound card comes from `picompose-core` (`51-default-volume.conf`). -Driver approach differs per hardware, all in `01-driver/03-run-chroot.sh`: -- `2michat-v1` builds the seeed-voicecard DKMS driver and ships `seeed-voicecard.service`. The README flags this image as pinned to an older build, see the linked upstream issue. -- `2michat-v2` only builds a device-tree overlay, the codec driver is in the mainline kernel. +Driver approach differs per hardware: +- `2michat-v1` installs the package `picompose-driver-2michat-v1` from the APT repository (`01-install-driver-package/01-run.sh`). The package builds the device-tree overlay `respeaker-2mic-v1_0` of Seeed, enables I2C and SPI and ships an ACP profile set, the codec driver (`snd-soc-wm8960`) is in the Raspberry Pi kernel. There is no DKMS driver any more, so the 4-Mics and 6-Mics HATs (AC108 codec) are not supported. +- `2michat-v2` installs the package `picompose-driver-2michat-v2` from the APT repository, which builds a device-tree overlay, the codec driver is in the mainline kernel. - `satellite1-v1.0` downloads a custom FutureProofHomes kernel and setup/SDK `.deb` packages from GitHub releases. Bumping those versions changes the image kernel. ## pi-gen conventions used here diff --git a/README.md b/README.md index 6695427..7f979f2 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,11 @@ PiCompose uses the official [pi-gen](https://github.com/RPi-Distro/pi-gen) tool The image is configured to: 1. Install needed drivers for the hardware (2-MicHat, Satellite1) -2. Start seeed-voicecard service (If you use 2-MicHat) -3. Start Pipewire service -4. Start Keep-Audio-Alive service (If you use Respeaker Lite) -5. Set system audio volume to 100% -6. Set hostname -7. Search for Docker Compose files in a special directory on the main partition +2. Start Pipewire service +3. Start Keep-Audio-Alive service (If you use Respeaker Lite) +4. Set system audio volume to 100% +5. Set hostname +6. Search for Docker Compose files in a special directory on the main partition 💡 **Note:** If you use the Linux-Voice-Assistant Image LVA and Snapcast will be included in the project directory. They come from the package `picompose-software-ha-satellite` of the [PiCompose APT repository](https://github.com/florian-asche/PiCompose-Repository). 8. Automatically deploy each Docker Compose project found 9. Optionally set up regular re-deployments via Crontab @@ -49,7 +48,7 @@ Here is a Overview for the specific images of each hardware: | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Base Image** | If you use other hardware... | • Docker & Docker Compose (piCompose)
• Automatic Docker Compose deployment
• Pipewire Audio Server
• SSH enabled (pi User) | | **[Satellite1](docs/hardware_sattelite1.md)** | ReSpeaker Lite Board | • * Everything from Base Image
• Satellite1 Hat Driver
• Linux-Voice-Assistant (OpenHomeFoundation)
• Snapcast MultiRoom Audio Client
• Pre-configured for Home Assistant | -| **[ReSpeaker 2-Mic HAT v1](docs/hardware_2mic_v1.md)** | ReSpeaker 2-Mics Pi HAT | • * Everything from Base Image
• Seeed Voicecard Driver
• Linux-Voice-Assistant (OpenHomeFoundation)
• Snapcast MultiRoom Audio Client
• Pre-configured for Home Assistant

Current latest available build version is 1.1.1 See [#41](https://github.com/HinTak/seeed-voicecard/issues/41) | +| **[ReSpeaker 2-Mic HAT v1](docs/hardware_2mic_v1.md)** | ReSpeaker 2-Mics Pi HAT | • * Everything from Base Image
• Seeed Voicecard Driver (overlay)
• Linux-Voice-Assistant (OpenHomeFoundation)
• Snapcast MultiRoom Audio Client
• Pre-configured for Home Assistant | | **[ReSpeaker 2-Mic HAT v2.0](docs/hardware_2mic_v2.md)** | ReSpeaker 2-Mics Pi HAT | • * Everything from Base Image
• Seeed Voicecard Driver
• Linux-Voice-Assistant (OpenHomeFoundation)
• Snapcast MultiRoom Audio Client
• Pre-configured for Home Assistant | | **[ReSpeaker Lite](docs/hardware_respeaker_lite.md)** | ReSpeaker Lite Board | • * Everything from Base Image
• Audio keep-alive service
• Linux-Voice-Assistant (OpenHomeFoundation)
• Snapcast MultiRoom Audio Client
• Pre-configured for Home Assistant
• Workaround for connectivity issues in combination with the Pi Zero 2W. | diff --git a/breaking_changes.md b/breaking_changes.md index dd56829..6c67e55 100644 --- a/breaking_changes.md +++ b/breaking_changes.md @@ -9,6 +9,8 @@ The stage `02-stage-audiodriver-other` is removed, the images `PiCompose` and `P The driver of the ReSpeaker 2-Mics Pi HAT V2.0 image is installed by the package `picompose-driver-2michat-v2` instead of the image build. The package brings the device tree overlay, the boot configuration and an ACP profile set for the sound card, which no longer turns ACP off (`51-disable-acp.conf` is gone). `configure_audio.service` and `/usr/bin/configure_audio.sh` are gone, which set the outputs of the TLV320 codec to 100 %, the input gain to 80 %, the volume of the default sink to 100 % and ran `alsactl store` at every start. The profile set of the package now puts `HP DAC` and `Line DAC` at 0 dB at a sink volume of 100 % and lets the sink volume change them. The other controls (`HP`, `HPCOM DAC`, and the input gain `PGA`, which was 80 % and is now left at the 27 % of the codec) are no longer set. On an existing image, `apt upgrade` leaves a dangling `configure_audio.service` symlink behind. +The driver of the ReSpeaker 2-Mics Pi HAT v1 image is installed by the package `picompose-driver-2michat-v1` instead of the image build. The DKMS driver of HinTak/seeed-voicecard is gone: the package loads the overlay `respeaker-2mic-v1_0` of Seeed (`dtoverlay=respeaker-2mic-v1_0`) and uses the WM8960 driver of the Raspberry Pi kernel, and it enables `dtparam=i2c_arm=on` and `dtparam=spi=on`. `seeed-voicecard.service` is gone, which detected the HAT at the first start, replaced `/etc/asound.conf` and the ALSA state with the files of the HAT, and rebooted the system once. `dtparam=i2s=on` and `dtoverlay=i2s-mmap` are no longer set, the 4-Mics and 6-Mics HATs are no longer supported. The package ships an ACP profile set for the sound card, which no longer turns ACP off (`51-disable-acp.conf` is gone). `configure_audio.service` and `/usr/bin/configure_audio.sh` are gone, which set `Headphone`, `Speaker`, `Master` and `PCM` of the card and the volume of the default sink to 100 % and ran `alsactl store` at every start. The profile set of the package now merges `Headphone` and `Speaker` into the sink volume, so a sink volume of 100 % puts both at their maximum (+6 dB), and sets `Playback` to 0 dB. On an existing image, `apt upgrade` does not remove the old `51-disable-acp.conf`, which keeps the profile set from working, and leaves a dangling `configure_audio.service` symlink behind. `apt upgrade` removes the `dtoverlay=seeed-*-voicecard` lines from the boot configuration, but not `dtoverlay=i2s-mmap`, `dtparam=i2s=on` and `/etc/asound.conf`. + The audio setup of the Satellite1 image is installed from the APT repository instead of being downloaded from GitHub: the packages `satellite1-rpi-setup-trixie` and `satellite1-rpi-sdk` of FutureProofHomes are republished unchanged by PiCompose-Package-Driver-Satellite1. The image build no longer copies `51-disable-acp.conf`, `configure_audio.service` and `/usr/bin/configure_audio.sh`, and it no longer installs the custom kernel `linux-image-6.18.34-fusb302-rpi-v8`, the Satellite1 relies on the fusb302 driver of the Raspberry Pi kernel since 6.18. The microphone works with the ACP profile set of `satellite1-rpi-setup-trixie` 1.5-1, which replaces `51-disable-acp.conf`. On an existing image, `apt upgrade` does not remove the old `51-disable-acp.conf` and the dangling `configure_audio.service` symlink. The audio setup of the ReSpeaker Lite image is installed by the package `picompose-driver-respeaker-lite` instead of the image build. `keep-audio-alive.service` stays. `configure_audio.service` and `/usr/bin/configure_audio.sh` are gone, which set the volume of the default sink to 100 % at every start. The default volume of a sound card without a stored state is now 100 % through `picompose-core` (`51-default-volume.conf`), a volume that WirePlumber has already stored for the card is kept. On an existing image, `apt upgrade` leaves a dangling `configure_audio.service` symlink behind. diff --git a/docs/hardware_2mic_v1.md b/docs/hardware_2mic_v1.md index 11c9b3e..301460d 100644 --- a/docs/hardware_2mic_v1.md +++ b/docs/hardware_2mic_v1.md @@ -23,7 +23,20 @@ Features: - [ReSpeaker 2Mic HAT](https://wiki.keyestudio.com/Ks0314_keyestudio_ReSpeaker_2-Mic_Pi_HAT_V1.0) - [Cable for Speaker](https://amzn.to/3ZvU0Dz) +## Technical notes + +The v1 has a WM8960 codec (I2C `0x1a`). The Raspberry Pi OS kernel already has its driver (`snd-soc-wm8960`), so no kernel module is built. The image only needs: + +1. The device-tree overlay `respeaker-2mic-v1_0.dtbo` (built from [Seeed-Studio/seeed-linux-dtoverlays](https://github.com/Seeed-Studio/seeed-linux-dtoverlays)), enabled via `dtoverlay=respeaker-2mic-v1_0` in `/boot/firmware/config.txt`. It names the card `seeed2micvoicec`. +2. `dtparam=i2c_arm=on` and `dtparam=spi=on` (SPI is for the LEDs of the HAT) in `/boot/firmware/config.txt`. +3. Volume: the WM8960 starts with `Headphone` at 0 (-121 dB), which is nearly silent. + +The PiCompose `02-stage-audiodriver-2michat-v1` stage installs the package `picompose-driver-2michat-v1` from the APT repository ([PiCompose-Package-Driver-2MicHat-V1](https://github.com/florian-asche/PiCompose-Package-Driver-2MicHat-V1)), which does the first two steps. For step 3 the package ships an ACP profile set for the sound card, selected by a udev rule. It merges `Headphone` and `Speaker` into the volume of the PipeWire sink and sets the digital volume `Playback` to 0 dB, so the default volume of 100 % (`51-default-volume.conf` of `picompose-core`) puts both outputs at their maximum (+6 dB), and a lower sink volume lowers them. Checked on one device after a reboot with the package 1.0.2: the controls follow the sink volume. How loud the card is has not been checked for every case. + +The 4-Mics and 6-Mics HATs have an AC108 codec, which the kernel does not have. They are not supported by this stage any more. + ## Additional information: - [Wiki](https://github.com/Seeed-Studio/wiki-documents/blob/docusaurus-version/docs/Sensor/ReSpeaker_2-Mics_Pi_HAT/v1-deprecated/ReSpeaker_2_Mics_Pi_HAT_Raspberry.md) +- [seeed-linux-dtoverlays (overlay source)](https://github.com/Seeed-Studio/seeed-linux-dtoverlays) - [Keyestudio documentation](https://docs.keyestudio.com/projects/KS0314/en/latest/docs/KS0314.html#overview)