# HDMI audio on nvidia GT 430 [SOLVED]

## tld

My old TV is dying and I'm in the process of trying to figure out how to get HDMI audio working with my nvidia GT 430. I'm finding surprisingly little on this.

I currently have audio compiled as modules. Here's the pertinent parts my lspci:

```
01:00.0 VGA compatible controller: NVIDIA Corporation GF108 [GeForce GT 430] (rev a1)

01:00.1 Audio device: NVIDIA Corporation GF108 High Definition Audio Controller (rev a1)

```

Here's what I tried so far with SND_HDA_INTEL:

```
 <M> HD Audio PCI

[ ] Build hwdep interface for HD-audio driver  

[ ] Allow dynamic codec reconfiguration

[ ] Support digital beep via input layer  

[ ] Support initialization patch loading for HD-audio

< > Build Realtek HD-audio codec support

< > Build Analog Device HD-audio codec support

< > Build IDT/Sigmatel HD-audio codec support

< > Build VIA HD-audio codec support

<M> Build HDMI/DisplayPort HD-audio codec support

< > Build Cirrus Logic codec support

< > Build Conexant HD-audio codec support

< > Build Creative CA0110-IBG codec support

< > Build Creative CA0132 codec support

< > Build C-Media HD-audio codec support

< > Build Silicon Labs 3054 HD-modem codec support

<M> Enable generic HD-audio codec parser

(0) Default time-out for HD-audio power-save mode
```

I'm a little disheartened as to how little I can find on this. I feel like I'm stabbing in the dark here. It's building several modules. Attempting to do "modprobe snd-hda-intel" fails with these dmesg errors:

```
[ 3994.502635] snd_hda_core: Unknown symbol __regmap_init (err 0)

[ 3994.502651] snd_hda_core: Unknown symbol regmap_read (err 0)

[ 3994.502664] snd_hda_core: Unknown symbol regcache_cache_bypass (err 0)

[ 3994.502670] snd_hda_core: Unknown symbol regmap_exit (err 0)

```

Any assistance or links to anything substantial on this would be appreciated.

EDIT: I should mention that this is an x86 machine running sys-kernel/gentoo-sources-4.4.39, and I'm using just alsa.

Thanks!

TomLast edited by tld on Sat Feb 04, 2017 10:04 pm; edited 1 time in total

----------

## Hu

For that modprobe error, did you build the kernel and modules together from the same configuration or did you build the kernel, then later modify the configuration to specify that the modules be built?  Sometimes, you can build a module after the fact and have it work.  Sometimes, you must run a kernel image built from the same configuration because the module requires features from the core kernel that are built only if the core kernel knows the module will need them.

----------

## tld

I'm sure you're right. I was probably trying to load the module with the old version of the core still loaded.

I see that the Gentoo alsa wiki has some more information on the kernel stuff as well. I'm confused about the codec support options in the kernel. Is that hardware dependent where one of those will be correct for the card? I don't really follow that.

A general question I've never understood is that, way back when I built this, apparently all the sound stuff (at least alsa) had to be built as modules. Is that still the case? Most stuff I see (like the wiki) seems to show that stuff selected as (*) and not (M).

Thanks!

Tom

----------

## NeddySeagoon

tld,

Sound drivers are in two parts  SND_HDA_INTEL exposes this more than others.

The kernel SND_HDA_INTEL option is the driver for the PCI end of the sound card.

In addition to this, you need the codec driver too.  The COder/DECoder is the chip that does the audio processing. 

In alsamixer,

```

┌────────────────────────────── AlsaMixer v1.1.3 ──────────────────────────────┐

│ Card: HDA ATI SB                                     F1:  Help               │

│ Chip: VIA VT1708S
```

The Card: is the PCI end

The Chip:  is the codec.

If you don't know the codec, make them all.

----------

## fhede

Hello tld.

This thread is about nvidia gt 430 and hdmi.

https://forums.gentoo.org/viewtopic-p-7920544-highlight-.html#7920544

----------

## tld

Thanks! However I made a lot of progress since my last post. I enabled all the various codecs as well as the generic one, and after rebooting it appears to have loaded the modules:

