Форум русскоязычного сообщества Ubuntu


Получить помощь и пообщаться с другими пользователями Ubuntu можно
на irc канале #ubuntu-ru в сети Freenode
и в Jabber конференции ubuntu@conference.jabber.ru

Автор Тема: Автоматическое переключение между наушниками и колонками  (Прочитано 4005 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн damix

  • Автор темы
  • Активист
  • *
  • Сообщений: 664
    • Просмотр профиля
Есть встроенная в материнскую плату звуковая карта Realtek ALC892, и есть еще звук по HMDI, через монитор. Видеокарты нет, монитор подключен через встройку.
Machine:   Device: desktop Mobo: Micro-Star model: B350 PC MATE (MS-7A34) v: 2.0 serial: N/A
           UEFI: American Megatrends v: A.E0 date: 05/02/2018
CPU:       Quad core AMD Ryzen 3 2200G with Radeon Vega Graphics (-MCP-) arch: Zen rev.0 cache: 2048 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm) bmips: 28001
           clock speeds: max: 3500 MHz 1: 1567 MHz 2: 1497 MHz 3: 1481 MHz 4: 1489 MHz
Graphics:  Card: Advanced Micro Devices [AMD/ATI] Vega [Radeon Vega 8 Mobile] bus-ID: 38:00.0
           Display Server: x11 (X.Org 1.19.6 ) drivers: ati,amdgpu (unloaded: modesetting,fbdev,vesa,radeon)
           Resolution: 1920x1080@60.00hz
           OpenGL: renderer: AMD RAVEN (DRM 3.27.0, 4.19.0-ubuntu, LLVM 6.0.0)
           version: 4.5 Mesa 18.1.9 Direct Render: Yes
Audio:     Card-1 Advanced Micro Devices [AMD] Device 15e3 driver: snd_hda_intel bus-ID: 38:00.6
           Card-2 Advanced Micro Devices [AMD/ATI] Device 15de driver: snd_hda_intel bus-ID: 38:00.1
           Sound: Advanced Linux Sound Architecture v: k4.19.0-ubuntu

Оба эти устройства работают, но когда подключаю наушники к порту на передней панели компьютера, звук на них не переключается. Приходится перезапустить pulseaudio -k и программу, которой нужен звук, и тогда он идет откуда надо. И после отключения наушников тоже звук идет через HDMI только после этих действий.

Интересует, как настроить, чтобы он автоматически переключался при подключении/отключении наушников. В идеале было бы хорошо создать такое виртуальное звуковое устройство (sink) и его сделать дефолтным.

Ubuntu 18.04

$ pactl list sinks
Аудиоприёмник №0
        Состояние: SUSPENDED
        Имя: alsa_output.pci-0000_38_00.1.hdmi-stereo
        Описание: HD-Audio Generic Digital Stereo (HDMI)
        Драйвер: module-alsa-card.c
        Спецификация отсчётов: s16le 2-канальный 4410
        Схема каналов: front-left,front-right
        Модуль-владелец: 7
        Звук выключен: нет
        Громкость: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 / 100% / 0,00 dB
                баланс 0,00
        Базовая громкость: 65536 / 100% / 0,00 dB
        Мониторный источник: alsa_output.pci-0000_38_00.1.hdmi-stereo.monitor
        Задержка: 0 мкс, настроено на 0 мкс
        Флаги: HARDWARE DECIBEL_VOLUME LATENCY SET_FORMATS
        Свойства:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "HDMI 0"
                alsa.id = "HDMI 0"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "3"
                alsa.card = "0"
                alsa.card_name = "HD-Audio Generic"
                alsa.long_card_name = "HD-Audio Generic at 0xfe688000 irq 55"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:38:00.1"
                sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:38:00.1/sound/card0"
                device.bus = "pci"
                device.vendor.id = "1002"
                device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
                device.product.id = "15de"
                device.string = "hdmi:0"
                device.buffering.buffer_size = "65536"
                device.buffering.fragment_size = "32768"
                device.access_mode = "mmap+timer"
                device.profile.name = "hdmi-stereo"
                device.profile.description = "Digital Stereo (HDMI)"
                device.description = "HD-Audio Generic Digital Stereo (HDMI)"
                alsa.mixer_name = "ATI R6xx HDMI"
                alsa.components = "HDA:1002aa01,00aa0100,00100700"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        Порты:
                hdmi-output-0: HDMI / DisplayPort (priority: 5900, available)
        Активный порт: hdmi-output-0
        Форматы:
                pcm

