Nvidia Optimus HDMI no sound

user825380

I am using a Lenovo Legion Y720 laptop with a discrete GTX 1060 GPU. I can connect to an external monitor but there is no option to chose HDMI as output source for the speakers. Only the internal speakers are listed. I tried with a laptop without a discrete GPU and it worked. As far as I can see bumblebee is a dead project. What is the alternative for Nvidia Optimus now on Ubuntu 18.04? I am using the Nvidia proprietary drivers, version 390, but it has only caused me problems like overheating (90+ celcius), screen tearring and now this HDMI problem.

user825380

I found a solution to this on this thread:

https://devtalk.nvidia.com/default/topic/1024022/linux/gtx-1060-no-audio-over-hdmi-only-hda-intel-detected-azalia/post/5216905/#5216905

Guide:

The first file should be created at /usr/local/bin/ and named fix-hdmi-audio.sh and should contain:

#!/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

The second file should be created at /etc/systemd/system/ and named fix-hdmi-audio.service and should contain:

[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

Now run these two commands in the terminal after copying the above files:

chmod +x /usr/local/bin/fix-hdmi-audio.sh

systemctl enable fix-hdmi-audio.service

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related