```
lsmod

Module                  Size  Used by

nvidia_modeset        719610  3

snd_hda_codec_generic    36999  1

snd_hda_codec_hdmi     28251  3

nvidia               8998711  58 nvidia_modeset

snd_hda_intel          14190  0

snd_hda_codec          53072  3 snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel

snd_hda_core           21972  4 snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel

snd_intel8x0           20557  0

snd_ac97_codec         77520  1 snd_intel8x0

ac97_bus                1198  1 snd_ac97_codec

snd_pcm                54788  6 snd_ac97_codec,snd_intel8x0,snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_core

snd_timer              13096  1 snd_pcm

snd                    35296  8 snd_ac97_codec,snd_intel8x0,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel

nvidia_drm               872  0

```

...and alsa appears to know about it:

```
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

```

So it's looking good. I haven't test is as yet. I haven't even bought an HDMI TV as yet and can only test this by borrowing the Asus monitor I'm using on this machine  :Wink: .

Thanks for replies!

Tom

----------

## tld

 *NeddySeagoon wrote:*   

> 
> 
> The Card: is the PCI end
> 
> The Chip:  is the codec.
> ...

 

Thanks Neddy!...I didn't notice you're reply before. While I haven't tested anything yet, if I try "alsamixer -c 1", the playback section comes up and I see this:

```
Card: HDA NVidia

Chip: Nvidia GPU 14 HDMI/DP

View: F3:[Playback] F4: Capture  F5: All

Item: S/PDIF [Off]
```

That has four sliders for S/PDIF, S/PDIF 1, S/PDIF 2, and S/PDIF 3...which are currently all off. Does that look like what I would expect to see for this? All the references to S/PDIF threw me a bit. Also, does that "Chip" above simply indicate that it's using the HDMI codec (snd_hda_codec_hdmi)?

Thanks!

Tom

----------

## tld

Can someone please clear me up as to what alsamixer wants for it's "-D" option, as it relates to the output of "aplay -l" or "aplay -L"? I've read countless things and I can't get that to work...driving me nuts.

Tom

----------

## NeddySeagoon

tld,

I'm surprised you have sliders. SPDI/F (Sony, Phillips Digital Interface)' also know as IEC is the digital sound interface.

It can be optical or wired.  It just happens to be over the HDMI cable in your case. 

Volume controls (sliders) in the digital domain is hard/expensive.  You usually only get Mute switches which must be off. (Not set to M)

```
alsamixer -c 1
```

is telling.  -c 0 is your default sound card.  To send sound to card 1, you have two choices.

Swap card 1 and card 0 at startup.  How you do that depends on if you are using a loadable module or built in sound driver.

Tell your app to send sounds to hw:1,x where x is the subdevice.

Test with aplay.  Use the test files in /usr/share/sounds/alsa/  You will teed to give it the card/device option.

----------

## tld

 *NeddySeagoon wrote:*   

> tld,
> 
> I'm surprised you have sliders. SPDI/F (Sony, Phillips Digital Interface)' also know as IEC is the digital sound interface.
> 
> It can be optical or wired.  It just happens to be over the HDMI cable in your case.

 I take it back...you're totally correct. Those are in fact just mutes. I thought I was seeing sliders all the way down.

 *Quote:*   

> Test with aplay.  Use the test files in /usr/share/sounds/alsa/  You will teed to give it the card/device option.

 I'll give that a try when I get to actually testing this.

As mentioned above though, I'm totally confused as to that -D option. Everything I try in alsamixer (even for my working card 0) just gives "Invalid CTL" errors. Everything I see has <name>:n,n formats and for the life of me I can't figure out, among other things, what that name portion is.

Thanks!

Tom

----------

## NeddySeagoon

tld,

I read the man page on the alsamixer -D option.  It didn't help.

I can't get alsamixer -D to do anything useful.

----------

## tld

 *NeddySeagoon wrote:*   

> tld,
> 
> I read the man page on the alsamixer -D option.  It didn't help.
> 
> I can't get alsamixer -D to do anything useful.

 Glad it's not just me. Everything I read tells me that "hw,0,0" would be the default device and even that fails with a fully functional card...really screwy. I'm assuming that I can test with aplay using "-c 1" for that card? Thanks!

Tom

----------

## NeddySeagoon

tld,

I used -D hw:1.  Maybe -c1 works too?

----------

## tld

 *NeddySeagoon wrote:*   

> I used -D hw:1.  Maybe -c1 works too?

 Ahh!! Yes, using "alsamixer -D hw,1" works for me as well. I have no idea why literally everything Ive read says to use <cardno>,<deviceno> such as 1,3 etc. Thanks!

----------

## tld

Wow...I am at my wits end with aplay here. As it turns out, the -c option of aplay is the number of channels and NOT the card number. I have the HDMI connected to an Asus VH238 with built in speakers that, as far as I can tell, should support the HDMI audio.

