Skip to content

Commit

Permalink
Merge pull request #91 from KanoComputing/default_volume
Browse files Browse the repository at this point in the history
Alsa's default sound volume is really low. On first boot, set it to 90%.
  • Loading branch information
Ealdwulf committed Apr 30, 2015
2 parents 81ffba1 + 91bcb73 commit 4ada849
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bin/kano-uixinit
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ if [ -e $INIT_CONF ]; then
FLOW="$flow_type"
fi
fi

FIRST_BOOT="false"
# The following block is related to the first bootflow
if [ ! -f $first_boot_file ]; then
FIRST_BOOT="true"
if [ "$SKIP" != "true" ]; then
# This is backwards compatibility with version prior to Beta 1.3.1
if [ ! -f $after_update_file ]; then
Expand Down Expand Up @@ -159,6 +160,15 @@ if [ -e /etc/init.d/alsa-utils ]; then
else
logger_info "Audio volume level was successfully restored"
fi
if [ "$FIRST_BOOT" == "true" ]; then
amixer -c 0 -- sset PCM playback 90% &> /dev/null
ret_val="$?"
if [ "$ret_val" -ne 0 ]; then
logger_warn "Failed to set volume level, ret code: $ret_val"
else
logger_info "Audio volume level set to 90% on first boot"
fi
fi
else
logger_warn "alsa-utils not found, can't attempt to restore volume level"
fi
Expand Down

0 comments on commit 4ada849

Please sign in to comment.