For those who don’t use Linux, or do use Linux but aren’t aware, the audio system found within the OS is horrible. Not in quality, features or performance, but rather in configuration and execution. Since I began using Linux in 1999, and moved to it full-time in 2004, the bulk of my most frustrating troubles have had to do with audio, and a recent problem only solidifies that fact further. This time though, it’s not an audio card at fault, but rather the HDMI audio chip built into NVIDIA’s GeForce graphics cards.
Alright, let me back up for a moment. Linux’s audio system doesn’t suck per se – if it works. Pulseaudio is easy to use but has some obvious limitations, and ALSA can be difficult to configure unless your setup is extremely simple. I don’t mean to discredit any of the hard work that the developers of these projects pour into them; I’ve simply had many bad experiences with both solutions over the years.
A couple of months ago, I moved from an AMD Radeon graphics card to an NVIDIA GeForce, and though the video and 3D worked great, I encountered a problem with my audio. Post-driver install, my browser simply wouldn’t output audio on sites like YouTube, while it worked fine everywhere else. Curious, I loaded up ‘alsamixer’ and saw something like this:
When alsamixer is launched, the default audio card is displayed, which in this case is ‘HDA NVidia’, or to be more specific, ‘Nvidia GPU 18 HDMI/DP’. When a card is made default by your Linux OS and you don’t want it to be, it can be difficult to remedy the problem. In some cases, you can simply load up the sound preferences in your distro of choice and configure things there, but not all distros have such a benefit, and in some cases where they do, the problem may still not be fixed after you alter things to your liking (I experienced this months ago with KDE 4.x).
If you’ve stumbled on this post, chances are good that you simply don’t want the HDMI audio on the graphics card or aren’t running something like an HTPC. In my experience, the only easy way to fix this problem is to completely remove the kernel module (driver) that’s guilty of shooting up your ride. Which one could that be? HDA Intel. That’s right, an Intel audio driver that impacts NVIDIA’s HDMI.
You can verify this by opening up a terminal and entering superuser mode (su or sudo -s) and typing in ‘lspci -vv’, then scanning for the NVIDIA audio device. The key thing to look for in this blob of text is ‘Kernel driver in use’, which in this case is in fact HDA Intel.
Note! If the HDA Intel kernel module is removed, no audio cards that rely on it will function. Many on-motherboard solutions do use HDA Intel, so please run ‘lspci -vv’ as a superuser to scan for all audio devices to make sure that’s not the case. It can be assumed that if you do have an on-board HDA Intel chipset, the driver wouldn’t have defaulted to the NVIDIA card in the first place.
There are two main solutions I’ve found for accomplishing the goal of disabling/removing the NVIDIA HDMI driver, with the first one being the easiest. It’s also the one that didn’t work for me in my distro of choice (Gentoo), but I’m confident it will work for most – especially Debian users.
Method #1 – Blacklisting
As is all-too-common in the Linux realm, no two distros like to do certain things the same way, and where blacklisting modules is concerned, that’s especially the case. What I recommend is heading to Google and typing in ‘blacklisting modules (your distro here)’ to find out the proper process, as you could risk doing more harm than good if done incorrectly.
On Debian OSes (or Ubuntu, Pinguy OS, Elementary, etc), the file you’ll be wanting to edit is ‘/etc/modprobe.d/blacklist.conf’. You will need to enter superuser mode to edit this via ‘vi’ or ‘nano’. I prefer nano since it’s simpler. Your terminal command should look like this:
techgage rwilliams # nano -w /etc/modprobe.d/blacklist.conf
Inside this file, you will see a large collection of examples and modules already being blacklisted. In vi, you can hit ‘i’ to edit and then go to the last line in the file, while in nano you can simply scroll to the bottom. Once there, add this:
blacklist snd_hda_intel
Note: You might need dashes instead of underscores; eg: snd-hda-intel
When done, you can hit ‘Ctrl + X’ and then enter and ‘y’ in nano or ‘:w’ and ‘:q’ in vi to save and quit. After a reboot, the NVIDIA HDMI driver will hopefully have gone the way of the dodo.
Method #2 – Removing the Kernel Module
This method assumes you know how to edit and compile a kernel, as explaining it in depth would require a dedicated article in itself (please let us know if you’d enjoy such an article). If your kernel sources are installed, you should be able to recompile your kernel without much worry. On many systems, you simply need to load up a terminal, enter superuser mode, then go to /usr/src/yourcurrentkernelversion/ and then type in ‘make menuconfig’.
The location of the driver is as follows:
Device Drivers
> Sound card support
>> Advanced Linux Sound Architecture
>>> PCI sound devices
>>>> Intel HD Audio
You have two options at this point, Uncheck the option entirely, or turn it into an M to bundle it as a loadable module instead. The latter option would allow you to instead load the module at will rather than have to recompile your kernel if you want it back. In my PC, I have a dedicated audio card I use for both my speakers and headphones, so I removed it entirely.
It should be noted that ‘Intel HD Audio’ in itself is a tree, and inside is an HDMI/DP option. Simply disabling this instead of the entire HD Intel driver may work for you, but it didn’t for me. Even if I had everything unchecked inside of this tree, my OS would still default to the NVIDIA HDMI.
Once you’re finished, compile and copy the kernel to your /boot folder (you may wish to not overwrite your currently-used one for safety reasons).
After a reboot, your audio card should default to the one you want, with the NVIDIA HDMI nowhere in sight. Go ahead, breathe that sigh of relief.
Wrapping Up
This might be one of the worst news posts I’ve ever written. Though it was well-researched and I have the experience to back things up, there have been few issues to give me headaches quite like these, so I’m sure there must be easier ways to accomplish this task other than the two methods I just provided.
The best possible fix for this problem would be for NVIDIA to allow the disabling of HDMI audio (this wouldn’t affect the video) inside of its control center. Normally such a thing wouldn’t be needed, and it wouldn’t be in Windows, but because the Linux audio system can be sketchy at best, having the option to simply click a button to disable it would be hugely welcomed.
Unless no one ever speaks up about what’s been written here, I can’t consider this news post ‘finished’. I fought with myself when deciding whether or not to write it, but in the end, since it’s such a frustrating problem, I decided to. I’d love input, and I am sure if others are Googling for a solution to the same problem, they’ll appreciate some clear-cut options.
If you have had success or a lack of it with either of these solutions, or have solutions of your own, please don’t hesitate to post in our related thread!