Using 'Music on Console' on Raspbian, with sound over HDMI.
pi@raspberrypi:~ $ sudo apt-get install mocp
Before:
pi@raspberrypi:~ $ mocp
Running the server...
Trying JACK...
Trying ALSA...
Trying OSS...
FATAL_ERROR: No valid sound driver!
FATAL_ERROR: Server exited!
To fix:
cp /usr/share/doc/moc/examples/config.example ~/.moc/config
Then edit the ALSA output settings section:
ALSADevice = default
ALSAMixer1 = HDMI
Should work now!