forked from duhow/xiaoai-patch
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ad8b5f
commit 705f577
Showing
5 changed files
with
104 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
|
||
echo 'START' > /tmp/satellite.log | ||
|
||
amixer sset 'pdm dclk' 'pdm dclk 3.072m, support 8k/16k/32k/48k' & amixer sset 'HCIC shift gain from coeff' 'shift with -0x4' >> /tmp/satellite.log | ||
amixer set notifyvol 60% >> /tmp/satellite.log | ||
python3 -m venv .venv >> /tmp/satellite.log | ||
|
||
script/run --name $HOSTNAME --uri 'tcp://0.0.0.0:10700' --no-zeroconf \ | ||
--mic-command '/data/satellite/recorder' \ | ||
--snd-command 'aplay -D notify -r 22050 -c 1 -f S16_LE -t raw' \ | ||
--awake-wav sounds/sound1.wav --done-wav sounds/sound7.wav \ | ||
--startup-command '/bin/show_led 10' --detect-command '/bin/show_led 0' \ | ||
--detection-command '/bin/show_led 1' --stt-stop-command '/bin/show_led 2' --transcript-command '/bin/show_led 0' \ | ||
--error-command '/bin/show_led 7; sleep 1; /bin/show_led 0' \ | ||
--debug >> /tmp/satellite.log 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/sh /etc/rc.common | ||
|
||
START=98 | ||
USE_PROCD=1 | ||
|
||
EXTRA_COMMANDS="status toggle" | ||
PIDFILE=/var/run/satellite.pid | ||
|
||
start_service() { | ||
/bin/shut_led 7 & | ||
|
||
procd_open_instance | ||
procd_set_param command /data/satellite/launcher | ||
procd_set_param respawn 3600 5 0 | ||
procd_set_param pidfile ${PIDFILE} | ||
procd_close_instance | ||
} | ||
|
||
stop_service() { | ||
/bin/show_led 7 & | ||
|
||
kill_child_processes 1 `cat ${PIDFILE}` | ||
} | ||
|
||
reload_service() { | ||
stop | ||
sleep 1 | ||
start | ||
} | ||
|
||
toggle() { | ||
if [ -f "${PIDFILE}" ] && [ -e /proc/`cat ${PIDFILE}`/status ]; then | ||
stop | ||
else | ||
start | ||
fi | ||
} | ||
|
||
status() { | ||
if [ -f "${PIDFILE}" ] && [ -e /proc/`cat ${PIDFILE}`/status ]; then | ||
echo "satellite is running." | ||
return 0 | ||
else | ||
echo "satellite is stopped." | ||
return 1 | ||
fi | ||
} | ||
|
||
kill_child_processes() { | ||
isTopmost=$1 | ||
curPid=$2 | ||
childPids=`pgrep -P ${curPid}` | ||
|
||
for childPid in $childPids | ||
do | ||
kill_child_processes 0 $childPid | ||
done | ||
|
||
if [ $isTopmost -eq 0 ]; then | ||
kill -9 $curPid 2> /dev/null | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
KEY_HOME 1 /etc/init.d/listener toggle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
PACKAGE_NAME="satellite" | ||
PACKAGE_VERSION="1.1.0" | ||
PACKAGE_SRC="https://github.com/rhasspy/wyoming-satellite/archive/v${PACKAGE_VERSION}.tar.gz" | ||
PACAKGE_DEPENDS="python3 aec-cmdline" | ||
|
||
make_package() { | ||
# TODO | ||
} | ||
|
||
install_package() { | ||
|
||
cp -v ${PACKAGE_DIR}/config/satellite.init ${STAGING_DIR}/etc/init.d/listener | ||
ln -sf ../init.d/listener ${STAGING_DIR}/etc/rc.d/S98listener | ||
|
||
TRIGGERHAPPY_FOLDER="${STAGING_DIR}/etc/triggerhappy/triggers.d" | ||
mkdir -p ${TRIGGERHAPPY_FOLDER} | ||
|
||
cp -v ${PACKAGE_DIR}/config/triggerhappy.conf ${TRIGGERHAPPY_FOLDER}/listener.conf | ||
} |