I can use either of these (the latter for my current default built in audio:

```
alsamixer -D hw:1

alsamixer -D hw:0
```

However aplay does NOT work with that even on a known working card:

```
aplay -D hw: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

aplay -D hw:1 /usr/share/sounds/alsa/Noise.wav 

aplay: main:722: audio open error: No such file or directory

```

Note the difference in errors. Just to REALLY confuse things, it appears that aplay and speaker-test want -D to be in a form (for example in my case) such as hdmi:NVidia. For example:

```
speaker-test -t wav -c 2 -D default:ICH6

speaker-test 1.0.29
```

This works on the existing card. However this, while it doesn't generate an error, gets no sound either:

```
speaker-test -t wav -c 2 -D hdmi:NVidia

speaker-test 1.0.29

```

Here's what I get with aplay doing that:

```
aplay -D default:ICH6 /usr/share/sounds/alsa/Noise.wav 

Playing WAVE '/usr/share/sounds/alsa/Noise.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

```

That works on the old card. However this gets that channel count error:

```
aplay -D hdmi:NVidia /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

```

I don't think I could possibly be more confused. Any help would be appreciated.

Tom

----------

## tld

I just noticed this in dmesg...not sure what this means:

```
IRQ timing workaround is activated for card #1. Suggest a bigger bdl_pos_adj.

```

Here's my my existing /etc/conf.d/alsa.conf. The settings in there have been that way since I installed ages ago. The only change I've made in this testing is to change options snd cards_limit=2 which was set to 1, but that didn't help:

```
# Alsa kernel modules' configuration file.

# ALSA portion

alias char-major-116 snd

# OSS/Free portion

alias char-major-14 soundcore

##

## IMPORTANT:

## You need to customise this section for your specific sound card(s)

## and then run `update-modules' command.

## Read alsa-driver's INSTALL file in /usr/share/doc for more info.

##

##  ALSA portion

## alias snd-card-0 snd-interwave

## alias snd-card-1 snd-ens1371

##  OSS/Free portion

## alias sound-slot-0 snd-card-0

## alias sound-slot-1 snd-card-1

##

# OSS/Free portion - card #1

alias sound-service-0-0 snd-mixer-oss

alias sound-service-0-1 snd-seq-oss

alias sound-service-0-3 snd-pcm-oss

alias sound-service-0-8 snd-seq-oss

alias sound-service-0-12 snd-pcm-oss

##  OSS/Free portion - card #2

## alias sound-service-1-0 snd-mixer-oss

## alias sound-service-1-3 snd-pcm-oss

## alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss

alias /dev/dsp snd-pcm-oss

alias /dev/midi snd-seq-oss

# Set this to the correct number of cards.

options snd cards_limit=2

```

Do I need to be adding to that and doing the update-modules referenced there? This is just painful.

Tom

----------

## tld

FFS...is alsa as horrific as it seems??

I just had a heart attack when MythTV complained that my ALSA device wasn't valid. I finally figured out that something caused the devices to get renamed, and the ALSA:default was no longer valid. Selecting the new name fixed it but FFS anyway.

Tom

----------

## NeddySeagoon

tld,

That alsa.conf has a very important comment at the top.

```
# Alsa kernel modules' configuration file. 
```

It only applies if your sound card drivers are built as modules.  

Also 

```
##  ALSA portion

## alias snd-card-0 snd-interwave

## alias snd-card-1 snd-ens1371
```

so it doesn't do anything for alsa as the alsa bit is commented out.

Its unlikely you still use OSS, which is what the rest of the file sets up.

----------

## tld

Actually all my alsa stuff is in fact compiled as modules. Way back when I set that machine up that was, for whatever reason, the only way I could get things working. Does that mean I should be adding something in there for card 1? I have no idea what that would be if I did.

Actually I just noticed this in dmesg:

```
dmesg | grep hda

[    8.827425] snd_hda_intel 0000:01:00.1: Disabling MSI

[    9.169442] snd_hda_intel 0000:01:00.1: Too many HDMI devices

[    9.169447] snd_hda_intel 0000:01:00.1: Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y

[    9.199435] snd_hda_intel 0000:01:00.1: Too many HDMI devices

[    9.199440] snd_hda_intel 0000:01:00.1: Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y

[    9.205428] snd_hda_intel 0000:01:00.1: control 3:0:0:ELD:0 is already present

[    9.205450] snd_hda_codec_hdmi: probe of hdaudioC0D3 failed with error -16

[    9.230424] snd_hda_intel 0000:01:00.1: Too many HDMI devices

[    9.230429] snd_hda_intel 0000:01:00.1: Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y

[    9.236417] snd_hda_intel 0000:01:00.1: control 3:0:0:ELD:0 is already present

[    9.236435] snd_hda_codec_hdmi: probe of hdaudioC0D3 failed with error -16

[    9.264418] snd_hda_intel 0000:01:00.1: Too many HDMI devices

[    9.264423] snd_hda_intel 0000:01:00.1: Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y

[    9.270412] snd_hda_intel 0000:01:00.1: control 3:0:0:ELD:0 is already present

[    9.270433] snd_hda_codec_hdmi: probe of hdaudioC0D3 failed with error -16

[    9.468596] snd_hda_codec_generic hdaudioC0D3: autoconfig for Generic: line_outs=0 (0x0/0x0/0x0/0x0/0x0) type:line

[    9.468602] snd_hda_codec_generic hdaudioC0D3:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)

