I have a dual boot machine with ubuntu 17.10 and the audio works flawlessly on Windows, while on Ubuntu it has these problems: The volume control slide has no effect, either from the GUI in the top-right corner or from alsamixer invoked in a shell. The volume is either off, or at maximum whenever the alsamixer setting is between 1 and 100. This happens only with the speakers and not if headphones are plugged in.
More annoyingly the audio does not work altogether sometimes after boot. It seems random, on some boot it works, on other it does not. Fun fact is that if I plug headphoes and then remove them, I can hear sound for a fraction of second, then it quickly distorts and dies.
I tried reinstalling pulseaudio and pavucontrol several times, to no avail. I attach the output of aplay -l. Does anyone have any idea what is happening? Would an upgrade to 18.10 help even if I I would rather avoid it?
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC295 Analog [ALC295 Analog]
Subdevices: 0/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
EDIT: The output device shown from setting-> sound seems to be the correct one (either internal speakers or headphones). I had tampered only with the graphich drivers, to install the cudatoolkit 9.1 on a non supported OS, and blacklist nouveau. Then I reinstalled and restarted pulseaudio with the package manager. I can not be positive, as it was the first thing that I have done, but the problem might have started after installing the graphic drivers. The issue happens randomly independently of the devices plugged in, even with no device. Let's say 33-50% of the times the audio works with fixed volume, the rest it does not work.