Аудиоприёмник №1
        Состояние: SUSPENDED
        Имя: alsa_output.pci-0000_38_00.6.analog-stereo
        Описание: HD-Audio Generic Аналоговый стерео
        Драйвер: module-alsa-card.c
        Спецификация отсчётов: s16le 2-канальный 4410
        Схема каналов: front-left,front-right
        Модуль-владелец: 8
        Звук выключен: нет
        Громкость: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 / 100% / 0,00 dB
                баланс 0,00
        Базовая громкость: 65536 / 100% / 0,00 dB
        Мониторный источник: alsa_output.pci-0000_38_00.6.analog-stereo.monitor
        Задержка: 0 мкс, настроено на 0 мкс
        Флаги: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
        Свойства:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "ALC892 Analog"
                alsa.id = "ALC892 Analog"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "1"
                alsa.card_name = "HD-Audio Generic"
                alsa.long_card_name = "HD-Audio Generic at 0xfe680000 irq 56"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:38:00.6"
                sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:38:00.6/sound/card1"
                device.bus = "pci"
                device.vendor.id = "1022"
                device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
                device.product.id = "15e3"
                device.string = "front:1"
                device.buffering.buffer_size = "65536"
                device.buffering.fragment_size = "32768"
                device.access_mode = "mmap+timer"
                device.profile.name = "analog-stereo"
                device.profile.description = "Аналоговый стерео"
                device.description = "HD-Audio Generic Аналоговый стерео"
                alsa.mixer_name = "Realtek ALC892"
                alsa.components = "HDA:10ec0892,1462fa34,00100302"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        Порты:
                analog-output-lineout: Линейный выход (priority: 9900, available)
                analog-output-headphones: Аналоговые наушники (priority: 9000, not available)
        Активный порт: analog-output-lineout
        Форматы:
                pcm

Оффлайн Luca Brasi

  • Активист
  • *
  • Сообщений: 706
  • typical engineer
    • Просмотр профиля
Ubuntu 18.04/ AMD Ryzen 5 2600 3.4GHz/ MSI B450-A Pro Max / Crucial DDR4-3000 16384MB / MSI PCI-Ex GeForce GT 710 2048 MB / Chieftec GPS-600

Оффлайн damix

  • Автор темы
  • Активист
  • *
  • Сообщений: 664
    • Просмотр профиля
