From 4d67fb6cfb56d0abd8ec1c9149b88efd4828935d Mon Sep 17 00:00:00 2001 From: Thierry Bultel Date: Wed, 24 Apr 2019 13:42:49 +0200 Subject: 4a-aplay: added avirt detection Adds the detection of avirt of electing the default playback device. Signed-off-by: Thierry Bultel --- bin/4a-play | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 ) -- cgit 1.2.3-korg