summaryrefslogtreecommitdiffstats
path: root/bin/4a-status
diff options
context:
space:
mode:
authorThierry Bultel <thierry.bultel@iot.bzh>2019-04-24 14:28:01 +0200
committerThierry Bultel <thierry.bultel@iot.bzh>2019-04-24 12:34:31 +0000
commit224f667013ae930b3698eb896889edbf1c0cf2c5 (patch)
treeefabd608de839e6493b4a8148b958d79184c9c53 /bin/4a-status
parent76c7d5f13902ee2a58a05c0de01394650bcb4613 (diff)
parent4d67fb6cfb56d0abd8ec1c9149b88efd4828935d (diff)
Merge branch 'sandbox/tbultel/avirt'
This migrates all the commits that were on the now-deprecated iot.bzh github. Bug-AGL: SPEC-2259 Change-Id: I98820a409cd02ee977e0383c1be227dc22344099 Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
Diffstat (limited to 'bin/4a-status')
-rwxr-xr-xbin/4a-status50
1 files changed, 50 insertions, 0 deletions
diff --git a/bin/4a-status b/bin/4a-status
new file mode 100755
index 0000000..c3e361e
--- /dev/null
+++ b/bin/4a-status
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+# load shell lib
+. $(dirname $BASH_SOURCE)/lib4a-tools.sh
+
+set -o pipefail
+
+ERR="${color_red}ERROR${color_none}"
+WRN="${color_yellow}WARNING${color_none}"
+SUC="${color_green}SUCCESS${color_none}"
+
+EXIT_CODE=0
+
+# ------------------- enumerate sound cards ------------------------
+
+log "---- Audio cards detected ----"
+LANG="C" aplay -l | grep -oEe "^card\\s+[^\\[]+" | sort -u
+
+# -------------------- snd-aloop ------------------------
+
+log ""
+log "---- snd-aloop driver availability ----"
+if zcat /proc/config.gz | grep "CONFIG_SND_ALOOP=y" > /dev/null; then
+ log "$SUC: Built into the kernel"
+else
+ log "$WRN: Not built into the kernel, devices order can randomly change!"
+ if zcat /proc/config.gz | grep "CONFIG_SND_ALOOP=m" > /dev/null; then
+ log "$SUC: snd-aloop is provided!"
+ if lsmod | grep "snd_aloop" > /dev/null; then
+ log "$SUC: snd-aloop is loaded!"
+ else
+ log "$ERR: snd-aloop is not loaded! 4a-softmixer can't work, please load it using: modprobe snd-aloop"
+ fi
+ else
+ log "$ERR: snd-aloop is not provided at all, 4a-softmixer can't work!"
+ EXIT_CODE=1
+ fi
+fi
+
+log ""
+log "---- 4a service status ----"
+if ps x | grep "service-audio-4a" | grep -v "grep" > /dev/null; then
+ log "$SUC: Service is currently running!"
+else
+ log "$WRN: Service is not currently running!"
+ log "It can be started using the following command:"
+ log "systemctl restart *agl-service-audio-4a*.service"
+fi
+
+exit $EXIT_CODE