diff -Nru ubuntustudio-installer-1.8/debian/changelog ubuntustudio-installer-1.9/debian/changelog --- ubuntustudio-installer-1.8/debian/changelog 2023-07-02 18:40:07.000000000 +0000 +++ ubuntustudio-installer-1.9/debian/changelog 2023-08-03 00:06:13.000000000 +0000 @@ -1,3 +1,9 @@ +ubuntustudio-installer (1.9) mantic; urgency=medium + + * audio-config: Add fontend to enable/disable pipewire-jack + + -- Erich Eickmeyer Wed, 02 Aug 2023 17:06:13 -0700 + ubuntustudio-installer (1.8) mantic; urgency=medium * Change audio-config window icon to correct icon diff -Nru ubuntustudio-installer-1.8/usr/bin/ubuntustudio-audio-config ubuntustudio-installer-1.9/usr/bin/ubuntustudio-audio-config --- ubuntustudio-installer-1.8/usr/bin/ubuntustudio-audio-config 2023-07-02 17:07:35.000000000 +0000 +++ ubuntustudio-installer-1.9/usr/bin/ubuntustudio-audio-config 2023-08-03 00:01:57.000000000 +0000 @@ -2,165 +2,190 @@ while true; do -if dpkg -s "ubuntustudio-pipewire-config" &> /dev/null; then - pwConfig="TRUE"; paConfig="FALSE" -elif dpkg -s "ubuntustudio-pulseaudio-config" &> /dev/null; then - paConfig="TRUE"; pwConfig="FALSE" -else - zenity \ - --title "Ubuntu Studio Audio Configuration" \ - --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ - --warning \ - --text="A default Ubuntu Studio audio configuration package could not be found. -An audio configuration package will now be installed." - qapt-batch --install ubuntustudio-pipewire-config - zenity \ - --title "Ubuntu Studio Audio Configuration" \ - --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ - --info \ - --text="You must restart your computer for these changes to take effect." - exit 0 -fi - -changeConfig=$(zenity --width=600 --height=300 \ + if dpkg -s "ubuntustudio-pipewire-config" &> /dev/null; then + pwConfig="TRUE"; paConfig="FALSE" + elif dpkg -s "ubuntustudio-pulseaudio-config" &> /dev/null; then + paConfig="TRUE"; pwConfig="FALSE" + else + zenity \ --title "Ubuntu Studio Audio Configuration" \ --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ - --list \ - --radiolist \ - --separator="|" \ - --text="What would you like to do?" \ - --ok-label="Continue" \ - --cancel-label="Close" \ - --column="Select" \ - --column="Selection" \ - FALSE "Configure Current Audio Configuration" FALSE "Switch Configuration" ); -strExit=$? -if [ "${strExit}" = "1" ]; then - exit 0; -fi - -if [ "${changeConfig}" = "Configure Current Audio Configuration" ] && \ - [ "${paConfig}" = "TRUE" ]; then - if ( zenity \ - --title "Ubuntu Studio Audio Configuration" \ - --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ - --question \ - --ok-label="Yes" \ - --cancel-label="No" \ - --text="For your current audio configuration (JACK/PulseAudio), please use Studio Controls.\n\ -Would you like to launch Studio Controls now?" ); then - studio-controls; - exit 0; + --warning \ + --text="A default Ubuntu Studio audio configuration package could not be found. + An audio configuration package will now be installed." + qapt-batch --install ubuntustudio-pipewire-config + zenity \ + --title "Ubuntu Studio Audio Configuration" \ + --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ + --info \ + --text="You must restart your computer for these changes to take effect." + exit 0 fi -fi - -if [ "${changeConfig}" = "Configure Current Audio Configuration" ] && \ - [ "${pwConfig}" = "TRUE" ]; then - pwSetStr=$(zenity \ - --title "Ubuntu Studio Audio Configuration" \ - --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ - --entry \ - --ok-label="OK" \ - --cancel-label="Cancel" \ - --text="Please enter the values for the PipeWire Quantum / JACK Plugin -configuration separated by a space.\n -First value is the Buffer Size which can be one of the following: -16, 32, 64, 128, 256, 512, 1024, 2048, or 4096\n -Next value is the Sample Rate in Hertz (Hz) which can be one of the following: -22050, 32000, 44100, 48000, 88200, 96000, or 192000\n -Example (default): 1024 48000\n -Leaving this blank will reset to default unless cancelled -If you're not sure what to do here, it's best to reset to defaults." ) + + if [ -e /etc/ld.so.conf.d/pipewire-jack.conf ]; then + pwJackStr="DISABLE PipeWire's JACK Emulation (to use JACKd proper)" + else + pwJackStr="ENABLE PipeWire's JACK Emulation" + fi + + changeConfig=$(zenity --width=600 --height=300 \ + --title "Ubuntu Studio Audio Configuration" \ + --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ + --list \ + --radiolist \ + --separator="|" \ + --text="What would you like to do?" \ + --ok-label="Continue" \ + --cancel-label="Close" \ + --column="Select" \ + --column="Selection" \ + FALSE "Configure Current Audio Configuration" FALSE "Switch Configuration" FALSE "${pwJackStr}" ); strExit=$? - if ! [ "${strExit}" = "1" ]; then - if [ -n "${pwSetStr}" ]; then - pwSetArry[0]=$(echo "${pwSetStr}" | cut -d " " -f 1) - pwSetArry[1]=$(echo "${pwSetStr}" | cut -d " " -f 2) - if pkexec ubuntustudio-pwjack-config ${pwSetArry[0]} ${pwSetArry[1]}; then - zenity --title "Ubuntu Studio Audio Configuration" \ - --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ - --info \ - --text "PipeWire Quantum set to ${pwSetArry[0]} Buffer and -${pwSetArry[1]} Hz Sample Rate. Please Log Out/Log In for settings -to take effect." + if [ "${strExit}" = "1" ]; then + exit 0; + fi + + if [ "${changeConfig}" = "Configure Current Audio Configuration" ] && \ + [ "${paConfig}" = "TRUE" ]; then + if ( zenity \ + --title "Ubuntu Studio Audio Configuration" \ + --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ + --question \ + --ok-label="Yes" \ + --cancel-label="No" \ + --text="For your current audio configuration (JACK/PulseAudio), please use Studio Controls.\n\ + Would you like to launch Studio Controls now?" ); then + studio-controls; + exit 0; + fi + fi + + if [ "${changeConfig}" = "Configure Current Audio Configuration" ] && \ + [ "${pwConfig}" = "TRUE" ]; then + pwSetStr=$(zenity \ + --title "Ubuntu Studio Audio Configuration" \ + --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ + --entry \ + --ok-label="OK" \ + --cancel-label="Cancel" \ + --text="Please enter the values for the PipeWire Quantum / JACK Plugin + configuration separated by a space.\n + First value is the Buffer Size which can be one of the following: + 16, 32, 64, 128, 256, 512, 1024, 2048, or 4096\n + Next value is the Sample Rate in Hertz (Hz) which can be one of the following: + 22050, 32000, 44100, 48000, 88200, 96000, or 192000\n + Example (default): 1024 48000\n + Leaving this blank will reset to default unless cancelled + If you're not sure what to do here, it's best to reset to defaults." ) + strExit=$? + if ! [ "${strExit}" = "1" ]; then + if [ -n "${pwSetStr}" ]; then + pwSetArry[0]=$(echo "${pwSetStr}" | cut -d " " -f 1) + pwSetArry[1]=$(echo "${pwSetStr}" | cut -d " " -f 2) + if pkexec ubuntustudio-pwjack-config ${pwSetArry[0]} ${pwSetArry[1]}; then + zenity --title "Ubuntu Studio Audio Configuration" \ + --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ + --info \ + --text "PipeWire Quantum set to ${pwSetArry[0]} Buffer and + ${pwSetArry[1]} Hz Sample Rate. Please Log Out/Log In for settings + to take effect." + else + zenity --title "Ubuntu Studio Audio Configuration" \ + --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ + --error \ + --text="An error has occurred. Check your entry and try again." + fi else - zenity --title "Ubuntu Studio Audio Configuration" \ - --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ - --error \ - --text="An error has occurred. Check your entry and try again." + if pkexec ubuntustudio-pwjack-config 1024 48000; then + zenity --title "Ubuntu Studio Audio Configuration" \ + --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ + --info \ + --text="PipeWire Quantum set to default 1024 Buffer and + 48000 Hz Sample Rate. Please Log Out/Log In for settings + to take effect." + else + zenity --title "Ubuntu Studio Audio Configuration" \ + --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ + --error \ + --text="An error has occurred." + fi fi - else - if pkexec ubuntustudio-pwjack-config 1024 48000; then + fi + fi + + if [ "${changeConfig}" = "Switch Configuration" ]; then + newConfig=$( zenity --width=600 --height=300 \ + --title="Ubuntu Studio Audio Configuration" \ + --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ + --list \ + --radiolist \ + --text="Which audio system would you like? Current system is selected." \ + --ok-label="Continue" \ + --cancel-label="Go Back" \ + --column="Select" \ + --column="Mode" \ + --column="Comment" \ + ${pwConfig} PipeWire "Recommended for most people" ${paConfig} PulseAudio-JACK "Recommended for professional/prosumer audio" ); + strExit=$? + if ! [ "${strExit}" = "1" ]; then + if [ "${newConfig}" = "PipeWire" ] && [ "${pwConfig}" = "TRUE" ]; then zenity --title "Ubuntu Studio Audio Configuration" \ --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ --info \ - --text="PipeWire Quantum set to default 1024 Buffer and -48000 Hz Sample Rate. Please Log Out/Log In for settings -to take effect." - else + --text="Your system is already using PipeWire, doing nothing" + elif [ "${newConfig}" = "PipeWire" ] && [ "${pwConfig}" = "FALSE" ]; then + if qapt-batch --install ubuntustudio-pipewire-config; then + zenity \ + --title "Ubuntu Studio Audio Configuration" \ + --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ + --info \ + --text="You must restart your computer for these changes to take effect." + exit 0 + else + zenity --title "Ubuntu Studio Audio Configuration" \ + --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ + --error \ + --text="An error has occurred." + fi + elif [ "${newConfig}" = "PulseAudio-JACK" ] && [ "${paConfig}" = "TRUE" ]; then zenity --title "Ubuntu Studio Audio Configuration" \ --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ - --error \ - --text="An error has occurred." + --info \ + --text="Your system is already configured for PulseAudio and JACK, doing nothing" + elif [ "${newConfig}" = "PulseAudio-JACK" ] && [ "${paConfig}" = "FALSE" ]; then + if qapt-batch --install ubuntustudio-pulseaudio-config; then + zenity \ + --title "Ubuntu Studio Audio Configuration" \ + --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ + --info \ + --text="You must restart your computer for these changes to take effect." + exit 0 + else + zenity --title "Ubuntu Studio Audio Configuration" \ + --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ + --error \ + --text="An error has occurred." + fi fi fi fi -fi - -if [ "${changeConfig}" = "Switch Configuration" ]; then - newConfig=$( zenity --width=600 --height=300 \ - --title="Ubuntu Studio Audio Configuration" \ - --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ - --list \ - --radiolist \ - --text="Which audio system would you like? Current system is selected." \ - --ok-label="Continue" \ - --cancel-label="Go Back" \ - --column="Select" \ - --column="Mode" \ - --column="Comment" \ - ${pwConfig} PipeWire "Recommended for most people" ${paConfig} PulseAudio-JACK "Recommended for professional/prosumer audio" ); - strExit=$? - if ! [ "${strExit}" = "1" ]; then - if [ "${newConfig}" = "PipeWire" ] && [ "${pwConfig}" = "TRUE" ]; then - zenity --title "Ubuntu Studio Audio Configuration" \ - --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ - --info \ - --text="Your system is already using PipeWire, doing nothing" - elif [ "${newConfig}" = "PipeWire" ] && [ "${pwConfig}" = "FALSE" ]; then - if qapt-batch --install ubuntustudio-pipewire-config; then - zenity \ - --title "Ubuntu Studio Audio Configuration" \ - --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ - --info \ - --text="You must restart your computer for these changes to take effect." - exit 0 - else - zenity --title "Ubuntu Studio Audio Configuration" \ - --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ - --error \ - --text="An error has occurred." + + if [ "${changeConfig}" = "${pwJackStr}" ]; then + if [ -e /etc/ld.so.conf.d/pipewire-jack.conf ]; then + if pkexec ubuntustudio-pwjack-config disable; then true; else + zenity --title "Ubuntu Studio Audio Configuration" \ + --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ + --error \ + --text="An error has occurred." fi - elif [ "${newConfig}" = "PulseAudio-JACK" ] && [ "${paConfig}" = "TRUE" ]; then - zenity --title "Ubuntu Studio Audio Configuration" \ - --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ - --info \ - --text="Your system is already configured for PulseAudio and JACK, doing nothing" - elif [ "${newConfig}" = "PulseAudio-JACK" ] && [ "${paConfig}" = "FALSE" ]; then - if qapt-batch --install ubuntustudio-pulseaudio-config; then - zenity \ - --title "Ubuntu Studio Audio Configuration" \ - --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ - --info \ - --text="You must restart your computer for these changes to take effect." - exit 0 - else + else + if pkexec ubuntustudio-pwjack-config enable; then true; else zenity --title "Ubuntu Studio Audio Configuration" \ - --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ - --error \ - --text="An error has occurred." + --window-icon=/usr/share/icons/hicolor/scalable/apps/ubuntustudio-audio-config.svg \ + --error \ + --text="An error has occurred." fi fi fi -fi + done