distribution/packages/hardware/quirks/platforms/S922X/050-audio_path

23 lines
672 B
Bash
Executable file

#!/bin/sh
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
cat <<EOF >/storage/.config/profile.d/002-audio_path
DEVICE_PLAYBACK_PATH_SPK="SPK"
DEVICE_PLAYBACK_PATH_HP="HP"
DEVICE_PLAYBACK_PATH="Playback Mux"
DEVICE_PIPEWIRE_PROFILE="pro-audio"
EOF
### Set sound properties
amixer -c 0 -q sset 'FRDDR_A SINK 1 SEL' 'OUT 1'
amixer -c 0 -q sset 'FRDDR_A SRC 1 EN' 'on'
### Set correct audio output device at boot.
HEADPHONE_ENABLE="$(get_setting headphone.enabled)"
if [ "${HEADPHONE_ENABLE}" = "1" ]
then
amixer -c0 sset "${DEVICE_PLAYBACK_PATH}" "HP"
else
amixer -c0 sset "${DEVICE_PLAYBACK_PATH}" "SPK"
fi