Ubuntu doesn't detect HDMI Speaker - No Sound

Hello

I have Acer laptop (GTX 1050), I have a problem with the audio switch, it can’t detect the HDMI monitor speaker

For Windows, Everything works well and I can switch audio between the laptop and the external screen easily unlike Ubuntu.

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC255 Analog [ALC255 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0

$ uname -sr
Linux 6.2.0-35-generic

I have attached the log file for this command
$ sudo nvidia-bug-report.sh

I don’t know why it doesn’t detect the external monitor speakers, Any suggestions?

nvidia-bug-report.log.gz (309.3 KB)

The kernel fails to power on the nvidia audio device. Please check if upgrading the kernel by switching to the hwe kernel fixes this
sudo apt install --install-recommends linux-generic-hwe-22.04
For a workaround, you could use the old kernel module
https://github.com/hhfeuer/nvhda
but you would have to disable secure boot in bios for that.

After switching to hwe, you need to run a system update to get the matching nvidia driver.

I followed your instructions but I still have the same issue

I have updated “nvidia-bug-report.log.gz” file

nvidia-bug-report.log.gz (358.1 KB)

Is there any bios update avallable for the laptop?
If not please check if the nvhda module works.

No, the bois are already up-to-date

I installed nvhda module and I executed the following commands (considering disabling the secure boot)

$ sudo modprobe nvhda

$ sudo tee /proc/acpi/nvhda <<<ON
ON

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC255 Analog [ALC255 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0

I tried to reboot and execute the commands again but I’m wondering why it doesn’t detect the Monitor speaker over HDMI !!

Also, I have another question, is that normal for all users, I mean does everyone need to install nvhda in order to enable sound over HDMI !

I have attached the updated “nvidia-bug-report.log.gz” file

nvidia-bug-report.log.gz (342.5 KB)

No, it was only needed prior to kernel 5.4.

I’ve checked your logs again and initially the audio device is there, then vanishes, then appears again when nvhda is used, then vanishes again. This rather points to some udev rule being installed that removes it. Please post the output of
grep -ri 10de /lib/udev/rules.d /usr/lib/udev/rules.d

$ grep -ri 10de /lib/udev/rules.d /usr/lib/udev/rules.d

/lib/udev/rules.d/71-nvidia.rules:SUBSYSTEM==“pci”, ATTRS{vendor}==“0x10de”, DRIVERS==“nvidia”, TAG+=“seat”, TAG+=“master-of-seat”
/lib/udev/rules.d/71-nvidia.rules:ACTION==“bind”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x03[0-9]", TEST==“power/control”, ATTR{power/control}=“auto”
/lib/udev/rules.d/71-nvidia.rules:ACTION==“add”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x040300”, TEST==“power/control”, ATTR{power/control}=“auto”
/lib/udev/rules.d/71-nvidia.rules:ACTION==“add”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x0c0330”, TEST==“power/control”, ATTR{power/control}=“auto”
/lib/udev/rules.d/71-nvidia.rules:ACTION==“add”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x0c8000”, TEST==“power/control”, ATTR{power/control}=“auto”
/usr/lib/udev/rules.d/71-nvidia.rules:SUBSYSTEM==“pci”, ATTRS{vendor}==“0x10de”, DRIVERS==“nvidia”, TAG+=“seat”, TAG+=“master-of-seat”
/usr/lib/udev/rules.d/71-nvidia.rules:ACTION==“bind”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}=="0x03[0-9]
”, TEST==“power/control”, ATTR{power/control}=“auto”
/usr/lib/udev/rules.d/71-nvidia.rules:ACTION==“add”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x040300”, TEST==“power/control”, ATTR{power/control}=“auto”
/usr/lib/udev/rules.d/71-nvidia.rules:ACTION==“add”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x0c0330”, TEST==“power/control”, ATTR{power/control}=“auto”
/usr/lib/udev/rules.d/71-nvidia.rules:ACTION==“add”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x0c8000”, TEST==“power/control”, ATTR{power/control}=“auto”

Those are normal rules. Please post the output of
grep -ri 10de /etc/udev/rules.d

I tried to execute grep -ri 10de /etc/udev/rules.d
but it doesn’t return anything

Do you have any special power management application/ prime manager installed?

I think prime manager, what should I do?

That’s just the standard Ubuntu feature, shouldn’t have any influence.

Please check if udev does anything to your audio device, set messages to debu

sudo udevadm control --log-priority=debug

then use the nvhda module to turn on the audio, check if the device is missing again, running
sudo lspci -s 01:00.1
should not output anything.
Then check journal what happened
sudo journalctl -e

sudo udevadm control --log-priority=debug
sudo lspci -s 01:00.1

doesn’t return anything

Screenshot from 2024-05-28 22-42-16

here are the output for sudo journalctl -e

may 28 23:03:34 server sudo[8110]: ubuntu : TTY=pts/0 ; PWD=/home/ubuntu ; USER=root ; COMMAND=/usr/bin/journalctl -e
may 28 23:03:34 server sudo[8110]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
may 28 23:03:42 server dbus-daemon[1480]: apparmor=“DENIED” operation=“dbus_signal” bus=“session” path=“/com/canonical/unity/launcherentry/TelegramDesktop” interface=“c>
may 28 23:03:57 server fstrim[8054]: /home: 23,9 GiB (25705955328 bytes) trimmed on /dev/nvme0n1p6
may 28 23:03:57 server fstrim[8054]: /boot/efi: 61,3 MiB (64242688 bytes) trimmed on /dev/nvme0n1p1
may 28 23:03:57 server fstrim[8054]: /: 53,8 GiB (57764487168 bytes) trimmed on /dev/nvme0n1p5
may 28 23:03:57 server systemd[1]: fstrim.service: Deactivated successfully.
may 28 23:03:57 server systemd[1]: Finished Discard unused blocks on filesystems from /etc/fstab.
may 28 23:03:57 server systemd[1]: fstrim.service: Consumed 1.455s CPU time.
may 28 23:04:26 server sudo[8110]: pam_unix(sudo:session): session closed for user root
may 28 23:04:27 server kernel: [UFW BLOCK] IN=wlp2s0 OUT= MAC=01:00:5e:00:00:01:18:0f:76:7e:35:74:08:00 SRC=192.168.1.1 DST=224.0.0.1 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=>
may 28 23:04:28 server systemd[1276]: Started Application launched by gnome-shell.
may 28 23:04:28 server systemd[1276]: Started VTE child process 8144 launched by gnome-terminal-server process 8065.
may 28 23:04:32 server gnome-shell[1942]: Can’t update stage views actor [:0x56cdf12a42f0] is on because it needs an allocation.
may 28 23:04:32 server gnome-shell[1942]: Can’t update stage views actor [:0x56cdf2f3a750] is on because it needs an allocation.
may 28 23:04:32 server gnome-shell[1942]: Can’t update stage views actor [:0x56cdf2f3e6e0] is on because it needs an allocation.
may 28 23:04:33 server sudo[8159]: ubuntu : TTY=pts/1 ; PWD=/home/ubuntu ; USER=root ; COMMAND=/usr/bin/lspci -s 01:00.1
may 28 23:04:33 server sudo[8159]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
may 28 23:04:33 server sudo[8159]: pam_unix(sudo:session): session closed for user root
may 28 23:04:41 server sudo[8166]: ubuntu : TTY=pts/1 ; PWD=/home/ubuntu ; USER=root ; COMMAND=/usr/bin/journalctl -e
may 28 23:04:41 server sudo[8166]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
may 28 23:05:11 server sudo[8166]: pam_unix(sudo:session): session closed for user root
may 28 23:05:11 server systemd[1276]: gnome-terminal-server.service: Consumed 4.738s CPU time.
may 28 23:05:11 server gnome-shell[1942]: JS ERROR: TypeError: this.actor is null
_syncEnabled@resource:///org/gnome/shell/ui/windowManager.js:138:25
onStopped@resource:///org/gnome/shell/ui/windowManager.js:150:35
_makeEaseCallback/<@resource:///org/gnome/shell/ui/environment.js:151:22
_easeActorProperty/<@resource:///org/gnome/shell/ui/environment.js:317:60
_destroyWindowDone@resource:///org/gnome/shell/ui/windowManager.js:1596:21
onStopped@resource:///org/gnome/shell/ui/windowManager.js:1564:39
_makeEaseCallback/<@resource:///org/gnome/shell/ui/environment.js:151:22
_easeActor/<@resource:///org/gnome/shell/ui/environment.js:240:64
may 28 23:05:12 server systemd[1276]: Started Application launched by gnome-shell.
may 28 23:05:12 server dbus-daemon[1480]: apparmor=“DENIED” operation=“dbus_signal” bus=“session” path=”/com/canonical/unity/launcherentry/TelegramDesktop" interface="c>
may 28 23:05:12 server dbus-daemon[1480]: [session uid=1000 pid=1480] Activating via systemd: service name=‘org.gnome.Terminal’ unit=‘gnome-terminal-server.service’ requ>
may 28 23:05:12 server systemd[1276]: Starting GNOME Terminal Server…
may 28 23:05:12 server dbus-daemon[1480]: [session uid=1000 pid=1480] Successfully activated service ‘org.gnome.Terminal’
may 28 23:05:12 server systemd[1276]: Started GNOME Terminal Server.
may 28 23:05:12 server systemd[1276]: Started VTE child process 8229 launched by gnome-terminal-server process 8195.
may 28 23:05:14 server gnome-shell[1942]: Can’t update stage views actor [:0x56cdf12a42f0] is on because it needs an allocation.
may 28 23:05:14 server gnome-shell[1942]: Can’t update stage views actor [:0x56cdf2c9eb20] is on because it needs an allocation.
may 28 23:05:14 server gnome-shell[1942]: Can’t update stage views actor [:0x56cdf44e34c0] is on because it needs an allocation.
may 28 23:05:17 server sudo[8240]: ubuntu : TTY=pts/0 ; PWD=/home/ubuntu ; USER=root ; COMMAND=/usr/bin/journalctl -e
may 28 23:05:17 server sudo[8240]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)