[WORKAROUND] No sound from jack port on HP Ultraslim docking station

I bought HP UltraSlim Docking Station recently, everything works fine except audio - despite the fact that external jack speakers are connected, sound is still being played from laptop internal speakers. In the sound settings I can see port selection, but option “Headphones” has status “disconnected”.
Alsa debug info:

inxi output:

System:    Kernel: 5.14.10-1-MANJARO x86_64 bits: 64 compiler: gcc v: 11.1.0 Console: pty pts/1 wm: kwin_wayland DM: SDDM
           Distro: Manjaro Linux base: Arch Linux
Machine:   Type: Laptop System: Hewlett-Packard product: HP EliteBook Revolve 810 G3 v: A3009FD18303 serial: <filter> Chassis:
           type: 10 serial: <filter>
           Mobo: Hewlett-Packard model: 22FB v: KBC Version 04.27 serial: <filter> BIOS: Hewlett-Packard v: M86 Ver. 01.22
           date: 02/18/2020
Battery:   ID-1: BAT0 charge: 39.0 Wh (98.0%) condition: 39.8/39.8 Wh (100.0%) volts: 12.4 min: 11.1
           model: Hewlett-Packard Primary type: Li-ion serial: <filter> status: Unknown
CPU:       Info: Dual Core model: Intel Core i7-5600U bits: 64 type: MT MCP arch: Broadwell rev: 4 cache: L1: 64 KiB L2: 4 MiB
           L3: 4 MiB
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 20756
           Speed: 2329 MHz min/max: 500/3200 MHz volts: 1.1 V ext-clock: 100 MHz Core speeds (MHz): 1: 2329 2: 2484 3: 2957
           4: 2244
Graphics:  Device-1: Intel HD Graphics 5500 vendor: Hewlett-Packard driver: i915 v: kernel bus-ID: 00:02.0 chip-ID: 8086:1616
           class-ID: 0300
           Device-2: Creative Live! Cam Sync HD [VF0770] type: USB driver: snd-usb-audio,uvcvideo bus-ID: 2-1.3.4:10
           chip-ID: 041e:4095 class-ID: 0102
           Device-3: Cheng Uei Precision Industry (Foxlink) HP EliteBook integrated HD Webcam type: USB driver: uvcvideo
           bus-ID: 2-7:11 chip-ID: 05c8:0374 class-ID: 0e02
           Display: server: X.Org compositor: kwin_wayland driver: loaded: modesetting alternate: fbdev,vesa
           resolution: 1: 1366x768~60Hz 2: 1920x1080~60Hz s-dpi: 96
           OpenGL: renderer: Mesa Intel HD Graphics 5500 (BDW GT2) v: 4.6 Mesa 21.2.3 direct render: Yes
Audio:     Device-1: Intel Broadwell-U Audio vendor: Hewlett-Packard driver: snd_hda_intel v: kernel bus-ID: 00:03.0
           chip-ID: 8086:160c class-ID: 0403
           Device-2: Intel Wildcat Point-LP High Definition Audio vendor: Hewlett-Packard driver: snd_hda_intel v: kernel
           bus-ID: 00:1b.0 chip-ID: 8086:9ca0 class-ID: 0403
           Device-3: Creative Live! Cam Sync HD [VF0770] type: USB driver: snd-usb-audio,uvcvideo bus-ID: 2-1.3.4:10
           chip-ID: 041e:4095 class-ID: 0102
           Sound Server-1: ALSA v: k5.14.10-1-MANJARO running: yes
           Sound Server-2: JACK v: 1.9.19 running: no
           Sound Server-3: PulseAudio v: 15.0 running: yes
           Sound Server-4: PipeWire v: 0.3.38 running: yes
Network:   Device-1: Intel Ethernet I218-LM vendor: Hewlett-Packard driver: e1000e v: kernel port: 5080 bus-ID: 00:19.0
           chip-ID: 8086:15a2 class-ID: 0200
           IF: enp0s25 state: up speed: 1000 Mbps duplex: full mac: <filter>
           Device-2: Intel Wireless 7265 driver: iwlwifi v: kernel bus-ID: 03:00.0 chip-ID: 8086:095a class-ID: 0280
           IF: wlo1 state: down mac: <filter>
Bluetooth: Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8 bus-ID: 2-4:3 chip-ID: 8087:0a2a
           class-ID: e001
           Report: rfkill ID: hci0 rfk-id: 1 state: up address: see --recommends
Drives:    Local Storage: total: 238.47 GiB used: 106.46 GiB (44.6%)
           ID-1: /dev/sda vendor: Samsung model: MZNTE256HMHP-000H1 size: 238.47 GiB speed: 6.0 Gb/s type: SSD
           serial: <filter> rev: 2H0Q scheme: MBR
Partition: ID-1: / size: 139.72 GiB used: 106.46 GiB (76.2%) fs: ext4 dev: /dev/sda3
Swap:      ID-1: swap-1 type: zram size: 3.59 GiB used: 0 KiB (0.0%) priority: 100 dev: /dev/zram0
Sensors:   System Temperatures: cpu: 45.0 C mobo: 0.0 C
           Fan Speeds (RPM): N/A
Repos:     Packages: pacman: 1585
           Active pacman repo servers in: /etc/pacman.d/mirrorlist
           1: https://mirror.init7.net/manjaro/stable/$repo/$arch
           2: https://quantum-mirror.hu/mirrors/pub/manjaro/stable/$repo/$arch
           3: http://mirror.terrahost.no/linux/manjaro/stable/$repo/$arch
           4: http://ftp.snt.utwente.nl/pub/linux/manjaro/stable/$repo/$arch
           5: https://manjaro.mirror.liquidtelecom.com/stable/$repo/$arch
           6: https://mirrors.tuna.tsinghua.edu.cn/manjaro/stable/$repo/$arch
Info:      Processes: 258 Uptime: 4h 12m wakeups: 1 Memory: 7.18 GiB used: 4.63 GiB (64.5%) Init: systemd v: 249 Compilers:
           gcc: 11.1.0 clang: 12.0.1 Shell: Bash (sudo) v: 5.1.8 running-in: yakuake inxi: 3.3.08

EDIT: I’ve found workaround using “hdajackretask” tool from alsa-tools package:

  • Set pin 0x14 to “Not Connected”
  • Set pin 0x1b to “Internal Speaker”
  • Install boot override, reboot
  • Select “Speaker” as port for internal stereo audio device in pulseaudio config.

Some notes:

  • Pin 0x1b for unknown reason is being shown as not connected, regardless of real state - you have to enable “Show unconnected pins” option to be able configure it.
  • Leaving 0x14 port as is causes sound to be played on both internal and external speakers.