Skip to content

Commit dbbf003

Browse files
committed
fix(2michat-v2): wire CI, guard mixer service, drop dead code
Follow-up to the initial 02-stage-audiodriver-2michat-v2 commit: - build-all.yml: add build-2michat-v2 and build-2michat-v2-lva jobs and include them in generate-rpi-imager-json.needs. Without this the new stage exists but no image is ever produced. - configure_audio.service: add ConditionPathExists=!/var/lib/configure_audio/success + ExecStartPost touch marker so mixer tuning runs once on first boot and subsequent manual amixer + alsactl store customisations survive reboots. Without the guard every boot reset the mixer to the stage's canned defaults. - configure_audio.sh: drop the wpctl block. The service runs as root under systemd; wpctl requires the PipeWire user session (uid 1000) and the existing `|| true` made it a silent no-op. - 01-driver/01-packages: drop i2c-tools (no runtime hardware detection on v2 — the overlay is fixed) and libasound2-plugins (v2 does not install a custom asound.conf that references resample plugins). - docs/hardware_2mic_v2.md + README.md: add a v2 hardware page and two README rows (base + LVA) mirroring the v1 entries.
1 parent 4f4d110 commit dbbf003

6 files changed

Lines changed: 66 additions & 8 deletions

File tree

.github/workflows/build-all.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,25 @@ jobs:
4141
compression-level: 6
4242
custom-hostname: picompose
4343

44+
# 2MICHAT-v2
45+
build-2michat-v2:
46+
uses: ./.github/workflows/build-image-template.yml
47+
with:
48+
image-name: PiCompose-2MicHat-v2
49+
stage-list: stage0 stage1 stage2 ./01-stage-picompose ./02-stage-audiodriver-2michat-v2 ./04-stage-finish
50+
compression: xz
51+
compression-level: 6
52+
custom-hostname: picompose
53+
54+
build-2michat-v2-lva:
55+
uses: ./.github/workflows/build-image-template.yml
56+
with:
57+
image-name: PiCompose_2MicHat-v2_Linux-Voice-Assistant
58+
stage-list: stage0 stage1 stage2 ./01-stage-picompose ./02-stage-audiodriver-2michat-v2 ./03-stage-linux-voice-assistant ./04-stage-finish
59+
compression: xz
60+
compression-level: 6
61+
custom-hostname: picompose
62+
4463
# RESPEAKER-LITE
4564
build-respeaker_lite:
4665
uses: ./.github/workflows/build-image-template.yml
@@ -62,5 +81,5 @@ jobs:
6281

6382
# RPI IMAGER JSON
6483
generate-rpi-imager-json:
65-
needs: [build, build-2michat, build-respeaker_lite, build-2michat-lva, build-respeaker_lite-lva]
84+
needs: [build, build-2michat, build-2michat-v2, build-respeaker_lite, build-2michat-lva, build-2michat-v2-lva, build-respeaker_lite-lva]
6685
uses: ./.github/workflows/create-rpi-image-json.yml
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
git
22
build-essential
33
device-tree-compiler
4-
i2c-tools
5-
libasound2-plugins
64
alsa-utils

02-stage-audiodriver-2michat-v2/02-set-audio-volume/files/configure_audio.service

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
Description=PiCompose - Configure Audio volume setting (ReSpeaker 2-Mic HAT V2.0)
33
After=sound.target alsa-restore.service
44
Wants=sound.target alsa-restore.service
5+
ConditionPathExists=!/var/lib/configure_audio/success
56

67
[Service]
78
Type=oneshot
89
ExecStart=/usr/bin/configure_audio.sh
10+
ExecStartPost=/usr/bin/mkdir -p /var/lib/configure_audio
11+
ExecStartPost=/usr/bin/touch /var/lib/configure_audio/success
912
RemainAfterExit=yes
1013
Restart=on-failure
1114
RestartSec=30s

02-stage-audiodriver-2michat-v2/02-set-audio-volume/files/configure_audio.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,4 @@ set_control_if_exists "$CARD" "Line DAC" 100%
7272
set_control_if_exists "$CARD" "HP" 100% unmute
7373
set_control_if_exists "$CARD" "Line" 100% unmute
7474

