summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorThierry Bultel <thierry.bultel@iot.bzh>2019-04-24 13:42:49 +0200
committerThierry Bultel <thierry.bultel@iot.bzh>2019-04-24 14:18:11 +0200
commit4d67fb6cfb56d0abd8ec1c9149b88efd4828935d (patch)
treeefabd608de839e6493b4a8148b958d79184c9c53 /bin
parentc3d43245f69639183766b10a530963129fa8d867 (diff)
4a-aplay: added avirt detectionsandbox/tbultel/avirt
Adds the detection of avirt of electing the default playback device. Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/4a-play9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/4a-play b/bin/4a-play
index 620f311..7650d4d 100755
--- a/bin/4a-play
+++ b/bin/4a-play
@@ -19,8 +19,15 @@ if [ "$#" == "0" ]; then
usage
fi
+avirt=$(cat /proc/modules | grep avirt_ap_loopback | head -n1 | cut -d ' ' -f 1)
+if [ x$avirt == x ]; then
+hwdev=Loopback,0,2
+else
+hwdev=avirt,0
+fi
+
FILEPATH="$( realpath "$1" )"
-DEVICE=${2:-'hw:Loopback,0,2'}
+DEVICE=${2:-"hw:$hwdev"}
ROLE=${3:-'multimedia'}
CARDID=$( echo "$DEVICE" | cut -d':' -f2 | cut -d',' -f1 )