forked from dev47apps/droidcam-linux-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-sound
executable file
·31 lines (25 loc) · 948 Bytes
/
install-sound
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
#
REPO_PATH="$(/usr/bin/dirname $([ -L $0 ] && /bin/readlink -f $0 || echo $0))"
source "${REPO_PATH}/install.common"
check_if_installed
echo "Loading Loopback device"
modprobe snd-aloop || exit 1
LOOPBACK_CARD_ID=$(grep -F "[Loopback" < /proc/asound/cards | awk '{print $1}')
if [[ ! $(echo "$LOOPBACK_CARD_ID" | grep -E "^[0-9]$") ]]
then
echo "Error: Could not determine Loopback card number"
exit 1
fi
if [ -d "/etc/modprobe.d/" ]; then
add_line "/etc/modprobe.d/droidcam.conf" "options snd-aloop index=$LOOPBACK_CARD_ID"
fi
if [ -d "/etc/modules-load.d" ]; then
add_line "/etc/modules-load.d/droidcam.conf" "snd-aloop"
elif [ -e "/etc/modules" ]; then
add_line "/etc/modules" "snd-aloop"
else
echo "Warning: Unknown distro. Sound card may not load after a reboot."
fi
echo "Done"
echo "Use 'pacmd load-module module-alsa-source device=hw:Loopback,1,0' to load the card into PulseAudio while droidcam is running"