75-
# Default-route PipeWire sink to max; application-level volume still applies.
76-
if command -v wpctl >/dev/null 2>&1; then
77-
wpctl set-volume @DEFAULT_AUDIO_SINK@ 1.0 || true
78-
fi
79-
8075
alsactl store

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ Here is a Overview for the specific images of each hardware:
5252
| **[Sattelite1](docs/hardware_sattelite1.md)**<br>**+Linux-Voice-Assistant**<br>**+Snapcast** | <img src="docs/sattelite1-hat.jpg" alt="ReSpeaker Lite Board" style="width: 200px; height: auto;"> | • Satellite1 Hat Image<br>• Linux-Voice-Assistant (OpenHomeFoundation)<br>• Snapcast MultiRoom Audio Client<br>• Pre-configured for Home Assistant<br><br><span style="color: red;">Image is currently work in progress!</span> |
5353
| **[ReSpeaker 2-Mic HAT v1](docs/hardware_2mic_v1.md)** | <img src="docs/respeaker_2michats.webp" alt="ReSpeaker 2-Mics Pi HAT" style="width: 200px; height: auto;"> | • Base Image<br>• Seeed Voicecard Driver |
5454
| **[ReSpeaker 2-Mic HAT v1](docs/hardware_2mic_v1.md)**<br>**+Linux-Voice-Assistant**<br>**+Snapcast** | <img src="docs/respeaker_2michats.webp" alt="ReSpeaker 2-Mics Pi HAT" style="width: 200px; height: auto;"> | • 2-Mic HAT Image<br>• Linux-Voice-Assistant (OpenHomeFoundation)<br>• 2-Mic HAT GPIO LED Control<br>• Snapcast MultiRoom Audio Client<br>• Pre-configured for Home Assistant |
55+
| **[ReSpeaker 2-Mic HAT v2.0](docs/hardware_2mic_v2.md)** | <img src="docs/respeaker_2michats.webp" alt="ReSpeaker 2-Mics Pi HAT" style="width: 200px; height: auto;"> | • Base Image<br>• TLV320AIC3104 device-tree overlay<br>• First-boot mixer tuning for the V2.0 codec |
56+
| **[ReSpeaker 2-Mic HAT v2.0](docs/hardware_2mic_v2.md)**<br>**+Linux-Voice-Assistant**<br>**+Snapcast** | <img src="docs/respeaker_2michats.webp" alt="ReSpeaker 2-Mics Pi HAT" style="width: 200px; height: auto;"> | • 2-Mic HAT v2.0 Image<br>• Linux-Voice-Assistant (OpenHomeFoundation)<br>• Snapcast MultiRoom Audio Client<br>• Pre-configured for Home Assistant |
5557
| **[ReSpeaker Lite](docs/hardware_respeaker_lite.md)** | <img src="docs/respeaker_lite.jpg" alt="ReSpeaker Lite Board" style="width: 200px; height: auto;"> | • Base Image<br>• Audio keep-alive service<br>• Workaround for connectivity issues in combination with the Pi Zero 2W.<br><br><span style="color: red;">There is a USB connectivity issue with the Pi Zero 2W. I cannot recommend this board if you want to use it with that. Use Pi3 or higher.</span> |
5658
| **[ReSpeaker Lite](docs/hardware_respeaker_lite.md)**<br>**+Linux-Voice-Assistant**<br>**+Snapcast** | <img src="docs/respeaker_lite.jpg" alt="ReSpeaker Lite Board" style="width: 200px; height: auto;"> | • ReSpeaker Lite Image<br>• Linux-Voice-Assistant (OpenHomeFoundation)<br>• Snapcast MultiRoom Audio Client<br>• Pre-configured for Home Assistant<br>• Workaround for connectivity issues in combination with the Pi Zero 2W.<br><br><span style="color: red;">There is a USB connectivity issue with the Pi Zero 2W. If you want to use it with that, you need to use Pi3 or higher.</span> |
5759

docs/hardware_2mic_v2.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Hardware - ReSpeaker 2-Mics Pi HAT v2.0
2+
3+
<img src="respeaker_2michats.webp" alt="ReSpeaker 2-Mics Pi HAT" style="width: 300px; height: auto;"></img>
4+
5+
The V2.0 is a silent hardware revision of the 2-Mics Pi HAT. Visually identical, electrically different: the WM8960 codec used on v1 (I2C `0x1a`) is replaced with a **TLV320AIC3104** codec (I2C `0x18`). This matters because the v1 driver stage does not produce a working sound card on v2 hardware, and because the mixer defaults differ.
6+
7+
Features (same as v1):
8+
- Support the Raspberry Pi 3B / 4B / Zero 2 W
9+
- Two microphones (Mic L and Mic R)
10+
- Two Grove connectors
11+
- One User-defined button
12+
- 3.5 mm audio interface
13+
- XH2.54-2P audio output interface
14+
15+
## Order
16+
17+
### Base:
18+
19+
- [Raspberry Pi Zero 2 W](https://amzn.to/3M0G4hC)
20+
- [SD-Card](https://amzn.to/4qfx06l)
21+
- [US MicroUSB Power Supply](https://amzn.to/4c52mt3)
22+
- [Cable for Speaker](https://amzn.to/3ZvU0Dz)
23+
24+
### ReSpeaker 2-Mics Pi HAT v2.0
25+
26+
- [Seeed Studio ReSpeaker 2-Mics Pi HAT V2.0](https://wiki.seeedstudio.com/respeaker_2_mics_pi_hat_v2/)
27+
28+
## Technical notes
29+
30+
Unlike v1 — which needs an out-of-tree DKMS kernel module — v2 uses the mainline `snd-soc-tlv320aic3x` driver that already ships with the Raspberry Pi OS kernel. The image only needs:
31+
32+
1. The device-tree overlay `respeaker-2mic-v2_0.dtbo` (built from [Seeed-Studio/seeed-linux-dtoverlays](https://github.com/Seeed-Studio/seeed-linux-dtoverlays)), enabled via `dtoverlay=respeaker-2mic-v2_0` in `/boot/firmware/config.txt`.
33+
2. `dtparam=i2c_arm=on` in `/boot/firmware/config.txt`.
34+
3. Mixer tuning on first boot — the TLV320 ships with three separate attenuators all well below 100 % (`HP DAC` at -23.5 dB in particular), producing a card that appears to work but is inaudible at typical application volumes.
35+
36+
The PiCompose `02-stage-audiodriver-2michat-v2` stage performs all three steps automatically. The mixer tuning runs once on first boot (guarded by `/var/lib/configure_audio/success`) so that subsequent manual `amixer` adjustments via `alsactl store` are preserved across reboots.
37+
38+
## Additional information
39+
40+
- [Seeed Studio Wiki — ReSpeaker 2-Mics Pi HAT v2.0](https://wiki.seeedstudio.com/respeaker_2_mics_pi_hat_v2/)
41+
- [seeed-linux-dtoverlays (overlay source)](https://github.com/Seeed-Studio/seeed-linux-dtoverlays)

0 commit comments

Comments
 (0)