summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/load.sh13
-rwxr-xr-xscripts/make-agl.sh14
-rwxr-xr-xscripts/test_configfs.sh21
-rwxr-xr-xscripts/unload.sh13
4 files changed, 61 insertions, 0 deletions
diff --git a/scripts/load.sh b/scripts/load.sh
new file mode 100755
index 0000000..103a63b
--- /dev/null
+++ b/scripts/load.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Load the core
+insmod snd-avirt-core.ko
+
+# Load the additional Audio Paths
+insmod dummy/snd-avirt-ap-dummy.ko
+insmod loopback/snd-avirt-ap-loopback.ko
+
+# Run the test script
+./scripts/test_configfs.sh
+
+echo "Drivers Loaded!"
diff --git a/scripts/make-agl.sh b/scripts/make-agl.sh
new file mode 100755
index 0000000..6c94fbb
--- /dev/null
+++ b/scripts/make-agl.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Get SDK path
+sdk_id=$1 # first arg must be XDS_SDK_ID
+shift 1
+long_sdkpath=$(xds-cli sdks get $sdk_id | grep Path)
+sdkpath=${long_sdkpath:4}
+
+# Build
+/opt/AGL/bin/xds-cli exec --config xds-project.conf -- \
+ LDFLAGS= CONFIG_AVIRT=m CONFIG_AVIRT_BUILDLOCAL=y \
+ CONFIG_AVIRT_AP_DUMMY=m \
+ CONFIG_AVIRT_AP_LOOPBACK=m \
+ make -C $sdkpath/sysroots/aarch64-agl-linux/usr/src/kernel M=$(pwd) $@
diff --git a/scripts/test_configfs.sh b/scripts/test_configfs.sh
new file mode 100755
index 0000000..b6a56f6
--- /dev/null
+++ b/scripts/test_configfs.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+mkdir -p /config && mount -t configfs none /config
+
+mkdir /config/snd-avirt/streams/playback_media
+echo "2">/config/snd-avirt/streams/playback_media/channels
+echo "ap_loopback">/config/snd-avirt/streams/playback_media/map
+
+mkdir /config/snd-avirt/streams/playback_navigation
+echo "1">/config/snd-avirt/streams/playback_navigation/channels
+echo "ap_loopback">/config/snd-avirt/streams/playback_navigation/map
+
+mkdir /config/snd-avirt/streams/playback_emergency
+echo "1">/config/snd-avirt/streams/playback_emergency/channels
+echo "ap_loopback">/config/snd-avirt/streams/playback_emergency/map
+
+mkdir /config/snd-avirt/streams/capture_voice
+echo "1">/config/snd-avirt/streams/capture_voice/channels
+echo "ap_loopback">/config/snd-avirt/streams/capture_voice/map
+
+echo "1">/config/snd-avirt/streams/sealed
diff --git a/scripts/unload.sh b/scripts/unload.sh
new file mode 100755
index 0000000..a18e1f5
--- /dev/null
+++ b/scripts/unload.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+rmdir /config/snd-avirt/streams/playback_*
+rmdir /config/snd-avirt/streams/capture_*
+
+rm_module() {
+ lsmod |grep "^$1\>" && rmmod $1 || true
+}
+
+rm_module snd_avirt_ap_loopback
+rm_module snd_avirt_ap_dummy
+rm_module snd_avirt_core
+echo "Drivers Removed!"