summaryrefslogtreecommitdiff
path: root/snd-alpx/tools/build_virtual_board_alsa_conf.sh
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2024-05-10 18:52:23 (GMT)
committerChristian Pointner <equinox@helsinki.at>2024-05-10 18:52:23 (GMT)
commita641800acf13b5fb1463d4280c3ee7fc267143fb (patch)
tree248b647a682f71d9eb90d14d24081368ea905a42 /snd-alpx/tools/build_virtual_board_alsa_conf.sh
parentcc4badffe0e02d159c21eb90ea080a6a2f90cb4b (diff)
import whole driver package
Diffstat (limited to 'snd-alpx/tools/build_virtual_board_alsa_conf.sh')
-rwxr-xr-xsnd-alpx/tools/build_virtual_board_alsa_conf.sh79
1 files changed, 0 insertions, 79 deletions
diff --git a/snd-alpx/tools/build_virtual_board_alsa_conf.sh b/snd-alpx/tools/build_virtual_board_alsa_conf.sh
deleted file mode 100755
index 3e8a605..0000000
--- a/snd-alpx/tools/build_virtual_board_alsa_conf.sh
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/bash
-## This script will print an asoundrc stream which add virtual boards from one physical board.
-## Output must be directed into a file to be stored
-
-### FUNCTIONS ###
-user_manual() {
- echo "Required Parameters
- 1. Phy board id like "hw:CARD=Alp882e,DEV=0"
- 2. Phy board channels quantity
- 3. Virtual boards base name like : \"Emulated analog Alp222\"
- 4. Virtual boards channels quantities (2: stéréo, ...)" >&2
-}
-
-
-build_phy_node() {
- node_type=$1
- card_id=$2
- channels_qty=$3
- echo -e "pcm_slave.$node_type { \n pcm \"$card_id\"\n channels $channels_qty\n }\n"
-}
-
-build_virtual_node() {
-node_alias=$1
-node_type=$2
-node_id=$3
-ipc_key=$4
-phy_name=$5
-phy_channels_base=$6
-phy_channels_qty=$7
-description=$8
-direction=$9
-
-echo -e "pcm.$node_alias$node_id {
- type $node_type
- ipc_key $ipc_key
- ipc_key_add_uid true
- slave $phy_name"
-
- for channel_id in $(seq 0 "$(($phy_channels_qty-1))")
- do
- echo -e "\tbindings.$channel_id $(($channel_id+$phy_channels_base))"
- done
-
-
- echo -e "\thint.description" \"$description \#$node_id $direction\"
- echo -e "}\n"
-}
-
-### MAIN ###
-
-[ "$#" -ne "4" ] && user_manual && exit 1
-
-ipc_key=$(date +%N)
-card_id=$1
-channels_qty=$2
-virtual_basename=$3
-stream_width=$4
-virt_qty=$(($channels_qty / $stream_width))
-
-echo "#Building Alsa sound RC file for $virt_qty virtual boards of $stream_width channels from physical board $card_id with $channels_qty."
-
-##Build the entries first
-build_phy_node "ins" "$card_id" "$channels_qty"
-
-for entry_idx in $(seq 0 $(($virt_qty-1)))
-do
- build_virtual_node "mic" "dsnoop" "$entry_idx" "$ipc_key" "ins" "$(($stream_width * $entry_idx))" "$stream_width" "virtual Alp-$stream_width" "in"
-done
-
-##Now the outpus
-build_phy_node "outs" "$card_id" "$channels_qty"
-
-ipc_key=$(date +%N)
-
-for entry_idx in $(seq 0 $(($virt_qty-1)))
-do
- build_virtual_node "out" "dshare" "$entry_idx" "$ipc_key" "outs" "$(($stream_width * $entry_idx))" "$stream_width" "virtual Alp-$stream_width" "out"
-done
-