Luca Brasi, этот модуль и так прописан
$ cat /etc/pulse/default.pa
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Use hot-plugged devices like Bluetooth or USB automatically (LP: #1702794)
.ifexists module-switch-on-connect.so
load-module module-switch-on-connect
.endif

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif

### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GConf settings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gconf.so
.nofail
load-module module-gconf
.fail
.endif

### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
load-module module-role-cork

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

### Make some devices default
#set-default-sink output
#set-default-source input

А вот подгружен ли, не знаю.
homa@ryzen:~$ pacmd list-modules
30 module(s) loaded.
    index: 0
        name: <module-device-restore>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Automatically restore the volume/mute state of devices"
                module.version = "11.1"
    index: 1
        name: <module-stream-restore>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Automatically restore the volume/mute/device state of streams"
                module.version = "11.1"
    index: 2
        name: <module-card-restore>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Automatically restore profile of cards"
                module.version = "11.1"
    index: 3
        name: <module-augment-properties>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Augment the property sets of streams with additional static information"
                module.version = "11.1"
    index: 4
        name: <module-switch-on-port-available>
        argument: <>
        used: -1
        load once: no
        properties:

    index: 5
        name: <module-switch-on-connect>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Michael Terry"
                module.description = "When a sink/source is added, switch to it or conditionally switch to it"
                module.version = "11.1"
    index: 6
        name: <module-udev-detect>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Detect available audio hardware and load matching drivers"
                module.version = "11.1"
    index: 7
        name: <module-alsa-card>
        argument: <device_id="0" name="pci-0000_38_00.1" card_name="alsa_card.pci-0000_38_00.1" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1">
        used: 0
        load once: no
        properties:
                module.author = "Lennart Poettering"
                module.description = "ALSA Card"
                module.version = "11.1"
    index: 8
        name: <module-alsa-card>
        argument: <device_id="1" name="pci-0000_38_00.6" card_name="alsa_card.pci-0000_38_00.6" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1">
        used: 0
        load once: no
        properties:
                module.author = "Lennart Poettering"
                module.description = "ALSA Card"
                module.version = "11.1"
    index: 9
        name: <module-bluetooth-policy>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Frédéric Dalleau, Pali Rohár"
                module.description = "Policy module to make using bluetooth devices out-of-the-box easier"
                module.version = "11.1"
    index: 10
        name: <module-bluetooth-discover>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "João Paulo Rechi Vita"
                module.description = "Detect available Bluetooth daemon and load the corresponding discovery module"
                module.version = "11.1"
    index: 11
        name: <module-bluez5-discover>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "João Paulo Rechi Vita"
                module.description = "Detect available BlueZ 5 Bluetooth audio devices and load BlueZ 5 Bluetooth audio drivers"
                module.version = "11.1"
    index: 12
        name: <module-native-protocol-unix>
        argument: <>
        used: -1
        load once: no
        properties:
                module.author = "Lennart Poettering"
                module.description = "Native protocol (UNIX sockets)"
                module.version = "11.1"
    index: 13
        name: <module-gconf>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "GConf Adapter"
                module.version = "11.1"
    index: 14
        name: <module-default-device-restore>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Automatically restore the default sink and source"
                module.version = "11.1"
    index: 15
        name: <module-rescue-streams>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "When a sink/source is removed, try to move its streams to the default sink/source"
                module.version = "11.1"
    index: 16
        name: <module-always-sink>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Colin Guthrie"
                module.description = "Всегда оставлять хотя бы один аудиоприёмник загруженным, даже если он пустой."
                module.version = "11.1"
    index: 17
        name: <module-intended-roles>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Automatically set device of streams based on intended roles of devices"
                module.version = "11.1"
    index: 18
        name: <module-suspend-on-idle>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "When a sink/source is idle for too long, suspend it"
                module.version = "11.1"
    index: 19
        name: <module-console-kit>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Create a client for each ConsoleKit session of this user"
                module.version = "11.1"
    index: 20
        name: <module-systemd-login>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Create a client for each login session of this user"
                module.version = "11.1"
    index: 21
        name: <module-position-event-sounds>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Position event sounds between L and R depending on the position on screen of the widget triggering them."
                module.version = "11.1"
    index: 22
        name: <module-role-cork>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Mute & cork streams with certain roles while others exist"
                module.version = "11.1"
    index: 23
        name: <module-filter-heuristics>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Colin Guthrie"
                module.description = "Detect when various filters are desirable"
                module.version = "11.1"
    index: 24
        name: <module-filter-apply>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Colin Guthrie"
                module.description = "Load filter sinks automatically when needed"
                module.version = "11.1"
    index: 25
        name: <module-x11-publish>
        argument: <display=:0>
        used: -1
        load once: no
        properties:
                module.author = "Lennart Poettering"
                module.description = "X11 credential publisher"
                module.version = "11.1"
    index: 26
        name: <module-x11-cork-request>
        argument: <display=:0>
        used: -1
        load once: no
        properties:
                module.author = "Lennart Poettering"
                module.description = "Synthesize X11 media key events when cork/uncork is requested"
                module.version = "11.1"
    index: 27
        name: <module-device-manager>
        argument: <do_routing=1>
        used: -1
        load once: yes
        properties:
                module.author = "Colin Guthrie"
                module.description = "Keep track of devices (and their descriptions) both past and present and prioritise by role"
                module.version = "11.1"
    index: 28
        name: <module-x11-xsmp>
        argument: <display=:0 session_manager=local/ryzen:@/tmp/.ICE-unix/1343,unix/ryzen:/tmp/.ICE-unix/1343>
        used: -1
        load once: no
        properties:
                module.author = "Lennart Poettering"
                module.description = "X11 session management"
                module.version = "11.1"
    index: 29
        name: <module-cli-protocol-unix>
        argument: <>
        used: -1
        load once: no
        properties:
                module.author = "Lennart Poettering"
                module.description = "Command line interface protocol (UNIX sockets)"
                module.version = "11.1"
homa@ryzen:~$ ls /usr/lib/pulse-11.1/modules
libalsa-util.so               module-cli-protocol-tcp.so        module-match.so                  module-sine.so
libbluez5-util.so             module-cli-protocol-unix.so       module-mmkbd-evdev.so            module-sine-source.so
libcli.so                     module-cli.so                     module-native-protocol-fd.so     module-snappy-policy.so
liboss-util.so                module-combine-sink.so            module-native-protocol-tcp.so    module-stream-restore.so
libprotocol-cli.so            module-combine.so                 module-native-protocol-unix.so   module-suspend-on-idle.so
libprotocol-http.so           module-console-kit.so             module-null-sink.so              module-switch-on-connect.so
libprotocol-native.so         module-dbus-protocol.so           module-null-source.so            module-switch-on-port-available.so
libprotocol-simple.so         module-default-device-restore.so  module-oss.so                    module-systemd-login.so
librtp.so                     module-detect.so                  module-pipe-sink.so              module-tunnel-sink-new.so
libwebrtc-util.so             module-device-manager.so          module-pipe-source.so            module-tunnel-sink.so
module-allow-passthrough.so   module-device-restore.so          module-position-event-sounds.so  module-tunnel-source-new.so
module-alsa-card.so           module-echo-cancel.so             module-remap-sink.so             module-tunnel-source.so
module-alsa-sink.so           module-esound-sink.so             module-remap-source.so           module-udev-detect.so
module-alsa-source.so         module-filter-apply.so            module-rescue-streams.so         module-virtual-sink.so
module-always-sink.so         module-filter-heuristics.so       module-role-cork.so              module-virtual-source.so
module-augment-properties.so  module-gconf.so                   module-role-ducking.so           module-virtual-surround-sink.so
module-bluetooth-discover.so  module-http-protocol-tcp.so       module-rtp-recv.so               module-volume-restore.so
module-bluetooth-policy.so    module-http-protocol-unix.so      module-rtp-send.so               module-x11-bell.so
module-bluez5-device.so       module-intended-roles.so          module-rygel-media-server.so     module-x11-cork-request.so
module-bluez5-discover.so     module-ladspa-sink.so             module-simple-protocol-tcp.so    module-x11-publish.so
module-card-restore.so        module-loopback.so                module-simple-protocol-unix.so   module-x11-xsmp.so
homa@ryzen:~$

Оффлайн Tear

  • Старожил
  • *
  • Сообщений: 1445
  • Ubuntu 16.04 LTS
    • Просмотр профиля
А передняя панель подключена по стандарту HD Audio или  AC97?

Оффлайн damix

  • Автор темы
  • Активист
  • *
  • Сообщений: 664
    • Просмотр профиля

Оффлайн damix

  • Автор темы
  • Активист
  • *
  • Сообщений: 664
    • Просмотр профиля
Скопировал все файлы из /etc/pulse в ~/.config/pulse, удалил из ~/.config/pulse файл, заканчивающийся на stream-volumes.tdb
В ~/.config/pulse/default.pa заменил строчку load-module module-stream-restore на load-module module-stream-restore restore_device=false перезапустил pulseaudio pulseaudio -k
Создал такие файлы:
$ cat /etc/acpi/jack-connected.sh
inputs=$(sudo -u homa XDG_RUNTIME_DIR=/run/user/`id -u homa` pacmd list-sink-inputs | awk '$1 == "index:" {print $2}')
for INPUT in $inputs; do # Move all current inputs to the new default sound card
  sudo -u homa XDG_RUNTIME_DIR=/run/user/`id -u homa` pacmd move-sink-input $INPUT alsa_output.pci-0000_38_00.6.analog-stereo
done
$ cat /etc/acpi/jack-disconnected.sh
inputs=$(sudo -u homa XDG_RUNTIME_DIR=/run/user/`id -u homa` pacmd list-sink-inputs | awk '$1 == "index:" {print $2}')
for INPUT in $inputs; do # Move all current inputs to the new default sound card
  sudo -u homa XDG_RUNTIME_DIR=/run/user/`id -u homa` pacmd move-sink-input $INPUT alsa_output.pci-0000_38_00.1.hdmi-stereo
done
Сделал
chmod 755 /etc/acpi/jack-connected.sh
chmod 755 /etc/acpi/jack-disconnected.sh

Создал еще такие файлы:
$ cat /etc/acpi/events/jack-connected
event=jack/headphone HEADPHONE plug
action=/etc/acpi/jack-connected.sh
$ cat /etc/acpi/events/jack-disconnected
event=jack/headphone HEADPHONE unplug
action=/etc/acpi/jack-disconnected.sh

И перезапустил acpid
systemctl restart acpid.service
Теперь при подключенных наушниках звук идет из наушников, а при отключенных - из колонок.

Все ведь элементарно было для линуксоида!

Использованные источники
https://www.freedesktop.org/wiki/Software/PulseAudio/FAQ/#index40h3
https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/DefaultDevice/
https://askubuntu.com/questions/640741/what-code-is-executed-when-headphones-are-disconnected
« Последнее редактирование: 16 Мая 2020, 16:08:15 от damix »

 

Страница сгенерирована за 0.07 секунд. Запросов: 25.