Sound not working properly after using HDMI output

Hi.

Yesterday I connected my laptop to my TV using HDMI. I changed output to the HDMI port. Now that I’m not connected to the HDMI port, internal audio isn’t working, and I can change the output using the gnome settings. When turning up or down the volume it shows HDMI, but it is not connected. The only way I can get the speakers to work is by plugging and unplugging headphones in the output jack. I’m suing Pipewire and the inxi -Fza output is as follows

System:
  Kernel: 6.1.33-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 13.1.1
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.1-x86_64
    root=UUID=7ec44c7c-e166-4f68-b066-3eb4736827ac rw quiet splash apparmor=1
    security=apparmor udev.log_priority=3
  Desktop: GNOME v: 44.2 tk: GTK v: 3.24.38 wm: gnome-shell dm: GDM v: 44.1
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: ASUSTeK product: VivoBook_ASUSLaptop X509FJ_X509FJ
    v: 1.0 serial: <superuser required>
  Mobo: ASUSTeK model: X509FJ v: 1.0 serial: <superuser required>
    UEFI: American Megatrends v: X509FJ.303 date: 04/30/2020
Battery:
  ID-1: BAT0 charge: 26.4 Wh (96.7%) condition: 27.3/29.3 Wh (93.2%)
    volts: 7.7 min: 7.7 model: ASUSTeK ASUS Battery type: Li-ion serial: N/A
    status: discharging cycles: 287
CPU:
  Info: model: Intel Core i5-8265U bits: 64 type: MT MCP
    arch: Comet/Whiskey Lake note: check gen: core 8 level: v3 note: check
    built: 2018 process: Intel 14nm family: 6 model-id: 0x8E (142)
    stepping: 0xC (12) microcode: 0xF6
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
    L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB
    L3: 6 MiB desc: 1x6 MiB
  Speed (MHz): avg: 923 high: 1800 min/max: 400/3900 scaling:
    driver: intel_pstate governor: powersave cores: 1: 800 2: 800 3: 800 4: 800
    5: 800 6: 1800 7: 800 8: 788 bogomips: 28808
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data mitigation: Clear CPU buffers; SMT vulnerable
  Type: retbleed mitigation: Enhanced IBRS
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Enhanced IBRS, IBPB: conditional, RSB
    filling, PBRSB-eIBRS: SW sequence
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel WhiskeyLake-U GT2 [UHD Graphics 620] vendor: ASUSTeK
    driver: i915 v: kernel arch: Gen-9.5 process: Intel 14nm built: 2016-20
    ports: active: eDP-1 empty: HDMI-A-1 bus-ID: 00:02.0 chip-ID: 8086:3ea0
    class-ID: 0300
  Device-2: IMC Networks USB2.0 VGA UVC WebCam driver: uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-5:4 chip-ID: 13d3:5a11
    class-ID: 0e02
  Display: wayland server: X.org v: 1.21.1.8 with: Xwayland v: 23.1.2
    compositor: gnome-shell driver: X: loaded: modesetting,nvidia dri: iris
    gpu: i915 display-ID: 0
  Monitor-1: eDP-1 model: ChiMei InnoLux 0x15e6 built: 2016 res: 1366x768
    dpi: 101 gamma: 1.2 size: 344x193mm (13.54x7.6") diag: 394mm (15.5")
    ratio: 16:9 modes: 1366x768
  API: OpenGL v: 4.6 Mesa 23.1.2 renderer: Mesa Intel UHD Graphics 620 (WHL
    GT2) direct-render: Yes
Audio:
  Device-1: Intel Cannon Point-LP High Definition Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel alternate: snd_soc_skl,snd_sof_pci_intel_cnl
    bus-ID: 00:1f.3 chip-ID: 8086:9dc8 class-ID: 0403
  API: ALSA v: k6.1.33-1-MANJARO status: kernel-api with: aoss
    type: oss-emulator tools: alsactl,alsamixer,amixer
  Server-1: JACK v: 1.9.22 status: off tools: N/A
  Server-2: PipeWire v: 0.3.71 status: off tools: pw-cli
  Server-3: PulseAudio v: 16.1 status: active with: pulseaudio-alsa
    type: plugin tools: pacat,pactl
Network:
  Device-1: Intel Cannon Point-LP CNVi [Wireless-AC] driver: iwlwifi v: kernel
    bus-ID: 00:14.3 chip-ID: 8086:9df0 class-ID: 0280
  IF: wlo1 state: up mac: <filter>
Bluetooth:
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) driver: btusb
    v: 0.8 type: USB rev: 2.0 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-10:5
    chip-ID: 8087:0aaa class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 3 state: up address: see --recommends
RAID:
  Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci
    v: 3.0 port: 4060 bus-ID: 00:17.0 chip-ID: 8086:282a rev: N/A class-ID: 0104
