1

Let me start of by clarifying that my stereo jack audio output is detected/listed as an IEC958/S/PDIF device, but it's not an optical output, it's a standard stereo jack. This might already be the cause of the problem.

On Windows plugging/unplugging detection works fine, and it has worked before on linux (using Mint 4.10.0-35-generic) but on other WMs, currently using i3, but I think it's unrelated to the WM, and something else might have changed in the meantime. I don't remember installing any drivers for the audio, it already worked.

The problem

I can't get the audio jack plugin/unplug event to fire.

What does work

Manually switching with pavucontrol to Digital Stereo (IEC958) Output (iec985-stereo-output) will mute my speakers (analog-output-speaker) and give me audio and volume control on the jack. Good.

There is no other option in the list that will give my jack exclusive audio (so speakers muted). (Other than this other issue I was dealing with first, until I found out I had to switch to the IEC958 output: Audio volume goes from 0 to 100 on aux (basically only on/off) & https://forums.linuxmint.com/viewtopic.php?f=48&t=256467&p=1391958#p1391958 but that's an entirely different rabbit hole to go down) but anyway.

Testing audiojack events

I think I've exhausted ways to test the events

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 are not detecting anything at all. 13 does trigger when I plug it into the mic, so at least that one works.

acpi_listen

❱ acpi_listen

nothing... But for the microphone:

jack/microphone MICROPHONE plug
jack/microphone MICROPHONE unplug

diff events

From what I understand we can mock the events with:

sudo cat /proc/asound/card0/codec\#0 > unplugged
sudo cat /proc/asound/card0/codec\#0 > plugged
diff unplugged plugged

But the diff outputs nothing.

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"

Longer list

❱ 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

Not sure it's relevant, but I'll share it anyways:

Alsa mixer shows S/PDIF at 0:

Alsa mixer shows S/PDIF at 0

While pavucontrol show the correct volume for the audio jack

enter image description here

I have only 1 device in alsamixer:

enter image description here

Oh, and when I select Analogue Stereo Duplex/Output, I can't select any different port under Output Devices, Only "Speakers", I suspect that it should list the audio jack as a port, but it don't.

Also, when open cinnamon audio settings it shows only these 2 as separate audio sources: enter image description here

Update

Outputs of:

hdajacksensetest

❱ sudo hdajacksensetest
Pin 0x18 (Black Mic, Rear side): present = Yes

hdajackretask

enter image description here

Tried overriding with hdajackretask

enter image description here

But still no detection...

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'
2

Guess: The BIOS is lying about the assignment of the jacks, and you are missing a "quirk" in the drivers to work around that, or when you updated you got a quirk that doesn't fit your situation.

In Windows this doesn't matter, because the pre-installed driver ignores the BIOS information and uses the correct (known) assignment.

Have a look at hdajackretask and hdajacksensetest (package alsa-tools-gui on Debian etc.) and see if you can fix the assignment. Information about what the codec things the assignment is can be found with cat /proc/asound/card*/codec\#*. There you can also see if the jack is configured to emit "unsoliticed events" (aka plug events).

  • sudo hdajacksensetest: Pin 0x18 (Black Mic, Rear side): present = No. Getting no other pins. Not sure what to do with hdajackretask. I can only select override and say disconnected` for the SPDIF out – TrySpace Nov 27 '17 at 9:16
  • I've updated my question with some additional output, and tried overriding the jack, but to no avail. – TrySpace Nov 27 '17 at 9:28
  • Is there a way to detect any events on the unconnected pins somehow? acpi_listen etc don't.. – TrySpace Nov 27 '17 at 9:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.