HTC Desire on Android 2.1, same issue with the sound here.
When in call, switching to speaker/earpiece and playing with the volume sometimes (randomly) changes the overall ringer volume.
If you change to headset it'll sometime lower the overall phone volume so that any following sounds are very low (even when the application isn't launched anymore)...
Tried rebooting the device but it didn't help, the only fix was to relaunch the application and play with the speaker/earpiece button when in call.
One strange thing is that when the phone starts it keeps on speaker when dialing but changes to earpiece afterwards as soon as the call is answered...
Honestly, there's something fishy with the sound management in the software, it seems not to integrate with the general ringer volume but to change the in-call volume while affecting the ringer volume at the same time.
Maybe changing the volume key binding in order to set the ringer volume when not in call and the in-call volume when in call would help ?