[    9.468605] snd_hda_codec_generic hdaudioC0D3:    hp_outs=0 (0x0/0x0/0x0/0x0/0x0)

[    9.468608] snd_hda_codec_generic hdaudioC0D3:    mono: mono_out=0x0

[    9.468611] snd_hda_codec_generic hdaudioC0D3:    dig-out=0x5/0x0

[    9.468613] snd_hda_codec_generic hdaudioC0D3:    inputs:

[    9.486571] snd_hda_intel 0000:01:00.1: Too many HDMI devices

[    9.486576] snd_hda_intel 0000:01:00.1: Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y

[    9.496198] Modules linked in: snd_hda_codec_generic nvidia(PO+) snd_hda_codec_hdmi snd_intel8x0(+) snd_ac97_codec ac97_bus snd_hda_intel snd_hda_codec snd_hda_core snd_pcm snd_timer snd nvidia_drm(PO)

[    9.496229] Workqueue: events azx_probe_work [snd_hda_intel]

[    9.496308]  [<f8b046f1>] ? azx_probe_work+0x4f3/0x593 [snd_hda_intel]

```

Note that "Too many HDMI devices". The only things I can find around that would be missing codecs possibly, but I thought I enabled everything:

```
grep SND_HDA .config

CONFIG_SND_HDA=m

CONFIG_SND_HDA_INTEL=m

# CONFIG_SND_HDA_HWDEP is not set

# CONFIG_SND_HDA_RECONFIG is not set

# CONFIG_SND_HDA_INPUT_BEEP is not set

# CONFIG_SND_HDA_PATCH_LOADER is not set

CONFIG_SND_HDA_CODEC_REALTEK=m

CONFIG_SND_HDA_CODEC_ANALOG=m

CONFIG_SND_HDA_CODEC_SIGMATEL=m

CONFIG_SND_HDA_CODEC_VIA=m

CONFIG_SND_HDA_CODEC_HDMI=m

CONFIG_SND_HDA_CODEC_CIRRUS=m

CONFIG_SND_HDA_CODEC_CONEXANT=m

CONFIG_SND_HDA_CODEC_CA0110=m

CONFIG_SND_HDA_CODEC_CA0132=m

# CONFIG_SND_HDA_CODEC_CA0132_DSP is not set

CONFIG_SND_HDA_CODEC_CMEDIA=m

CONFIG_SND_HDA_CODEC_SI3054=m

CONFIG_SND_HDA_GENERIC=m

CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0

CONFIG_SND_HDA_CORE=m

CONFIG_SND_HDA_PREALLOC_SIZE=64

```

Is there anything missing there I might need?

Also, do I need to run update-modules with the change in /etc/modprobe.d/alsa.conf from "options snd cards_limit=1" to "options snd cards_limit=2"?

----------

## tld

Wow...I just looked at dmesg more closely. This is what I get after that  Too many HDMI devices message:

```
[    9.486571] snd_hda_intel 0000:01:00.1: Too many HDMI devices

[    9.486576] snd_hda_intel 0000:01:00.1: Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y

[    9.493874] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card0/input4

[    9.494216] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card0/input5

[    9.495962] input: HDA NVidia HDMI/DP as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card0/input6

[    9.496108] input: HDA NVidia HDMI as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card0/input10

[    9.496185] ------------[ cut here ]------------

[    9.496195] WARNING: CPU: 0 PID: 65 at fs/proc/generic.c:345 proc_register+0xa7/0xc6()

