Okay, another weekend and I'm back to trying to resolve this silly problem.
To recap, I'm using Slackware Current/13.0 with a 188.8.131.52 kernel.
Ideally, I want sound through both external speakers (analog device 0:0) and HDMI (device 0:3). Which device is primary is not important. The box should send audio to both devices. I want the external speakers as an available audio device because I'm a long way from configuring this box as a HTPC and testing in my office is more convenient. Yet I need sound through HDMI for when I test configuration changes with my HD TV.
The aplay -l
command does list the HDMI audio device. That seems to be half the battle. However, I cannot consistently get any audio through HDMI when I use Current/13.0. I can get audio with xbmc and sometimes with PCLOS.
First test this weekend in my office with small, cheap, external speakers from a console (no X):
mplayer -ao alsa:device=hw=0.0 soundfile
I hear the wave file from my external speakers. I then tried a slight variation:
mplayer -ao alsa:device=plughw=0.0 soundfile
I again hear the sound file.
I moved the PC from the office to the HD TV. I connected a (3.5 mm) stereo speaker cable from the PC audio out port to the TV computer audio port. The TV audio port is intended for use with the D-Sub/RGB video connector.
I heard the test file from the HD TV speakers with both mplayer commands (using analog device 0:0).
Next test was the HDMI audio device:
mplayer -ao alsa:device=hw=0.3 soundfile
mplayer -ao alsa:device=plughw=0.3 soundfile
Next I added the following changes to /usr/share/alsa/alsa.conf:
I restarted alsa and tried the same mplayer commands.
I had sound from the analog device (0:0) but no sound from the HDMI device (0:3).
I disabled the /etc/asound.conf file and rebooted. Same results.
I restored /usr/share/alsa/alsa.conf.
Some strangeness: when I'm not in X, the mplayer and speaker-test command line tests to the analog device (0:0) are good. That is, I hear audio through the TV speakers but through the analog device (0:0). The same tests to the HDMI audio device (0:3) fail. When I start X there is no audio with the same tests to the analog device 0:0. Yet in X I get audio through the TV speakers through the HDMI audio device (0:3). I toggled to a different console outside X and I can hear audio through 0:0 but not 0:3.
More strangeness: Although I get audio through HDMI with the command line tests in X, I have no audio from any GUI media player (Xine, MPlayer, Dragon Player) with either port. KMix and alsamixer shows no muted ports.
At the moment I sort of have audio through HDMI but everything is hit and miss. I'm not seeing any patterns. Why no audio through the media players?
As a side note, I have been able to get audio through HDMI in xbmc. Yet I noticed in my several previous tests with xbmc that audio and video often are out of sync.