The stuff I've discovered about the use of the -D option in either aplay and speaker-test during this endeavor almost defies description. If anyone is aware of something I might have missed here feel free to post, but this makes me wonder if many users difficulties with alsa in general are mostly due to these tests misbehaving.
With my new kernel config, this is what I always get when listing the alsa devices:
Code: Select all
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ICH6 [Intel ICH6], device 0: Intel ICH [Intel ICH6]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: ICH6 [Intel ICH6], device 4: Intel ICH - IEC958 [Intel ICH6 - IEC958]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=ICH6
Intel ICH6, Intel ICH6
Default Audio Device
sysdefault:CARD=ICH6
Intel ICH6, Intel ICH6
Default Audio Device
front:CARD=ICH6,DEV=0
Intel ICH6, Intel ICH6
Front speakers
surround21:CARD=ICH6,DEV=0
Intel ICH6, Intel ICH6
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=ICH6,DEV=0
Intel ICH6, Intel ICH6
4.0 Surround output to Front and Rear speakers
surround41:CARD=ICH6,DEV=0
Intel ICH6, Intel ICH6
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=ICH6,DEV=0
Intel ICH6, Intel ICH6
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=ICH6,DEV=0
Intel ICH6, Intel ICH6
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
iec958:CARD=ICH6,DEV=0
Intel ICH6, Intel ICH6 - IEC958
IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=NVidia,DEV=0
HDA NVidia, HDMI 0
HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
HDA NVidia, HDMI 0
HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
HDA NVidia, HDMI 0
HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
HDA NVidia, HDMI 0
HDMI Audio Output
First of all, despite the fact that the -D option is supposed to allow a format such as hw:0,0 where the numbers are the card and device, none of those ever work for me...even when the card works perfectly. The best I seem to be able to get is:
Code: Select all
aplay -D hw:0,0 /usr/share/sounds/alsa/Noise.wav
Playing WAVE '/usr/share/sounds/alsa/Noise.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: set_params:1239: Channels count non available
Note that the above is my current working default built in audio card.
I tried every imaginable format I could google. Finally I
thought I'd found a format that worked by using the exact string as it appears in aplay -L such as:
Code: Select all
aplay -D sysdefault:CARD=ICH6 /usr/share/sounds/alsa/Noise.wav
Playing WAVE '/usr/share/sounds/alsa/Noise.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
Note however that, while that worked, specifying the HDMI entry above that actually works in MythTV does not:
Code: Select all
aplay -D hdmi:CARD=NVidia,DEV=3 /usr/share/sounds/alsa/Noise.wav
Playing WAVE '/usr/share/sounds/alsa/Noise.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: set_params:1239: Channels count non available
That's the last entry above in the aplay -L output. As I mention in previous posts, that's apparent the only device on that card that's stereo and not surround and works in MythTV with the build in speakers on the monitor.
What I finally discovered, if you can imagine, is that even that format was only working if that card/dev was set as the
default! That is, if I create either an /etc/asound.conf or ~/.asoundrc containing the following:
Code: Select all
defaults.pcm.card 1
defaults.pcm.device 9
defaults.ctl.card 1
...noting that device 9 is the device from "aplay -l" for that hdmi:CARD=NVidia,DEV=3 device (could this device vs DEV thing be a little more confusing maybe?)...both aplay and speaker-test work with either no -D at all, or with -D hdmi:CARD=NVidia,DEV=3. Also note that regardless of any of that, -D hw:1,9 never works in any case.
So now I know what I'm up to here and know how to set everything up for HDMI when I get my new TV.
I'd actually love to find out that there's something I'm missing here, and that alsa isn't really that screwed, but this was about the most horrific wild goose chase I've ever been sent on.
Hope this helps someone!
EDIT: A few things I've discovered since the above: It appears that speaker-test needs to be told the number of channels using -c for some reason. Also, based on some things I've read, apparently aplay tests fail with alsa's own test wav files fail because it only works with stereo files, and those are all mono...I mean FFS.
Tom