Ubuntu: No Audio Over HDMI on NVIDIA GeForce GTX 1050 Ti



Question:

I am running kernel v4.13.0-36-generic on Ubuntu 17.10 on an HP Omen 15. I have a hybrid NVIDIA Optimus graphics card. I dual-boot Windows 10, which can play audio from the same external monitor over the same HDMI cable I am attempting to use in Ubuntu. I can see video on my external monitor in Ubuntu.

I have tried switching my audio output device in Ubuntu's built-in sound settings GUI and Pulse Audio Volume Control, but in the former no HDMI audio device appears, and in the latter all HDMI devices show up as unplugged.

I have had the most success using the proprietary nvidia-384 driver installed via the Additional Drivers tab of Software & Updates. Using this driver I am able to see video on my external monitor, play audio through my laptop speakers, and boot reliably.

I have tried using nvidia-387 and nvidia-390 from ppa:graphics-drivers/ppa with bumblebee, bumblebee-nvidia, and primus installed, but I can't even boot or see video on my external monitor reliably using these drivers. I observed that /etc/bumblebee/xorg.conf.nouveau and /etc/bumblebee/xorg.conf.nvidia detected my GeForce GTX 1050 Ti as a discrete graphics card, which I believe is incorrect, but am unsure how to override these settings to indicate that my graphics card is a hybrid.

I have blacklisted nouveau, because I am unable to boot reliably with nouveau enabled.

I installed NVIDIA-Linux-x86_64-390.25.run, but after rebooting was stuck in a boot loop, so I ran sudo nvidia-uninstall.

I don't have a lowlatency kernel installed.

I disabled Wayland in case it was causing problems.

I disabled Secure Boot.

I tried using kernel v4.15.4, but only found it even more difficult to boot reliably.

I tried rescanning the PCI bus on the PCI bridge my GPU is connected to. I do not know how to switch from hybrid to dedicated graphics mode as the author of that solution suggests though, so that may be why it didn't work for me.

$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: PCH [HDA Intel PCH], device 0: ALC295 Analog [ALC295 Analog] Subdevices: 1/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 card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4] Subdevices: 1/1 Subdevice #0: subdevice #0

$ lspci 00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 05) 00:01.0 PCI bridge: Intel Corporation Skylake PCIe Controller (x16) (rev 05) 00:02.0 VGA compatible controller: Intel Corporation Device 591b (rev 04) 00:04.0 Signal processing controller: Intel Corporation Skylake Processor Thermal Subsystem (rev 05) 00:14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller (rev 31) 00:14.2 Signal processing controller: Intel Corporation Sunrise Point-H Thermal subsystem (rev 31) 00:16.0 Communication controller: Intel Corporation Sunrise Point-H CSME HECI #1 (rev 31) 00:17.0 SATA controller: Intel Corporation Sunrise Point-H SATA Controller [AHCI mode] (rev 31) 00:1c.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #1 (rev f1) 00:1c.4 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #5 (rev f1) 00:1c.5 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #6 (rev f1) 00:1c.6 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #7 (rev f1) 00:1f.0 ISA bridge: Intel Corporation Sunrise Point-H LPC Controller (rev 31) 00:1f.2 Memory controller: Intel Corporation Sunrise Point-H PMC (rev 31) 00:1f.3 Audio device: Intel Corporation Device a171 (rev 31) 00:1f.4 SMBus: Intel Corporation Sunrise Point-H SMBus (rev 31) 01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile] (rev a1) 03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader (rev 01) 04:00.0 Network controller: Intel Corporation Wireless 7265 (rev 61) 05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)

A big thank you to anyone who made it to this point. Any suggestions would be greatly appreciated.


Solution:1

Many thanks to Rudi Daemen. The audio problem on my GTX 1060 was solved by his solution. You can try his solution:

  1. Create file /etc/systemd/system/fix-hdmi-audio.service

    [Unit]  Description=nVidia HDMI Audio Fixer  Before=systemd-logind.service display-manager.service  After=module-init-tools.service    [Service]  Type=oneshot  ExecStart=/usr/local/bin/fix-hdmi-audio.sh    [Install]  WantedBy=multi-user.target  
  2. Create file /usr/local/bin/fix-hdmi-audio.sh

    #!/bin/sh  setpci -s 01:00.0 0x488.l=0x2000000:0x2000000  rmmod nvidia-uvm nvidia-drm nvidia-modeset nvidia  sh -c 'echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove'  sh -c 'echo 1 > /sys/bus/pci/devices/0000:00:01.0/rescan'  modprobe nvidia nvidia-modeset nvidia-drm nvidia-uvm  

    and set it to runnable: chmod +x /usr/local/bin/fix-hdmi-audio.sh

  3. Enable the service: systemctl enable fix-hdmi-audio.service

  4. Install apt install pavucontrol then start "PulseAudio Volume Control". In "Configuration" tab, you can see only "Internal Audio".

  5. Reboot. Plug HDMI and play some music. Start "PulseAudio Volume Control". In "Configuration" tab, you should see "Internal Audio" and "HDA NVidia".
    In "Playback" tab, there is a button on the right side of your music player. You can choose "Internal Audio" or "HDA NVidia". Choose "HDA NVidia".

Note

After rebooting, you can see

01:00.1 Audio device: NVIDIA Corporation Device 10f1 (rev a1)  

in the outputs of lscpi.


Solution:2

https://github.com/hhfeuer/nvhda#install-using-dkms solved my problem. It leverages the same strategy linked above by both Ping and myself. Most likely setpci -s 01:00.0 0x488.l=0x2000000:0x2000000 didn't work with my hardware setup.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »