Ubuntu Desktop. Solving the problem with sound

If you have trouble with sound like this. Sometimes it might disappear or appear by itself. Đ¢hen you can apply bellow recipe.

1. Open conf file:

nano /etc/pulse/daemon.conf

2. Find option realtime-scheduling, change option value from yes to no
and uncomment it:

..
; high-priority = yes
; nice-level = -11

realtime-scheduling = no
; realtime-priority = 5

; exit-idle-time = 20
; scache-idle-time = 20
... 

3. Then restart PulseAudio:

pulseaudio -k