well I had Ubuntu 14,04 before then I upgraded to Ubuntu 16.04. Before I faced no sound issues but after fresh installation I can't hear any sound not even during logging in. It works fine in Windows though, I have tried the steps in the following link but no avail.
https://help.ubuntu.com/community/SoundTroubleshootingProcedure
https://askubuntu.com/questions/802016/sound-is-not-working-in-ubuntu-16-04
And also whenever I open Ubuntu I get this error: mesg: ttyname failed Inappropriate ioctl for device
I'm using a HP Notebook. I have also tried installing Pulseaudio again. Whenever I give pulseaudio command in terminal it just opens up an empty dialog box and nothing beyond that. I have checked for this issue too but no avail. Thank you for your help in advance.
[UPDATE] I tried out the commands here and everything worked but when I restarted again the issue was there.
https://ubuntuforums.org/showthread.php?t=776739&highlight=pulse+connection+refused