Oh! I fixed it. Turned out that the mute button on my keyboard was doing a lot more than just muting the Master channel. It was also muting the Headphone and Speaker channel. Strangely, if I hit the mute keyboard while alsamixer was open, it didn't show this, but if I muted and then opened up alsamixer, I saw that the other channels were muted.
In addition, when I turn the volume down all the way using my keyboard's volume control, it only affects the Master channel, except when the volume turns to 0%, the PCM channel's volume goes to 0%, so in order to turn the volume back up, that needs to be dealt with as well.
If anyone is interested, here is my "don't let the user mute or turn down the volume!" script:
Code:
#!/bin/bash
# takes a volume level from 0 to 100, inclusive, as command line argument
# every second, this program unmutes various channels and sets the Master volume to that volume, ensuring that the user hasn't turned the sound off or down
while true; do
amixer set Master $*% unmute > /dev/null # $* gets volume from command line arg
amixer set Headphone unmute > /dev/null
amixer set Speaker unmute > /dev/null
amixer set PCM 100% unmute > /dev/null
sleep 1
done
Marking this thread as solved. Thanks Ubuntu Forums, you're great to bounce ideas off of!
Bookmarks