There are two bugs affecting my computer that prevent audio from playing:
- If I boot my Ubuntu laptop with headphones plugged in, no audio will play while the headphones are plugged in.
- Firefox 58 and 59 will not play audio unless another program produced a sound before Firefox was started.
I finally found a combination of hacks that resolves these issues, though this is clearly only for the kind of sociopath that continues to use Linux under such conditions.
sudo apt install mpg123
Download this 50 ms inaudible mp3 I made:
curl https://www.rybarski.com/static/very-quiet-noise.mp3 -o ~/Documents/very-quiet-noise.mp3
Then add this to
# Plays a sound at boot so Firefox 58+ will be able to play audio. mpg123 -q ~/Documents/very-quiet-noise.mp3 # If we booted with headphones plugged in, this will allow audio to work # The strange invocation is required to suppress an error message on boot bash -c 'alsactl restore || true' 2>&1 > /dev/null