{"id":364,"date":"2012-06-25T11:32:57","date_gmt":"2012-06-25T08:32:57","guid":{"rendered":"http:\/\/www.held.org.il\/blog\/?p=364"},"modified":"2012-06-25T16:44:18","modified_gmt":"2012-06-25T13:44:18","slug":"restarting-the-linux-sound-subsystem","status":"publish","type":"post","link":"http:\/\/www.held.org.il\/blog\/2012\/06\/restarting-the-linux-sound-subsystem\/","title":{"rendered":"Restarting the Linux sound subsystem"},"content":{"rendered":"<p>Sometimes my laptop gets to a state in which sound works through the built-in speakers, but not through the headphone jack. Possibly my solution is too brutal, but it works -\u00c2\u00a0 restarting the whole sound subsystem. I guess that it may come handy in other situation: the ability to restart a subsystem instead of rebooting the machine, is always an advantage.<\/p>\n<p>The rationale is simply reloading the kernel module that acts as a driver to our sound hardware. Reloading isn't easy, as:<\/p>\n<ol>\n<li>Kernel modules use this module.<\/li>\n<li>User processes use this module.<\/li>\n<\/ol>\n<p><!--more--><br \/>\nSo the solution is to first kill all processes which use the sound (on a healthy system nowadays it's only pulseaudio), recursively <em><\/em> unload sound driver and the modules that depend on it, then reload the main kernel module. On my system, with Intel sound card, the sound driver's module name is <em>snd_hda_intel<\/em>.<\/p>\n<p>Therefore here is the full, 3-step process:<\/p>\n<p style=\"padding-left: 30px;\">[cc lang=\"bash\"]$ killall pulseaudio; sleep 3; killall -9 pulseaudio[\/cc]<\/p>\n<p style=\"padding-left: 30px;\">Note: you'll need sudo if there are pulseaudio processes running as other users.<\/p>\n<p style=\"padding-left: 30px;\">[cc lang=\"bash\"]$ sudo modprobe -r snd_hda_intel[\/cc]<\/p>\n<p style=\"padding-left: 30px;\">Note: make sure modprobe didn't throw an error. If it did, there's probably still a process using the kernel module. Sometimes that's because a new pulseaudio process got created.<\/p>\n<p style=\"padding-left: 30px;\">[cc lang=\"bash\"]$ sudo modprobe snd_hda_intel[\/cc]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes my laptop gets to a state in which sound works through the built-in speakers, but not through the headphone jack. Possibly my solution is too brutal, but it works -\u00c2\u00a0 restarting the whole sound subsystem. I guess that it may come handy in other situation: the ability to restart a subsystem instead of rebooting [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[191,32,198,203,193,92,192,119],"_links":{"self":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts\/364"}],"collection":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/comments?post=364"}],"version-history":[{"count":0,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts\/364\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/media?parent=364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/categories?post=364"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/tags?post=364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}