Drives:
  Local Storage: total: 931.51 GiB used: 253.55 GiB (27.2%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/sda maj-min: 8:0 vendor: Toshiba model: MQ04ABF100
    size: 931.51 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    tech: HDD rpm: 5400 serial: <filter> fw-rev: 1J scheme: GPT
Partition:
  ID-1: / raw-size: 930.61 GiB size: 914.93 GiB (98.32%)
    used: 253.55 GiB (27.7%) fs: ext4 dev: /dev/sda3 maj-min: 8:3
  ID-2: /boot/efi raw-size: 260 MiB size: 256 MiB (98.46%)
    used: 1.2 MiB (0.5%) fs: vfat dev: /dev/sda1 maj-min: 8:1
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: 42.0 C pch: 38.0 C mobo: N/A
  Fan Speeds (RPM): cpu: 1700
Info:
  Processes: 264 Uptime: 2m wakeups: 1 Memory: available: 7.61 GiB
  used: 1.75 GiB (23.0%) Init: systemd v: 253 default: graphical
  tool: systemctl Compilers: gcc: 13.1.1 clang: 15.0.7 Packages: 1542
  pm: pacman pkgs: 1524 libs: 454 tools: gnome-software,pamac pm: flatpak
  pkgs: 18 Shell: Zsh v: 5.9 running-in: gnome-terminal inxi: 3.3.27

imagen
imagen

It looks like you have both PulseAudio and PipeWire installed, you should really just have one or the other installed.

To remove PulseAudio and install PipeWire, from terminal run:

sudo pacman -R manjaro-pulseaudio

then

sudo pacman -S manjaro-pipewire

Reboot.

Please post more information about PulseAudio configuration

pacmd dump; pactl list sinks

It looks like you have both PulseAudio and PipeWire installed, you should really just have one or the other installed.

inxi data shows only PulseAudio is active

Sink #518
	State: SUSPENDED
	Name: alsa_output.pci-0000_00_1f.3.hdmi-stereo
	Description: Built-in Audio Digital Stereo (HDMI)
	Driver: PipeWire
	Sample Specification: s32le 2ch 48000Hz
	Channel Map: front-left,front-right
	Owner Module: 4294967295
	Mute: no
	Volume: front-left: 53740 /  82% / -5,17 dB,   front-right: 53740 /  82% / -5,17 dB
	        balance 0,00
	Base Volume: 65536 / 100% / 0,00 dB
	Monitor Source: alsa_output.pci-0000_00_1f.3.hdmi-stereo.monitor
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE DECIBEL_VOLUME LATENCY SET_FORMATS 
	Properties:
		object.path = "alsa:pcm:0:hdmi:0:playback"
		api.alsa.path = "hdmi:0"
		api.alsa.pcm.card = "0"
		api.alsa.pcm.stream = "playback"
		audio.channels = "2"
		audio.position = "FL,FR"
		device.routes = "1"
		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 = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0xb4218000 irq 135"
		alsa.driver_name = "snd_hda_intel"
		device.profile.name = "hdmi-stereo"
		device.profile.description = "Digital Stereo (HDMI)"
		card.profile.device = "7"
		device.id = "38"
		factory.name = "api.alsa.pcm.sink"
		priority.driver = "952"
		priority.session = "952"
		media.class = "Audio/Sink"
		node.nick = "HDA Intel PCH"
		node.name = "alsa_output.pci-0000_00_1f.3.hdmi-stereo"
		device.description = "Built-in Audio"
		device.icon_name = "audio-card-hdmi"
		device.bus = "pci"
		device.bus_path = "pci-0000:00:1f.3"
		device.form_factor = "internal"
		node.pause-on-idle = "false"
		factory.id = "18"
		clock.quantum-limit = "8192"
		client.id = "33"
		node.driver = "true"
		factory.mode = "merge"
		audio.adapt.follower = ""
		library.name = "audioconvert/libspa-audioconvert"
		object.id = "48"
		object.serial = "518"
		node.max-latency = "16384/48000"
		api.alsa.period-size = "1024"
		api.alsa.period-num = "32"
		api.alsa.headroom = "0"
		device.enum.api = "udev"
		api.alsa.card = "0"
		api.alsa.card.name = "HDA Intel PCH"
		api.alsa.card.longname = "HDA Intel PCH at 0xb4218000 irq 135"
		device.plugged.usec = "35124890"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
		device.subsystem = "sound"
		device.vendor.id = "0x8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "0x9dc8"
		device.product.name = "Cannon Point-LP High Definition Audio Controller"
		device.name = "alsa_card.pci-0000_00_1f.3"
		device.nick = "HDA Intel PCH"
		api.alsa.use-acp = "true"
		api.acp.auto-profile = "false"
		api.acp.auto-port = "false"
		api.dbus.ReserveDevice1 = "Audio0"
		device.string = "0"
	Ports:
		hdmi-output-0: HDMI / DisplayPort (type: HDMI, priority: 5900, availability group: Legacy 4, not available)
	Active Port: hdmi-output-0
	Formats:
		pcm

I did it and have had fixed the issue, but then I connected again to the HDMI and the same thing happened.

Hi, did someone find a solution to this problem? I have the same issue and cannot figure out how to fix it

Likely you had same issue as OP and I, might have both pulseaudio and pipewire installed;
run sudo pacman -S manjaro-pipewire and it will prompt you with conflicting programs - allow it to remove the pulseaudio files and then install and restart. Worked for me!