Клавиши громкости перестают работать при переключении аудиовыходов

Я предполагаю, что вы установили ubuntu в раздел «Неправильный» (это C: диск).

Чтобы подтвердить: загрузите свой ubuntu os и найдите каталог, в котором есть папки ниже. (perflog, Program files, Пользователи, Windows)

Если нет, вам нужно снова установить ОС Windows

, если да, запустите свой ubuntu os и следуйте этому и выберите windows os.

0
задан 8 October 2017 в 22:21

2 ответа

Я думаю, что у меня была такая же проблема, что и переход от внутреннего звука к звуковой панели USB. Я устал от ручных действий, и, когда я часто забывал нажать зеленую кнопку на вкладке «Выход», я решил запустить скрипт и вызвать его из Launcher. Мой сценарий (я называл его ToggleAudioOutput) использует вывод pacmd list-sinks для запроса всех выходных приемников и переключений к следующему. Моя система имеет аудио HDMI, но поскольку я ее не использую, скрипт пропускает ее. В скрипте достаточно комментариев, чтобы можно было настроить его в свою систему. Надеюсь, это поможет.

#!/bin/bash ############################################################################### # -- ToggleAudioOutput -- Script to change audio output sink. # ################ # Program logic # # The function GetSinks performs a query and transformation. # The output of GetSinks is stored in a variable. # The number of sinks and the active sink (*) is determined. # An array of all sinks is created, the active sink's position is saved. # The next (or rolling to the first) sink in the array is marked. # The marked sink is made active. # Is an application using the previous sink, force it to use the active. # A notification about the active sink is shown on the screen. ################ function GetSinks() { # Function logic # # From the (lengthy) output of 'pacmd list-sinks': # grep for 'index' and 'device.description'; giving 2 lines, # awk merges 2 lines to 1, # remove the 'HDMI' line, (optional) # remove 'index:' and 'device.description =' # # For example, the result on my system # index: 0 # device.description = "Built-in Audio Digital Stereo (HDMI)" # index: 1 # device.description = " Logitech Z305 Analog Stereo" # * index: 2 # device.description = "Built-in Audio Analog Stereo" # # is transformed to: # 1 Logitech Z305 Analog Stereo # *2 Built-in Audio Analog Stereo # ################ # Function body. Property="device.description" # if HDMI must be in the toggle, comment it out or delete it. # Be sure to not change the sequence of the following lines. pacmd list-sinks |\ grep -e"index:" -e"${Property}" |\ awk 'NR%2{printf "%s",$0;next;}1' |\ grep -v HDMI |\ sed "s/^\ \ //" |\ sed "s/ index: //" |\ sed "s/[ \x9]*$Property = / /" |\ tr -d '\"' } # End Of Function ################ # Script body. Sinks=$(GetSinks) # call the function, store the output in a variable. NrSinks=$(echo "$Sinks" | wc -l) ActSink=$(echo "$Sinks" | grep '*' | cut -c2) # fill the array, save the active sink's position. i=1 while read Line do set -- $Line SinkNr[$i]=$1;shift SinkName[$i]="$@" ((SinkNr[$i]==ActSink)) && ((Index=i)) ((i++)) done < <(echo "$Sinks" | tr -d '*') # The next or first sink becomes the active. ((Index++)) if ((Index > NrSinks)) then Index=1 fi # Make it happen: pacmd set-default-sink ${SinkNr[$Index]} for InputIndex in $(pacmd list-sink-inputs | grep 'index:' | awk '{print $2}') do pacmd move-sink-input $InputIndex ${SinkNr[$Index]} done notify-send "Audio output device set to: >${SinkName[$Index]}<" -t 5000 # End Of File
0
ответ дан 18 July 2018 в 05:35

Я думаю, что у меня была такая же проблема, что и переход от внутреннего звука к звуковой панели USB. Я устал от ручных действий, и, когда я часто забывал нажать зеленую кнопку на вкладке «Выход», я решил запустить скрипт и вызвать его из Launcher. Мой сценарий (я называл его ToggleAudioOutput) использует вывод pacmd list-sinks для запроса всех выходных приемников и переключений к следующему. Моя система имеет аудио HDMI, но поскольку я ее не использую, скрипт пропускает ее. В скрипте достаточно комментариев, чтобы можно было настроить его в свою систему. Надеюсь, это поможет.

#!/bin/bash ############################################################################### # -- ToggleAudioOutput -- Script to change audio output sink. # ################ # Program logic # # The function GetSinks performs a query and transformation. # The output of GetSinks is stored in a variable. # The number of sinks and the active sink (*) is determined. # An array of all sinks is created, the active sink's position is saved. # The next (or rolling to the first) sink in the array is marked. # The marked sink is made active. # Is an application using the previous sink, force it to use the active. # A notification about the active sink is shown on the screen. ################ function GetSinks() { # Function logic # # From the (lengthy) output of 'pacmd list-sinks': # grep for 'index' and 'device.description'; giving 2 lines, # awk merges 2 lines to 1, # remove the 'HDMI' line, (optional) # remove 'index:' and 'device.description =' # # For example, the result on my system # index: 0 # device.description = "Built-in Audio Digital Stereo (HDMI)" # index: 1 # device.description = " Logitech Z305 Analog Stereo" # * index: 2 # device.description = "Built-in Audio Analog Stereo" # # is transformed to: # 1 Logitech Z305 Analog Stereo # *2 Built-in Audio Analog Stereo # ################ # Function body. Property="device.description" # if HDMI must be in the toggle, comment it out or delete it. # Be sure to not change the sequence of the following lines. pacmd list-sinks |\ grep -e"index:" -e"${Property}" |\ awk 'NR%2{printf "%s",$0;next;}1' |\ grep -v HDMI |\ sed "s/^\ \ //" |\ sed "s/ index: //" |\ sed "s/[ \x9]*$Property = / /" |\ tr -d '\"' } # End Of Function ################ # Script body. Sinks=$(GetSinks) # call the function, store the output in a variable. NrSinks=$(echo "$Sinks" | wc -l) ActSink=$(echo "$Sinks" | grep '*' | cut -c2) # fill the array, save the active sink's position. i=1 while read Line do set -- $Line SinkNr[$i]=$1;shift SinkName[$i]="$@" ((SinkNr[$i]==ActSink)) && ((Index=i)) ((i++)) done < <(echo "$Sinks" | tr -d '*') # The next or first sink becomes the active. ((Index++)) if ((Index > NrSinks)) then Index=1 fi # Make it happen: pacmd set-default-sink ${SinkNr[$Index]} for InputIndex in $(pacmd list-sink-inputs | grep 'index:' | awk '{print $2}') do pacmd move-sink-input $InputIndex ${SinkNr[$Index]} done notify-send "Audio output device set to: >${SinkName[$Index]}<" -t 5000 # End Of File
0
ответ дан 24 July 2018 в 18:22

Другие вопросы по тегам:

Похожие вопросы: