No audio output devices detected in new computer build with Skylake (Z170) motherboard in 14.04
Solution 1:
Apparently it is a kernel bug popping up from the combination of the Intel Skylake architecture, the 3.19 linux kernel (ubuntu 14.04) and (possibly) the Realtek ALC887 audio chipset (snd-hda-intel linux driver) which screws somehow the alsa drivers up.
The following procedure is listed at https://wiki.ubuntu.com/Audio/UpgradingAlsa/DKMS but it's not up-to-date with ubuntu 14.04 (although it is totally equivalent):
Make sure the dkms package is installed:
sudo apt-get install dkms
Then download and install (e.g. with ubuntu software center) the .deb file from the latest vivid alsa build at https://code.launchpad.net/~ubuntu-audio-dev/+archive/ubuntu/alsa-daily/+packages
When I did it, it was the following build:
oem-audio-hda-daily-lts-vivid-dkms - 0.201509251531~ubuntu14.04.1
where the 2 keywords are 'lts-vivid' and 'ubuntu14.04'. That is what you are looking for.
My system is the following: Asrock MB with b150 chipset (ALC887 sound card) and Intel i5-6500K (Skylake) with 8GB RAM and an NVidia GTX960. I also did not see any audio device, except for the video card hdmi outputs. Very nasty bug, as there is so much confusion around the sound system (alsa and pulseaudio) in ubuntu apparently, so that to find the same bug report is quite difficult.
I know this is exactly what Abe commented last, but I would like to see it as an answer, clearer to see immediately without having to browse through the comments.
Solution 2:
I found the problem. Just install this new driver like that :
sudo apt-add-repository ppa:ubuntu-audio-dev/alsa-daily
sudo apt-get update
sudo apt-get install oem-audio-hda-daily-lts-vivid-dkms
It worked for me with Ubuntu 14.04 with Asus Z170-p (Realtek ALC887)
Solution 3:
works for my gigabyte z170x gaming g1 motherboard as well. i use ubuntu xenial 16.04 but it was pretty much the same command. as for any specific issue, i needed to add this as well:
First, create /etc/modprobe.d/hda-jack-retask.conf containing:
# This file was added by the program 'hda-jack-retask'.
# If you want to revert the changes made by this program, you can simply erase this file and reboot your computer.
options snd-hda-intel patch=hda-jack-retask.fw,hda-jack-retask.fw,hda-jack-retask.fw,hda-jack-retask.fw model=generic
(For those who already have tried playing with hdajackretask the model=generic at the end is required for sound to work)
Second create /lib/firmware/hda-jack-retask.fw containing:
[codec]
0x11020011 0x1458a046 0
[pincfg]
0x0b 0x41014111
0x0c 0x414520f0
0x0d 0x01014010
0x0e 0x41c501f0
0x0f 0x42214010
0x10 0x41214010
0x11 0x41012014
0x12 0x37a790f0
0x13 0x77a701f0
0x18 0x500000f0
This will disable most ports but the port at the right of the optical port will work. I disabled the optical port as well but if you need it you can try to activate it with hdajackretask.
From my experiences, every time you mess with the ports you need to reboot into windows once to set the card the way you want before you can make the sound work on linux again. If you try to make the headphone port work, the other one will stop working and you will need to reboot into windows again. Trust me it is much easier to just buy a 3.5mm Y Splitter. There is more than enough gain on this board anyway.
You also need to edit /etc/pulse/daemon.conf and add these:
default-sample-format = s24le
default-sample-rate = 192000
Since we are talking about fixing issues with Z170X-Gaming G1, i might as well point out how to fix WiFi as well:
copy board-2.bin file from bug https://bugzilla.kernel.org/show_bug.cgi?id=111111 direct link: https://bugzilla.kernel.org/attachment.cgi?id=224831 into /lib/firmware/ath10k/QCA6174/hw3.0/
Then make a link or copy /lib/firmware/ath10k/QCA6174/hw3.0/firmware-4.bin into /lib/firmware/ath10k/QCA6174/hw3.0/firmware-5.bin as well.
That's it, now Sound and WiFi will work, i tested this with 17.04 without issues, i did not have to update alsa. Remember that any rebooting from Linux to Linux will mess up the sound, you need to shutdown every time.