Deixe-me começar por esclarecer que a saída de áudio da minha tomada estéreo é detectada / listada como um dispositivo IEC958
/ S/PDIF
, mas não é uma saída óptica, é uma tomada estéreo padrão. Isso pode já ser a causa do problema.
Na detecção de conexão / desconexão do Windows funciona bem, e funcionou antes no linux (usando o Mint 4.10.0-35-generic) mas em outros WMs, atualmente usando i3
, mas eu acho que não está relacionado ao WM, e outra coisa poderia ter mudado nesse meio tempo. Não me lembro de instalar nenhum driver para o áudio, ele já funcionou.
O problema
Não consigo disparar o evento de plug-in / desconectar o conector de áudio.
O que funciona
Alternar manualmente com pavucontrol
para saída de estéreo digital (IEC958) ( iec985-stereo-output
) silenciará meus alto-falantes ( analog-output-speaker
) e fornecerá controle de volume e áudio no conector. Bom.
Não há outra opção na lista que ofereça o áudio exclusivo do meu conector (assim, os alto-falantes são silenciados). (Além deste outro problema que eu estava lidando com primeiro, até que eu descobri que eu tinha que mudar para a saída IEC958
: O volume de áudio vai de 0 a 100 em aux (basicamente apenas ligado / desligado) & link mas isso é um buraco de coelho completamente diferente para ir para baixo, mas de qualquer maneira.
Testando eventos audiojack
Acho que tenho maneiras exaustas de testar os eventos
evtest:
Available devices:
/dev/input/event0: Lid Switch
/dev/input/event1: Sleep Button
/dev/input/event2: Power Button
/dev/input/event3: Power Button
/dev/input/event4: AT Translated Set 2 keyboard
/dev/input/event5: Video Bus
/dev/input/event6: Video Bus
/dev/input/event7: Logitech MX Master 2S
/dev/input/event8: ETPS/2 Elantech Touchpad
/dev/input/event9: Metadot - Das Keyboard Das Keyboard
/dev/input/event10: Metadot - Das Keyboard Das Keyboard
/dev/input/event11: MSI WMI hotkeys
/dev/input/event12: NEC HD WebCam
/dev/input/event13: HDA Intel PCH Mic
/dev/input/event14: HDA Intel PCH HDMI/DP,pcm=3
/dev/input/event15: HDA Intel PCH HDMI/DP,pcm=7
/dev/input/event16: HDA Intel PCH HDMI/DP,pcm=8
14, 15, 16 não estão detectando nada. 13 dispara quando eu conecto no microfone, então pelo menos aquele funciona.
acpi_listen
❱ acpi_listen
nada ...
Mas para o microfone:
jack/microphone MICROPHONE plug
jack/microphone MICROPHONE unplug
diff events
Pelo que entendi, podemos zombar dos eventos com:
sudo cat /proc/asound/card0/codec\#0 > unplugged
sudo cat /proc/asound/card0/codec\#0 > plugged
diff unplugged plugged
Mas o diff não produz nada.
Hardware
pacmd
❱ pacmd list-sinks | grep -e 'name' -e 'index'
* index: 68
name: <alsa_output.pci-0000_00_1f.3.iec958-stereo>
alsa.name = "ALC898 Digital"
alsa.subdevice_name = "subdevice #0"
alsa.card_name = "HDA Intel PCH"
alsa.long_card_name = "HDA Intel PCH at 0xdf120000 irq 133"
alsa.driver_name = "snd_hda_intel"
device.vendor.name = "Intel Corporation"
device.profile.name = "iec958-stereo"
alsa.mixer_name = "Realtek ALC898"
device.icon_name = "audio-card-pci"
Lista mais longa
❱ pacmd list-sinks
1 sink(s) available.
* index: 68
name: <alsa_output.pci-0000_00_1f.3.iec958-stereo>
driver: <module-alsa-card.c>
flags: HARDWARE HW_MUTE_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: RUNNING
suspend cause:
priority: 9958
volume: front-left: 44895 / 69% / -9.86 dB, front-right: 44895 / 69% / -9.86 dB
balance 0.00
base volume: 65536 / 100% / 0.00 dB
volume steps: 65537
muted: no
current latency: 19.98 ms
max request: 4 KiB
max rewind: 64 KiB
monitor source: 82
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 1
linked by: 5
configured latency: 23.22 ms; range is 0.50 .. 371.52 ms
card: 0 <alsa_card.pci-0000_00_1f.3>
module: 6
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "ALC898 Digital"
alsa.id = "ALC898 Digital"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "1"
alsa.card = "0"
alsa.card_name = "HDA Intel PCH"
alsa.long_card_name = "HDA Intel PCH at 0xdf120000 irq 133"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:00:1f.3"
sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "a171"
device.form_factor = "internal"
device.string = "iec958:0"
device.buffering.buffer_size = "65536"
device.buffering.fragment_size = "32768"
device.access_mode = "mmap+timer"
device.profile.name = "iec958-stereo"
device.profile.description = "Digital Stereo (IEC958)"
device.description = "Built-in Audio Digital Stereo (IEC958)"
alsa.mixer_name = "Realtek ALC898"
alsa.components = "HDA:10ec0899,146211ac,00100003 HDA:8086280b,80860101,00100000"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
properties:
active port: <iec958-stereo-output>
aplay
❱ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC898 Analog [ALC898 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC898 Digital [ALC898 Digital]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
lsmod
❱ lsmod | grep '^snd' | column -t
snd_hda_codec_hdmi 49152 1
snd_hda_codec_realtek 90112 1
snd_hda_codec_generic 73728 1 snd_hda_codec_realtek
snd_hda_intel 36864 7
snd_hda_codec 126976 4 snd_hda_intel,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec_realtek
snd_hda_core 81920 5 snd_hda_intel,snd_hda_codec,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec_realtek
snd_hwdep 16384 1 snd_hda_codec
snd_pcm 102400 6 snd_hda_intel,snd_hda_codec,snd_hda_core,snd_hda_codec_hdmi
snd_seq_midi 16384 0
snd_seq_midi_event 16384 1 snd_seq_midi
snd_rawmidi 32768 1 snd_seq_midi
snd_seq 65536 2 snd_seq_midi_event,snd_seq_midi
snd_seq_device 16384 3 snd_seq,snd_rawmidi,snd_seq_midi
snd_timer 32768 2 snd_seq,snd_pcm
snd 77824 23 snd_hda_intel,snd_hwdep,snd_seq,snd_hda_codec,snd_timer,snd_rawmidi,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_seq_device,snd_hda_codec_realtek,snd_pcm
Não tenho certeza se é relevante, mas vou compartilhá-lo de qualquer maneira:
O mixer Alsa mostra S / PDIF a 0:
Enquantoopavucontrolmostraovolumecorretoparaoconectordeáudio
Eutenhoapenas1dispositivonoalsamixer:
Ah,equandoeuselecionoAnalogueStereoDuplex/Output,eunãopossoselecionarqualquerportadiferenteemOutputDevices
,Apenas"Speakers", eu suspeito que deve listar o conector de áudio como uma porta, mas não t.
Além disso, ao abrir as configurações de áudio canela, ele mostra apenas essas duas fontes de áudio separadas:
Atualizar
Saídasde:
hdajacksensetest
❱sudohdajacksensetestPin0x18(BlackMic,Rearside):present=Yes
hdajackretask
Tenteisubstituircomhdajackretask
Mas ainda não há detecção ...
amixer
❱ amixer
Simple mixer control 'Master',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 87
Mono: Playback 0 [0%] [-65.25dB] [off]
Simple mixer control 'PCM',0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 255 [100%] [0.00dB]
Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'Front',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 87
Mono:
Front Left: Playback 87 [100%] [0.00dB] [on]
Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Surround',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 87
Mono:
Front Left: Playback 87 [100%] [0.00dB] [on]
Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Center',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 87
Mono: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'LFE',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 87
Mono: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Side',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 87
Mono:
Front Left: Playback 87 [100%] [0.00dB] [on]
Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Mic',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 0 [0%] [-34.50dB] [off]
Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Mic Boost',0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 3
Front Left: 0 [0%] [0.00dB]
Front Right: 0 [0%] [0.00dB]
Simple mixer control 'IEC958',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'IEC958 Default PCM',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'IEC958',1
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'IEC958',2
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'IEC958',16
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'Beep',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 0 [0%] [-34.50dB] [off]
Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 63
Front Left: Capture 50 [79%] [20.25dB] [on]
Front Right: Capture 50 [79%] [20.25dB] [on]
Simple mixer control 'Loopback Mixing',0
Capabilities: enum
Items: 'Disabled' 'Enabled'
Item0: 'Disabled'