I've got a RPi I am using for some retro-gaming with RetroPie and Dosbox installed. If I start X and attempt to run a game through Dosbox, I do not get sound. However, if I first start RetroPie and start a game (e.g. from the NES emulator) I do get sound from the emulator and I can then exit, start X and hear sound from dosbox. Other programs (e.g. Mathematica) also require these steps in order to work and even emulationstation itself does not emit its bells and whistles until I've returned from one of the emulators.
lsmod reports that snd_bcm2835 is installed and making sure that audio is going to the right place with
sudo amixer cset numid=3 2 doesn't change anything. I've exhausted my troubleshooting ideas at this point. Any suggestions?