Skip to content

Commit a7c7928

Browse files
Add Satellite1 v1.0 from FutureProofHomes (#51)
* feat(ci): add build workflows for satellite1-v1.0 Add new build jobs for Satellite-1 1.0 and its Linux Voice Assistant variant to the build-all workflow. This includes the addition of the `02-stage-audiodriver-satellite1-v1.0` stage. * temp disable rpi sdk * chore(scripts): add Satellite1 hardware types to imager JSON generator * refactor(scripts): remove hardcoded hardware types in imager generator Remove the static HARDWARE_TYPES list and implement dynamic hardware detection based on filename patterns to improve flexibility when identifying Satellite1 versions. * feat(satellite1): restructure audio driver installation scripts Reorganize the driver installation process for Satellite1 v1.0 by replacing the monolithic `02-run-chroot.sh` with a modular script structure including `02-run.sh` and `03-run-chroot.sh`, and adding a dedicated `files/` directory for driver assets. * retrigger build * fix(satellite1): enable Python SDK installation in audio driver script Uncomment the Python SDK download and installation commands in the chroot execution script to ensure the SDK is properly installed during the audio driver stage. * add final FPH packages path
1 parent 69a6fe9 commit a7c7928

10 files changed

Lines changed: 212 additions & 3 deletions

File tree

.github/workflows/build-all.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,25 @@ jobs:
8989
compression-level: 6
9090
custom-hostname: picompose
9191

92+
# Satellite-1 1.0
93+
build-satellite1-v1dot0:
94+
uses: ./.github/workflows/build-image-template.yml
95+
with:
96+
image-name: PiCompose_Satellite1-v1.0
97+
stage-list: stage0 stage1 stage2 ./01-stage-picompose ./02-stage-audiodriver-satellite1-v1.0 ./04-stage-finish
98+
compression: xz
99+
compression-level: 6
100+
custom-hostname: picompose
101+
102+
build-satellite1-v1dot0-lva:
103+
uses: ./.github/workflows/build-image-template.yml
104+
with:
105+
image-name: PiCompose_Satellite1-v1.0_Linux-Voice-Assistant
106+
stage-list: stage0 stage1 stage2 ./01-stage-picompose ./02-stage-audiodriver-satellite1-v1.0 ./03-stage-linux-voice-assistant ./04-stage-finish
107+
compression: xz
108+
compression-level: 6
109+
custom-hostname: picompose
110+
92111
# RPI IMAGER JSON
93112
generate-rpi-imager-json:
94113
needs: [build, build-2michat, build-respeaker_lite, build-2michat-lva, build-respeaker_lite-lva]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
git
2+
dkms
3+
curl
4+
wget
5+
dkms
6+
i2c-tools
7+
libasound2-plugins
8+
alsa-utils
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash -e
2+
3+
# disable acp
4+
mkdir -p "${ROOTFS_DIR}/etc/wireplumber/wireplumber.conf.d"
5+
install -v -m 644 files/51-disable-acp.conf "${ROOTFS_DIR}/etc/wireplumber/wireplumber.conf.d/51-disable-acp.conf"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash -e
2+
3+
# Installs drivers for the ReSpeaker 2mic and 4mic HATs on Raspberry Pi OS.
4+
# Must be run with sudo.
5+
# Requires: curl raspberrypi-kernel-headers dkms i2c-tools libasound2-plugins alsa-utils
6+
7+
echo "Starting satellite1 driver installation..."
8+
9+
# 1. Install the Custom Kernel
10+
echo "Download and install Custom Kernel"
11+
wget https://github.com/FutureProofHomes/RPi-Kernel-Fusb302/releases/download/develop/linux-image-6.18.32-fusb302-rpi-v8_2_arm64.deb
12+
dpkg -i linux-image-*-fusb302-rpi-v8_*_arm64.deb
13+
14+
15+
# 2. Install System Configuration
16+
echo "Download and install System configuration"
17+
wget https://github.com/FutureProofHomes/Satellite1-RPi-Setup/releases/download/develop/satellite1-rpi-setup_1.0-1_arm64.deb
18+
dpkg -i satellite1-rpi-setup_*_arm64.deb
19+
20+
21+
# 3. Install the Python SDK
22+
#echo "Download and install Python SDK"
23+
wget https://github.com/FutureProofHomes/Satellite1-RPi-SDK/releases/download/develop/satellite1-rpi-sdk_0.1.5_arm64.deb
24+
dpkg -i satellite1-rpi-sdk_*_arm64.deb
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
monitor.alsa.rules = [
2+
{
3+
matches = [
4+
{
5+
device.name = "alsa_card.platform-soc_sound"
6+
}
7+
]
8+
actions = {
9+
update-props = {
10+
api.alsa.use-acp = false
11+
api.acp.auto-profile = false
12+
api.acp.auto-port = false
13+
}
14+
}
15+
}
16+
]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash -e
2+
3+
# Install the compose-manager script
4+
install -v -m 755 files/configure_audio.sh "${ROOTFS_DIR}/usr/bin/configure_audio.sh"
5+
6+
# Copy the systemd service
7+
install -v -m 644 files/configure_audio.service "${ROOTFS_DIR}/etc/systemd/system/configure_audio.service"
8+
9+
on_chroot << EOF
10+
# Enable services
11+
echo "Enable audio services"
12+
systemctl daemon-reload
13+
systemctl enable configure_audio.service
14+
EOF
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[Unit]
2+
Description=PiCompose - Configure Audio volume setting
3+
After=user@1000.service sound.target alsa-restore.service seeed-voicecard.service
4+
Wants=user@1000.service sound.target alsa-restore.service seeed-voicecard.service
5+
6+
[Service]
7+
Type=oneshot
8+
Environment=XDG_RUNTIME_DIR=/run/user/1000
9+
ExecStart=/usr/bin/configure_audio.sh
10+
RemainAfterExit=yes
11+
Restart=on-failure
12+
RestartSec=30s
13+
14+
[Install]
15+
WantedBy=multi-user.target
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#!/bin/bash
2+
set -u
3+
4+
5+
set_volume_safe() {
6+
local volume="${1:-1.0}"
7+
8+
if wpctl get-volume @DEFAULT_AUDIO_SINK@ >/dev/null 2>&1; then
9+
wpctl set-volume @DEFAULT_AUDIO_SINK@ "$volume"
10+
echo "Volume set to $volume"
11+
return 0
12+
else
13+
echo "No default audio sink available"
14+
exit 1
15+
fi
16+
}
17+
18+
wait_for_audio() {
19+
local max_tries="${1:-30}"
20+
local sleep_time="${2:-1}"
21+
22+
local i=0
23+
while [ $i -lt $max_tries ]; do
24+
if wpctl get-volume @DEFAULT_AUDIO_SINK@ >/dev/null 2>&1; then
25+
echo "Audio ready"
26+
return 0
27+
fi
28+
29+
echo "Waiting for audio... ($i/$max_tries)"
30+
sleep "$sleep_time"
31+
i=$((i+1))
32+
done
33+
34+
echo "Timeout: Audio not ready"
35+
exit 1
36+
}
37+
38+
wait_for_card_and_control() {
39+
local card="$1"
40+
local control="$2"
41+
local max_tries=30
42+
local sleep_sec=1
43+
local count=0
44+
45+
while [ "$count" -lt "$max_tries" ]; do
46+
count=$((count + 1))
47+
48+
if amixer -c "$card" info >/dev/null 2>&1; then
49+
if amixer -c "$card" scontrols | grep -Fq "'$control'"; then
50+
echo "Card $card with control '$control' is ready ($count/$max_tries)"
51+
return 0
52+
fi
53+
echo "Card $card found, but control '$control' not ready yet ($count/$max_tries)"
54+
else
55+
echo "Card $card not ready yet ($count/$max_tries)"
56+
fi
57+
58+
sleep "$sleep_sec"
59+
done
60+
61+
echo "Card $card with control '$control' did not become ready"
62+
return 1
63+
}
64+
65+
set_control_if_exists() {
66+
local card="$1"
67+
local control="$2"
68+
local value="$3"
69+
70+
if amixer -c "$card" scontrols | grep -Fq "'$control'"; then
71+
echo "Setting $control on $card to $value"
72+
amixer -c "$card" set "$control" "$value"
73+
return 0
74+
fi
75+
76+
echo "Control '$control' not found on $card, skipping"
77+
return 0
78+
}
79+
80+
# Wait for audio system to be ready
81+
wait_for_audio 30 1
82+
83+
# Check if the card is ok
84+
if wait_for_card_and_control seeed2micvoicec Headphone; then
85+
CARD="seeed2micvoicec"
86+
echo "seeed2micvoicec found"
87+
else
88+
echo "No supported sound card became ready"
89+
exit 1
90+
fi
91+
92+
# Set volume
93+
set_control_if_exists "$CARD" Headphone 100%
94+
set_control_if_exists "$CARD" Speaker 100%
95+
set_control_if_exists "$CARD" Master 100%
96+
set_control_if_exists "$CARD" PCM 100%
97+
98+
# Set pipewire sink volume
99+
set_volume_safe 1.0
100+
101+
# Alsa save
102+
alsactl store
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash -e
2+
3+
if [ ! -d "${ROOTFS_DIR}" ]; then
4+
copy_previous
5+
fi

scripts/generate-imager-json.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
OUTPUT_FILE = "rpi-imager.json"
1414
API_URL = f"https://api.github.com/repos/{OWNER}/{REPO}/releases"
1515

16-
HARDWARE_TYPES = ["Respeaker-lite", "2MicHat", "2MicHat-v1", "2MicHat-v2", "None"]
17-
18-
1916
def fetch_releases():
2017
"""Fetch releases from GitHub API."""
2118
print("Fetching releases from GitHub...")
@@ -88,6 +85,10 @@ def extract_metadata(filename):
8885

8986
if 'Respeaker' in name and 'lite' in name.lower():
9087
hardware = "Respeaker-lite"
88+
elif 'Satellite1-v1.1' in name:
89+
hardware = "Satellite1-v1.1"
90+
elif 'Satellite1' in name:
91+
hardware = "Satellite1-v1.0"
9192
elif '2MicHat' in name:
9293
if '2MicHat-v2' in name:
9394
hardware = "2MicHat-v2"

0 commit comments

Comments
 (0)