diff --git a/raspi-config b/raspi-config index c9f7f00..ef93bf4 100755 --- a/raspi-config +++ b/raspi-config @@ -582,6 +582,17 @@ do_update() { exec raspi-config } +do_audio() { + AUDIO_OUT=$(whiptail --menu "Choose the audio output" 20 60 10 \ + "0" "Auto" \ + "1" "Force 3.5mm ('headphone') jack" \ + "2" "Force HDMI" \ + 3>&1 1>&2 2>&3) + if [ $? -eq 0 ]; then + amixer cset numid=3 "$AUDIO_OUT" + fi +} + do_finish() { disable_raspi_config_at_boot if [ $ASK_TO_REBOOT -eq 1 ]; then @@ -758,7 +769,8 @@ do_advanced_menu() { "A3 Memory Split" "Change the amount of memory made available to the GPU" \ "A4 SSH" "Enable/Disable remote command line access to your Pi using SSH" \ "A5 SPI" "Enable/Disable automatic loading of SPI kernel module (needed for e.g. PiFace)" \ - "A6 Update" "Update this tool to the latest version" \ + "A6 Audio" "Force audio out through HDMI or 3.5mm jack" \ + "A7 Update" "Update this tool to the latest version" \ 3>&1 1>&2 2>&3) RET=$? if [ $RET -eq 1 ]; then @@ -770,7 +782,8 @@ do_advanced_menu() { A3\ *) do_memory_split ;; A4\ *) do_ssh ;; A5\ *) do_spi ;; - A6\ *) do_update ;; + A6\ *) do_audio ;; + A7\ *) do_update ;; *) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;; esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1 fi