From 44a3c1a1236a72b896d08dbb8fba88ce591063c4 Mon Sep 17 00:00:00 2001 From: David Escalona Date: Tue, 4 Oct 2022 10:19:58 +0200 Subject: [PATCH] meta-digi-dey: dey-examples: start pulseaudio with 'connectcore-demo' example The demo now has a "Play music" feature, which requires pulseaudio to be running in the device. This commit checks if pulseaudio is running before starting the demo, and starts the service in the case it is not. Signed-off-by: David Escalona --- .../connectcore-demo-example/connectcore-demo-example-init | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta-digi-dey/recipes-digi/dey-examples/connectcore-demo-example/connectcore-demo-example-init b/meta-digi-dey/recipes-digi/dey-examples/connectcore-demo-example/connectcore-demo-example-init index 3049cafe6..2c0c421b1 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/connectcore-demo-example/connectcore-demo-example-init +++ b/meta-digi-dey/recipes-digi/dey-examples/connectcore-demo-example/connectcore-demo-example-init @@ -15,6 +15,7 @@ readonly DEMOSERVER_BINARY="/srv/www/demoserver.py" readonly STOP_TIMEOUT="5" +readonly PULSEAUDIO_START_COMMAND="pulseaudio --start" stop_process() { # try to stop gracefully @@ -30,6 +31,7 @@ stop_process() { case "$1" in start) + pkill -0 "pulseaudio" >/dev/null 2>&1 || ${PULSEAUDIO_START_COMMAND} ${DEMOSERVER_BINARY} > /dev/null 2>&1 & ;; stop)