0
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2024-12-15 14:29:49 +00:00
2021-04-03 23:21:54 +02:00

42 lines
940 B
Bash

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
. /etc/profile
oe_setup_addon service.snapclient
. /etc/os-release
case "$LIBREELEC_ARCH" in
RPi*.arm)
if [ "$sc_a" == "true" ]; then
ALSA="/proc/asound/ALSA"
if [ ! -e "$ALSA" ]; then
echo "Starting Raspberry Pi onboard audio"
dtparam audio=on
sleep 1
fi
if [ -e "$ALSA" ]; then
echo "Setting Raspberry Pi onboard audio playback route"
index="$(readlink $ALSA)"
index="${index##*card}"
amixer -c "$index" cset name="PCM Playback Route" "$sc_r"
fi
fi
;;
esac
[ -n "$sc_h" ] && sc_H="--hostID $sc_h"
[ -n "$sc_s" ] && sc_S="--soundcard $sc_s"
[ -n "$sc_addr" ] && HOST="--host $sc_addr"
HOME="$ADDON_HOME" \
nice -n "$sc_n" \
snapclient \
$sc_H \
--latency "$sc_l" \
$HOST \
--port "$sc_p" \
$sc_S \
> /dev/null