Getting sound from NVidia desktop video card to TV over HDMI
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You know what? I give up. I got the one second of audio lag again today. There was nothing in my dmesg output as to why. At this point, I think I've exhausted all the options.
No worries; my new setup will be video over HDMI, audio from a Behringer UCA 202 USB sound card directly to speakers. It just makes it a bit more complicated if I want to hook other devices up to the TV.
EDIT: Hmm... the problem went away soon after I posted, suggesting that it's temporary. Still not something that I'm willing to deal with.
Distribution: Slackware64-current with "True Multilib" and KDE4Town.
Posts: 9,097
Rep:
Quote:
Originally Posted by dugan
You know what? I give up...
Well, you took it a lot farther than I did.
A year or two ago I spent a good amount of time trying to get HDMI audio to work after reading the documentation from NVIDIA and elsewhere and finally threw in the towel.
Kudos for all the effort you put into the project.
Add start-pulseaudio-x11 to ~/.config/openbox/autostart (because I'm using openbox)
Add to /etc/rc.d/rc.local:
Code:
if [ -x /etc/rc.d/rc.pulseaudio ]; then
/etc/rc.d/rc.pulseaudio start
fi
Make /etc/rc.d/rc.pulseaudio executable and start it up
Add the following ~/.asoundrc
Code:
pcm.pulse {
type pulse
}
ctl.pulse {
type pulse
}
pcm.!default {
type pulse
}
ctl.!default {
type pulse
}
Pulseaudio is now working so transparently that I can't even tell if I'm outputting audio through Pulseaudio. I suppose that's a good problem to have. I'll post back if I get the lagging audio again, or if I manage to go for a week without it.
UPDATE: Hate to turn this into a Pulseaudio thread, but ugh... it turns out (ref) I need both a compat32 pulseaudio and a compat32 alsa-plugins to get audio in Wine now. I'll take care of that later.
UPDATE 2: Runner2 crashed immediately for what I strongly suspect is the same reason:
Code:
error 60: Error initializing output device.
FMOD error 31: FMOD was not initialized correctly to support this function.
Fatal error
Failed to load necessary sound data. Game will exit. (437278 0x723acf08)
The best option is to just disable the onboard audio if possible. This will allow udev to detect only the HDMI processor and use the Intel HD Audio. It also helps if you have a PCI/PCIe audio card that uses a different chipset as well.
Hey ReaperX7. The reason this doesn't work is because ALSA's default output device is card 0, device 0, or 0:0. The devices on my discrete NVidia card, as you saw from my aplay output, are 3, 7, 8 and 9, with 7 being the "valid" one (that's what my ELD info said, as mentioned upthread). If you have the motherboard's audio interface enabled, then the NVidia sound card is card 1, and its devices are 1:3, 1:7, 1:8 and 1:9. Disabling the motherboard sound card simply shifts the NVidia card's number to 0, giving you four audio devices: 0:3, 0:7, 0:8 and 0:9. None of these are 0:0, and you'll therefore get no audio output unless you do further tweaking.
You can then use the following .asoundrc to set device 0:7 as the default:
Code:
pcm.!default {
type hw
card 1
device 7
}
But then the audio will be going directly to the sound device and not through DMIX, so you'll only be able to play one sound at a time.
The simplest .asoundrc file that will send audio to dmix and then to 0:7 is:
Code:
pcm.ossmix {
type dmix
ipc_key 1024
slave {
pcm "hw:0,7"
}
}
pcm.!default {
type plug
slave.pcm "ossmix"
}
I've found that that gives me stuttering audio in Warcraft 3, so I had to add the common period_size and buffer_size parameters. The bindings section is a common performance optimization (to only care about two channels):
Later, I noticed that on a fresh boot, dmesg would contain the the recommendation I saw earlier for a larger bdl_pos_adj value.
If I started playing Google Play Music in Chromium, then my dmesg would be spammed with the above messages.
I was able to get the messages to disappear by adding the following to /etc/modprobe.d/snd-hda-intel.conf:
Code:
options snd-hda-intel enable_msi=1 bdl_pos_adj=64
(Notice that this is not the line I tried pasting in earlier from an Ubuntu ticket).
We'll see if this solves the delayed audio problem. I'm hopeful, because it gets rid of the "lost interrupt" warnings, and lost interrupts are obviously consistent with the symptoms.
But then the audio will be going directly to the sound device and not through DMIX, so you'll only be able to play one sound at a time.
Hello Dugan. Hope you have been rewarded with at least some progress after all your hard work. The reason for quoting the above is that even though this may not help you on your present tack, I figure thorough and accurate data is important to a successful outcome to avoid blindly resorting to the time-wasting shotgun approach. So far it seems you have avoided such a fail. Maybe this might help keep that going.
I'm wondering where the idea above came from, or if it was ever true, what and when has it changed? I ask this because I've never worried about this issue, because as long as I can remember, it has never been an issue for me with Alsa. I don't even have pulseaudio installed but I have always been able to, for example, speak and hear on TeamSpeak 3 while at the same time hearing for example, Professor Putricide. declare "Hmmmm where did those come from?" in WOTLK. Upon a few occasions I have added XMMS2 or Aqualung, or even the typical flash players in browsers so that the raid can hear music while we hurl insults at Valanar.
I'm assuming this is what people mean by "multiple sound (sources) at the same time" and mine has always just worked. My system has 3 audio hardwares -
1] the HDMI built into my nVidia graphics card (though the audio portion of HDMI is blacklisted)
2] USB microphone section of Logitech webcam (though it still works just as well with a different Mic plugged into ======>>>>
I'm including the list in case alsa behaves differently with different hardware and notably mine has 4 discrete channels so has some onboard auto-mixing capability... however it is my understanding that essentially all sound cards have some level of internal mixing. I do use an .asoundrc but it is very basic and I can't see how it could be responsible for multi-source capability.
Hopefully this may help even if only something to check off and discard. Any other data I can provide to help if you want it, just say so. Linux is so uneven when it comes to audio in that some stuff is so advanced and/or solid and others are Rube Goldberg at best, so it's difficult to diagnose something as complex as full second delays. This can be more complicated by other Rube like devices like Flash in Browsers which is giving me fits since a Firefox "upgrade". So again, anything you need.....
I'm wondering where the idea above came from, or if it was ever true, what and when has it changed?
probably from me or teh internet, if i understand what the topic is
by direct i meant direct
alsa by default, without an .asoundrc, resamples everything to 48kHz
if you make it be direct it will fail when a request for a sample rate or bitrate is made that is different from the one currently being played
at least on my 2 cards (i remember older ones too)
example .asoundrc
Code:
pcm.!default{
type hw
card 0
}
ctl.!default{
type hw
card 0
}
to check what the card is currently doing:
watch cat /proc/asound/card0/pcm0p/sub0/hw_params
(for card0, subdevice 0)
notice that when playing a, for example, 96kHz track without an asoundrc, it will say 48kHz
I'm wondering where the idea above came from, or if it was ever true, what and when has it changed?I do use an .asoundrc but it is very basic and I can't see how it could be responsible for multi-source capability.
May I see your .asoundrc file, please?
I can confirm that if I use an .asoundrc file to send audio to my NVidia card (which, and this is significant, is not card 0, device 0) and I do not specify that it goes through DMix, then running two MPlayer instances at the same time will result in the second one erroring out with "sound device busy."
I'm including the list in case alsa behaves differently with different hardware and notably mine has 4 discrete channels so has some onboard auto-mixing capability...
That is exactly why it works for you, dmix is not needed for audio-cards that have mixing capabilities in the hardware.
Quote:
however it is my understanding that essentially all sound cards have some level of internal mixing.
Many cards, especially cheap and onboard audio-cards, only have software mixing capabilities, read: Alsa has to do the mixing, hence dmix must be used.
problem is in the resampling part of mixing
mixing two inputs that have the same format is just add-ing them together with saturation
funny, i tried now playing two songs with the same format and got a "device busy"
i distinctly remember it working on my previous card (and that was a crap one)
interesting
anyway
i agree, proper hw mixing is rarely found in non-professional hardware
envy based cards being the only exception i found so far (ICE series has been continued as envy, they renamed after VIA bought them)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.