Fix up RG351P/M volume control.

This commit is contained in:
fewtarius 2023-09-04 19:08:01 +00:00
parent 85f38f951f
commit a792269f66
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A
3 changed files with 12 additions and 4 deletions

View file

@ -6,8 +6,8 @@ cat <<EOF >/storage/.config/profile.d/001-deviceconfig
# Device Features
DEVICE_VOLUMECTL=true
DEVICE_POWER_LED=false
DEVICE_PLAYBACK_PATH_SPK="SPK"
DEVICE_PLAYBACK_PATH_HP="HP"
DEVICE_PLAYBACK_PATH_SPK="HP"
DEVICE_PLAYBACK_PATH_HP="SPK"
DEVICE_BRIGHTNESS="128"
DEVICE_VOLUME="100"
DEVICE_BATTERY_LED_STATUS=true

View file

@ -0,0 +1,8 @@
#!/bin/sh
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
. /storage/.config/profile.d/001-device_config
### RG351P/M has a volume rocker, so the internal volume should always be 100%.
amixer -c 0 set "Master" "${DEVICE_VOLUME}%"

View file

@ -29,10 +29,10 @@ then
fi
VOLUME=$(get_setting audio.volume)
if [[ -z ${VOLUME} ]]
if [ -z ${VOLUME} ]
then
VOLUME="60"
elif [[ -n "${DEVICE_VOLUME}" ]]
elif [ -n "${DEVICE_VOLUME}" ]
then
VOLUME="${DEVICE_VOLUME}"
fi