I've been running into this problem over and over again and found
several different solutions. However, some of them also stopped working
after installing updates. There is this solution that I found when using
the NVIDIA proprietary drivers: http://askubuntu.com/a/511907/73753.
Which involves suspending your laptop, to trick it into powering on the
audio chip on your nvidia gpu.

However, I seriously recommend using the nouveau driver nowadays. As it
supports the nvidia optimus technology, whereas the proprietary driver
does not. Though, the drawback is that the nouveau driver only supports
opengl 3.3. See http://nouveau.freedesktop.org/wiki/Optimus/. The
difference is that you use `DRI_PRIME=1` instead of `optirun`. And that
you use `echo DDIS > /sys/kernel/debug/vgaswitcheroo/switch` instead of
`prime-select nvidia` before restarting X11 when you want to use the
hdmi output.

With nouveau, my hdmi audio still does not work out of the box. Though, the 
audio device is listed in lspci -H1 when booted, which saves us half the 
trouble we had with the NVIDIA driver. The steps I use to get the driver loaded 
for the audio device are (warning, this might hang your pc, also, if your pc 
fails to (re)boot, perform a hard-reset by removing the power & battery and 
waiting 3 or more minutes (1 minute is not sufficient)):
- press ctrl+alt+f1
- login and run `sudo su`
- shut down x11 and the loginscreen, such that the gpu is no longer in use. I 
could do that by running `runlevel` followed by `init 3`
- 'remove' the gpu: `echo 1 > /sys/bus/pci/devices/0000\:01\:00.0/remove`
- redetect the gpu: `echo 1 > /sys/bus/pci/rescan`
- If everything went right, the driver for the hdmi audio chip should be 
loaded. Verify this by running `lscpi` and checking if there is a line like 
"01:00.1 Audio device: NVIDIA Corporation GF116 High Definition Audio 
Controller (rev a1)".
- switch to the hdmi output: `echo DDIS > 
/sys/kernel/debug/vgaswitcheroo/switch`
- start the login manager and x11 again: in my case I needed to run `init 5` 
where 5 was the number reported by `runlevel`.

I obtained the remove & rescan pci trick from
https://devtalk.nvidia.com/default/topic/609790/linux/no-hdmi-sound-w
-optimus-in-linux/.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1377653

Title:
  HDMI sound output not detected / NVIDIA optimus laptop

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1377653/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to