[    9.496197] proc_dir_entry 'card0/eld#3.0' already registered

[    9.496198] Modules linked in: snd_hda_codec_generic nvidia(PO+) snd_hda_codec_hdmi snd_intel8x0(+) snd_ac97_codec ac97_bus snd_hda_intel snd_hda_codec snd_hda_core snd_pcm snd_timer snd nvidia_drm(PO)

[    9.496220] CPU: 0 PID: 65 Comm: kworker/0:2 Tainted: P           O    4.4.39-gentoo #6

[    9.496222] Hardware name: Dell Inc.                 Dimension 4700c              /0R7935, BIOS A07 10/05/2005

[    9.496229] Workqueue: events azx_probe_work [snd_hda_intel]

[    9.496233]  c1576098 c119e47a f6121e58 00000009 c103055a c10ef434 00000159 f4590900

[    9.496240]  f45909ac f626d4d5 f4590955 c1030595 00000009 f6121e58 c1441ff4 f6121e70

[    9.496247]  c10ef434 c1441f8c 00000159 c1441ff4 f626d4d5 f4590955 f626d4a8 f804c780

[    9.496254] Call Trace:

[    9.496260]  [<c119e47a>] ? dump_stack+0x44/0x57

[    9.496265]  [<c103055a>] ? warn_slowpath_common+0x85/0x9a

[    9.496268]  [<c10ef434>] ? proc_register+0xa7/0xc6

[    9.496271]  [<c1030595>] ? warn_slowpath_fmt+0x26/0x2a

[    9.496274]  [<c10ef434>] ? proc_register+0xa7/0xc6

[    9.496277]  [<c10ef5c8>] ? proc_create_data+0x81/0x94

[    9.496284]  [<f804a8fa>] ? snd_info_register+0x76/0xa8 [snd]

[    9.496289]  [<f804a970>] ? snd_info_register_recursive+0x1a/0x45 [snd]

[    9.496294]  [<f804a97f>] ? snd_info_register_recursive+0x29/0x45 [snd]

[    9.496299]  [<f804ae9f>] ? snd_info_card_register+0x19/0x71 [snd]

[    9.496304]  [<f8048184>] ? snd_card_register+0x105/0x12a [snd]

[    9.496308]  [<f8b046f1>] ? azx_probe_work+0x4f3/0x593 [snd_hda_intel]

[    9.496312]  [<c103e248>] ? process_one_work+0x147/0x235

[    9.496315]  [<c103e79f>] ? worker_thread+0x219/0x2e5

[    9.496318]  [<c103e586>] ? rescuer_thread+0x233/0x233

[    9.496321]  [<c104171c>] ? kthread+0xa1/0xa6

[    9.496326]  [<c137c3c9>] ? ret_from_kernel_thread+0x21/0x38

[    9.496328]  [<c104167b>] ? kthread_create_on_node+0xfb/0xfb

[    9.496332] ---[ end trace bf64497281010915 ]---

[    9.734257] vgaarb: device changed decodes: PCI:0000:01:00.0,olddecodes=io+mem,decodes=none:owns=io+mem

[    9.735103] nvidia-nvlink: Nvlink Core is being initialized, major device number 250

[    9.735552] NVRM: loading NVIDIA UNIX x86 Kernel Module  361.28  Wed Feb  3 14:47:59 PST 2016

[    9.804498] snd_intel8x0 0000:00:1e.2: intel8x0_measure_ac97_clock: measured 50578 usecs (2438 samples)

[    9.804504] snd_intel8x0 0000:00:1e.2: clocking to 48000

```

That trace sure doesn't look good. I also just discovered that there actually is no update-modules command. I'm not even clear what /etc/modprobe.d/alsa.conf file is for (note that I mistakenly referred to that above as /etc/conf.d/alsa.conf).

I'm actually rebuilding the kernel with that CONFIG_SND_DYNAMIC_MINORS as suggested in that error.

Thanks again.

Tom

----------

## tld

OMG!! I actually got it to work, no thanks to the useless aplay and speaker-test programs though.

After rebuilding the kernel with that CONFIG_SND_DYNAMIC_MINORS option, the "Too many HDMI devices" and the other errors went away. Even after that however I could NOT get it to work with aplay or speaker-test. However I WAS able to get it working in MythTV.

After restarting with the HDMI connected, the devices where reordered, and I had this:

```
aplay -l

**** List of PLAYBACK Hardware Devices ****

card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]

  Subdevices: 1/1

  Subdevice #0: subdevice #0

