First, try running $ pulseaudio --start
,this should enable sound. If not:
Test the current situation with default output.
$ speaker-test
See other available sound outputs.
$ aplay -l
Pick other outputs then try them.
$ speaker-test -D hw:<card id>,<device id>
For example, if the output of aplay contains a line
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
Then the command to try this output will be
$ speaker-test -D hw:1,7
Kill all pulse audio daemons to prevent them from interfering during the troubleshooting.
$ mv ~/.config/pulse ~/.config/pulse_old
# Remove potentially corrupted pulse files
$ sudo killall pulseaudio
Try step 1, 2, and 3 again.
Check dmesg and journalctl to see if any errors regarding the sound are reported.
This link may also be of use: After ubuntu 19.04 update, sound card cannot be detected
speaker-test -D hw:<card id>,<device id>
with multiple options, It didn't work. – Ankit Goswami Sep 07 '22 at 17:45Playback device is hw:0,7 Stream parameters are 48000Hz, S16_LE, 1 channels Using 16 octaves of pink noise Channels count (1) not available for playbacks: Invalid argument Setting of hwparams failed: Invalid argument `
– Ankit Goswami Sep 07 '22 at 17:46