2021-09-09

Fixing broken sound without restarting chrom{e,ium}

Yesterday I went to the office to meet most of the members of my team who had joined over the last year. In addition to drinking barista made coffees rather than mine, this means disconnecting my laptop from my monitor and, as it sometimes does, causing my machine to lose sound.

Of course I noticed only this morning when joining a meeting and with no time to lose. Sources all looked good etc but no sound in or out and no amount of switching/reconnecting cables/... helped. 

Usual fix (restart pulseaudio using pulseaudio -k) restored it for the system but then chrome didn't see any input or output device anymore. What I usually do in that case is to restart chrome, however this takes about 5 minutes due to the large number of windows and tabs I have open.

Today I decided to instead investigate more and found that there is a separate process called "Utility: Audio Service" in the UI (Shift+Esc) that you can kill and it fixes the sound by correctly reconnecting to pulseaudio! If you prefer to kill it from the terminal, you want the process with "--utility-sub-type=audio.mojom.AudioService" in the command line.