card 0: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]

  Subdevices: 1/1

  Subdevice #0: subdevice #0

card 0: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]

  Subdevices: 1/1

  Subdevice #0: subdevice #0

card 0: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]

  Subdevices: 1/1

  Subdevice #0: subdevice #0

card 1: ICH6 [Intel ICH6], device 0: Intel ICH [Intel ICH6]

  Subdevices: 1/1

  Subdevice #0: subdevice #0

card 1: ICH6 [Intel ICH6], device 4: Intel ICH - IEC958 [Intel ICH6 - IEC958]

  Subdevices: 1/1

  Subdevice #0: subdevice #0

```

```
aplay -L

null

    Discard all samples (playback) or generate zero samples (capture)

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

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

```

For the life of me, I can't figure out exactly how those relate to each other...confusing as hell. In the MythTV sound configuration I had choices that appeared to correspond to the hdmi:CARD=NVidia,DEV=0 through hdmi:CARD=NVidia,DEV=3 in the "aplay -L" output. The only one that worked was hdmi:CARD=NVidia,DEV=3, because that was set to stereo and not 5.1 surround, so apparently it was the only one compatible with the built in speakers on that monitor. However I simply CANNOT figure out any form of that Godless -D option in either aplay or speaker-test that actually uses that device on that card. I mean WTF? If I kept depending on those programs I'd have never figured it out.

I'm assuming that when I get my TV I'll be able to use one of the 5.1 devs. At that point I'll want to change the default...reading up on that and it's abut as confusing as everything else.

I'm about worn out.

Thanks for the help!

Tom

----------

## tld

I've marked this as solved, but I'm going to add some more things I've discovered here to hopefully help others later on. I ended up significantly cleaning up my alsa configuration as well removing unnecessary stuff from the kernel, and recompiling the kernel with all the sound stuff compiled in rather than as modules.

This post will cover that. I'll make a second post regarding the pure insanity that I've run into with the -D option of aplay and speaker-test.

As mentioned above, I recompiled my kernel with everything built in and not in modules. As a result, the /etc/modprobe.d/alsa.conf didn't apply, but I commented it out just to avoid confusion. One affect this had is that the system always boots with the built in sound card as card 0 and the HDMI as card 1. When using modules this would vary where the HDMI became card 0 if the HDMI cable was actually connected at boot time. This is something that you can apparently address in /etc/modprobe.d/alsa.conf, but again, is a non-issue with built in support.

Since it was clear that my HDMI card was using the snd_hda_codec_hdmi codec, I disabled all other codecs including the generic codec (which as I understand is designed to pick the right codec). My resulting SND_HDA config now is as follows:

```
grep SND_HDA .config

CONFIG_SND_HDA=y

CONFIG_SND_HDA_INTEL=y

CONFIG_SND_HDA_HWDEP=y

# CONFIG_SND_HDA_RECONFIG is not set

# CONFIG_SND_HDA_INPUT_BEEP is not set

# CONFIG_SND_HDA_PATCH_LOADER is not set

# CONFIG_SND_HDA_CODEC_REALTEK is not set

# CONFIG_SND_HDA_CODEC_ANALOG is not set

# CONFIG_SND_HDA_CODEC_SIGMATEL is not set

# CONFIG_SND_HDA_CODEC_VIA is not set

CONFIG_SND_HDA_CODEC_HDMI=y

# CONFIG_SND_HDA_CODEC_CIRRUS is not set

# CONFIG_SND_HDA_CODEC_CONEXANT is not set

# CONFIG_SND_HDA_CODEC_CA0110 is not set

# CONFIG_SND_HDA_CODEC_CA0132 is not set

# CONFIG_SND_HDA_CODEC_CMEDIA is not set

# CONFIG_SND_HDA_CODEC_SI3054 is not set

# CONFIG_SND_HDA_GENERIC is not set

CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0

CONFIG_SND_HDA_CORE=y

CONFIG_SND_HDA_PREALLOC_SIZE=64

```

Also note (as mentioned previously) that I needed to enable CONFIG_SND_DYNAMIC_MINORS to prevent those "Too many HDMI devices"  errors. Also note that the CONFIG_SND_HDA_HWDEP above wasn't required either. I was just trying that to see if it affected the aplay and speaker-test stuff discussed below.

Also note that I disabled the various OSS and sequencer crap in the kernel as I never use them.

----------

## tld

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:

```
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:

```
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:

```
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:

```
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:

```
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

----------

