SlackwareThis Forum is for the discussion of Slackware Linux.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Anybody succeed in getting audio over HDMI with Slackware 12.2?
My understanding is that alsa 1.0.18 or newer is required.
I built and installed the alsa-lib 1.018 package, then built and installed alsa-utils package.
Running the new aplay -l does not show my HDMI audio device. The HDMI device does appear with some Live CDs, although I have been unsuccessful in getting audio out to my HDTV.
Running cat /proc/asound/version lists version 1.0.17, which indicates I need to update something else.
Eventually I discovered that /usr/src/linux/include/sound/version.h lists 1.0.17. I changed that to 1.0.18a and compiled a new 18.104.22.168 kernel. I installed the new kernel but still no HDMI listed with aplay -l.
With the new kernel, I again compiled and installed alsa-lib and alsa-utils. Still no HDMI. There probably is something incorrect with the kernel config.
I'm using the proprietary Nvidia 180.29 drivers. Asus M3N78-EM motherboard with HDMI video out, GeForce 8200 MCP78S chip set.
Update: Using a Live CD I was able to get the command line speaker-test -c2 -twav -Dplughw:0,3 to send audio through HDMI to my HDTV speakers. Thus I was able to confirm the basics. Strangely, I could not get any multimedia players to send audio through HDMI. Odder yet, the latst XBMC Live CD would not send audio through HDMI either.
Regardless, I'd appreciate help with what I need to do to update the 12.2 kernel (22.214.171.124) to support the latest ALSA. Thanks.
Update: I have since learned I have two options. One is to merge newer alsa drivers into the kernel source tree. The information is available at the alsa wiki. I don't know whether that will succeed without problems as alsa developement tends to run in parallel with kernel development. That is, merging alsa 1.018a or later into the 2.6.27.x kernel with 12.2 might cause problems, might not. The second solution is to build a newer kernel. The 2.6.27.x kernel directly supports alsa 1.0.17. Kernel 2.6.28.x kernel supports alsa 1.0.18rc3. Kernel 2.6.29.x supports alsa 1.0.18a. Kernel 2.6.30 supports alsa 1.0.20.
As audio through HDMI was introduced in alsa 1.0.18a, that means trying to merge the alsa drivers from that version or later, or building 2.6.29.x or 2.6.30. As I reported elsewhere at LQ, the 2.6.29.x kernel series locks my on-board NIC upon a warm reboot and is not an option for me. That leaves testing a 2.6.27.x kernel with updated alsa drivers or building and installing 2.6.30 along with updated alsa packages. Hopefully then 12.2 will recognize the HDMI aduio device.
Also, I was finally able to pass audio through HDMI with the Live CDs by adding a custom /etc/asound.conf file.
Actually, there is a third option. Recompile the kernel without built-in alsa driver support and then build the alsa drivers as a separate package. I appreciate any comments if you have experience with any of the above.
just spent the weekend working on the same issue...
Hi. I have some experience with this as I've been building a mythtv box. I have a newer Gigabyte mobo using the snd_hda_intel module for sound with an nvidia 9400gt, and it took me quite a while to get sound over the hdmi cable...my problem now is that my sound and video don't sync up quite right, so over time the audio gets further back (I'll probably have to go back to analog output). Also, I used debian for this as I wasn't smart enough to figure out how to get mythvideo working with the internal player (ffmpeg-based) in Slackware. I have the newest NVidia driver 185.xxx, alsa 1.0.19, and kernel 2.6.26 (debian stock kernel).
Anyway, here's what I did (don't have the computer in front of me):
First, try getting hdmi audio working in Windows (if possible). If successful, at least you know the hardware works.
Bring up alsamixer, and under the iecxxx entries type m to unmute them. Do alsactl store to save changes.
Find out which digital device can actually output sound. With aplay -L, see what your device aliases are (one of them will probably work). For me, it was iec958. No HDMI device came up anywhere. Then try playing a sound, like /usr/share/sounds/KDE_Startup.wav with mplayer using the alias. I think my mplayer command was mplayer -ao alsa:device=iec958 /usr/share/sounds/KDE_Startup.wav.
Now, in the kde control center, under the sound system settings, check the box to autosuspend the sound system after 1 second, or KDE will take exclusive control of the device and you won't be able to play sounds with mplayer or anything else. You'll get an alsa: pcm_xxx_openDevice or resource busy) error.
Comment out the section at the top where it sets the default device and mixer. You want to use IEC958 for KDE and the default audio device, and mixed-digital for mythtv; I'm not sure why, but KDE won't work with mixed-digital for some reason. At the bottom of the file, under pcm.dmix-digital, try setting the rate to 44100 (that's the only one I could get working with mythtv live tv from a dish network input). Another one might work, like 48000, etc. You can try cat /proc/asound/devices (going from memory here) or something to see the sample rates for various channels. Now go in to mythtv, under Setup->General, and set the audio device to ALSA:mixed-digital. I unchecked internal volume control and both the spdif passthrough options. I haven't got passthrough working yet, I'm just happy to have sound.
The reason for using the special mixed-digital device in mythtv is that it allows multiple devices to access the same stream at once, and also converts sample rates like 22500 to 44100 so that your device can play them. My TV was really picky about what rates it would accept. You might not have this problem: if not use ALSA:default to use IEC958 as the default and skip the special .asoundrc file.
Hope this helps someone else to avoid days of frustration...
To answer your original question, if you've already got sound coming through hdmi, you probably don't need to upgrade alsa. It sounds like you're just having multiple resources trying to compete for the default alsa device, which KDE locks up by default. The KDE autosuspend trick should work for you. BTW, setting the delay to 0 is the same as not setting autosuspend at all(not sure why). Please show the error you get when trying to use mplayer, etc. to play a sound.
Thanks for all the information. I seemed to have stumbled down a similar path as you. I have succeeded in getting audio through HDMI with PCLinuxOS and XBMC but not Slackware 12.2. I struggled the same as you shared with getting audio to function with those OSs. For Slackware 12.2 I compiled and installed a new 126.96.36.199 kernel, alsa-lib, and alsa-utils 1.20 packages. That much effort finally got recognition of the HDMI audio device through aplay -l. Alsamixer shows all outputs unmuted and I copied my new asound.conf to Slackware, but still no audio.
I experienced a similar problem with audio and video synchronization with XBMC, but not with PCLinuxOS. I did not stop to think the problem is related to HDMI. I'll try again with external speakers and see how that goes.
I really want to stick with Slackware as I build this HTPC, but many things are frustrating me. I'm still focusing on the basics and haven't yet begun to tackle the monster known as MythTV. Sure, I can play audio through external speakers, but I am content with the sound quality of my HDTV speakers and would prefer to use them. Release 13.0 might be an option, but I have to wait until all relevant third-party build scripts are updated and tested. There is an XBMC build script for 12.2 and I hope that is updated for 13.0. I suspect Slackware would provide the usual stable and speedy foundation for a media center, but I won't pretend to be a media wizard to get all of this software working together seamlessly. I did a lot of reading before starting this project and accepted that such a journey is not for the feint-of-heart. That does not eliminate the frustrations, however.
A friendly note to the Slackware devs: Slackware 13.0 is pretty much now locked. Yet I hope that as soon as Current testing resumes that audio through HDMI is a feature that is well-tested. Browsing the web reveals that many people struggle with this issue. Would be nice if future reviewers reported that audio through HDMI "just worked" with the next release. You folks are pretty thorough so perhaps that is indeed the result we'll see down the road.
I couldn't get Slackware working with mythvideo, so unfortunately I had to go back to Debian. They must know something I don't... Just a note, you might have to use Xine or Mplayer for mythvideo unless you can get the default player working in Slackware (and the default one is pretty nice). As it is I've spent probably a couple months on this and I'm pretty close now. Definitely a huge pain. I haven't tried mythdora/mythbuntu because I wanted a full-blown distro with myth built on top of it.
Did you try using the iec958 device? Or maybe go back to the older alsa and try utilizing the iec958 device?
What about the results of the mplayer command?
BTW, you can't use the newest LIRC .85 with a 2.6.30 kernel (according to the site).
I think the audio and video synchronization don't sync up because I'm using alsa's software dmixer, not the one built into the sound card. Might be a similar problem for you with XBMC...
Let me know if you need any help with building mythtv in Slackware...I got all the way to the mythvideo part, then failed. My tests were to rip dvds and play them back, and I couldn't get it working. With my debian install, I still need to figure out how to fix the overscan issue with my Nvidia card and get sleep working.
I've had audio over hdmi using slackware 12.2 for over a year now but this with an integrated ATI/AMD 780g (HD3200). What really allowed it to work for me was kernel 2.6.25, and then reading/copying/trial and error for the unmuting with alsamixer (for me at -C1 as opposed to default at -C0).
I didn't have to deal with internal wires connecting audio output to video card or dvi to hdmi cables or anything like that. I've read where others with nvidia and intel are having problems with audio over hdmi. Some have gone to prior versions of their drivers. It seems a little random based on what I've read.
From what I can tell, the kernel needs to see the HW, alsa needs to support output, but also the video driver needs to enable/transport the signal over hdmi. So the video driver is very significant for this to work.
I've been using mythtv for some time and with slackware 12.2 using mplayer as the video player. Both mplayer and xine work for me outputting but both need to be set to do that.
Alsa: I can't remember the first version of alsa it worked with. Might have been 1.0.16. Slackware 12.2 has alsa 1.0.17 and I'm sure (for me) it works at that. It also works with whatever alsa comes in slackware-current (32 and 64) (or maybe in the kernels I've built (currently 2.6.27.x)).
AMD Driver: need to use catalyst or radeonhd. Radeon (xf86-video-ati) doesn't have hdmi sound yet.
I just noticed it was vik that aksed this. Note my experience is with hd3200 (780g) which is an amd/ati product. I don't have any experience with nvidia and sound over hdmi.
I did occasionally see a mythtv timing lag between video and audio (lips moving before you hear what their saying). I don't remember doing anything special to stop this (it was at least a year ago). Sometimes you could simply stop and restart mythtv. It may have also stopped after I got the ntp connection working. It may have also been the video choices in mythtv. Maybe after xv started working this stopped or I had to choose xv instead of opengl or x11 (shm). In any event you could always watch them in xine or mplayer without mythtv running to see if that is issue.
I look at /var/log/packages and my 12.2 is running stock alsa at 1.0.17a. I'm using kernel 188.8.131.52 for that. Sound over hdmi worked fine.
Interesting. I have no explanation other than perhaps the Catalyst software provided the hooks?
Again, this is with amd780g (hd3200) integrated. No comments regarding your hardware.
Yes, this is an NVidia chip set.
Overall, I'm finding this entire ordeal frustrating. I just don't understand why the support is so hit-and-miss everywhere. I've spent hours surfing the web looking for clues and a lot of people are struggling with audio over HDMI.
On my new box I have Slackware 12.2, Current/13.0, XBMC, and PCLinuxOS 2009.2 installed. Running aplay- l in 12.2 results in no HDMI audio port detection. I have no idea how to resolve that.
Running the same command in the other systems shows the HDMI audio port but with mixed sound results. I have been unable to get audio over HDMI with Current/13.0 with a 184.108.40.206 kernel and updated 1.0.20 ALSA packages.
I get audio all the time now in XBMC but only after finding an /etc/asound.conf file online. Initially with XBMC I had no audio there. Yes, I copied that same file to each operating system.
With PCLOS I sometimes have audio and sometimes don't. I can't figure out the pattern I need to awaken that system. Sometimes just running the aplay command seems to awaken audio over HDMI. Other times I have had to run alsamixer. Other times I had to send the speaker-test sound test to the normal external speakers and that seemed to awaken the HDMI port. There is no pattern I can find.
That I can at least get the port to show in these systems with aplay -l supposedly means I'm halfway home, but I'm stuck thereafter.
I have all of these OSs installed because I'm experimenting. I haven't decided on an OS for my HTPC. But for now, I can say that audio over HDMI is not well supported and hit-and-miss. I would like to remain with Slackware as my base OS and installed MythTV and XBMC on top of that. Yet if I can't get audio over HDMI then Slackware stops being a contender. And that frustrates me greatly. Only XBMC is working fine with audio over HDMI, but I really do not want to run an Ubuntu based system
I wish somebody in the Slackware community who truly has a clue about how all this works would post some kind of how-to or troubleshooting guide.
Thanks for the info--good for future reference. Finally got mine working correctly...didn't need to use the mythtv .asoundrc at all. Turned out the problem was my TV wouldn't accept 48000 KHz signals. All I had to do was tweak /usr/share/alsa/asound.conf (or something) and set the default device to 1, and set the rate to 44100 KHz. Debian references asound.conf or .asoundrc settings first, but then overwrites them with this file, so when I fixed it there it worked. Also had a problem where in kmix the iec958 channel was turned off but enabled in alsamixer. The kmix setting overrode the alsamixer one so I had to change it in kmix as well. Finally, in the KDE sound system control I set the sound system to autosuspend after 1 sec...not sure if this was needed or not. I upgraded to Alsa 1.20 but I don't think I needed to as I could get sound before with Alsa 1.17.
Just saw your last post. When you play a sound file with mplayer over IEC958, does it say it's playing but you don't get any output? Could be the problem I had in that the TV wouldn't accept certain sample outputs...
I have dual-boot setup so I can play blu-rays, and I tested the various sample rates in windows to find out which ones worked, then used that in my alsa configuration. Also found out that my tv doesn't support DTS or Dolby Digital either through the internal speakers. Could that be your problem?
Also, you might want to update your Nvidia driver. Mine is 185.xxx
P.S. I'll post my /usr/share/alsa/asound.conf file when I get home...that might be the answer for you.
All I had to do was tweak /usr/share/alsa/asound.conf (or something) and set the default device to 1, and set the rate to 44100 KHz.
I don't see an asound.conf but I see an alsa.conf. If I understand the script correctly. I should be able to add ~/.asoundrc or /etc/asound.conf to override options preset in alsa.conf.
Also had a problem where in kmix the iec958 channel was turned off but enabled in alsamixer.
In 12.2 I use KDE 3.5.10 and KMix shows yellow LEDs. Should they be green? Probably irrelevant because aplay -l does not show the HDMI audio port in 12.2
In Current/13.0 I'm using Xfce. Where do I check sound settings there? The speaker-test tool works fine with the normal external speakers (device 0,0) but not with HDMI (device 0,3).
Finally, in the KDE sound system control I set the sound system to autosuspend after 1 sec
I have the same setting in 3.5.10. I have never used KDE 4 yet so I'm not going to start fiddling there until I get the basics working.
When you play a sound file with mplayer over IEC958, does it say it's playing but you don't get any output?
I seldom use MPlayer. What is the correct syntax to do what you stated?
Also found out that my tv doesn't support DTS or Dolby Digital either. Could that be your problem?
Possibly, although probably not. That I can get audio over HDMI with XBMC all the time, and PCLOS sometimes indicates the TV does receive the signal. The problem is at my end where I understand so little about this information that I don't know why one system works and another doesn't.
Also, you might want to update your Nvidia driver. Mine is 185.xxx
I am using 185.18.31 in Current/13.0. The 185.18.31 version kernel module will not build against 220.127.116.11 in 12.2.
If you want, when I get home I'll post my /usr/share/alsa/asound.conf file...that might be the answer for you.
1) yep, it's /usr/share/alsa/asound.conf (couldn't remember). In mine, it references /etc/asound.conf and .asoundrc at the beginning of the file, then overrides those settings below. What I'm saying is that I needed to change my settings in /usr/share/alsa/asound.conf, not by creating a /etc/asound.conf or ~/.asoundrc.
2) if it's yellow it's good. if it's red it's disabled, under the switches tab. Don't know about xfce...I'm using KDE 3.5 as well.
3) Under control center->sound system there is an option on the first tab to autosuspend the sound system at the bottom of the page. You might want to try enabling this and setting the timeout to 1 second. You can try changing it back once you get everything working...
4) cd /usr/share/sounds; mplayer -ao alsa:device=iec958 KDE_Startup.wav.
If it doesn't work, edit your asound.conf file and do this (from memory): change pcm.default.device (or something) to 1 (it might be 3 in your case, show me aplay -l output and I'll tell you), and look for a line setting the sample rate. Try changing this to 44100. Then test with mplayer -ao alsa KDE_Startup.wav. This will test it using the default device, which you just set to digital instead of analog with the pcm.default.device setting above.
5) take a look at your /usr/share/alsa/asound.conf file in those distros and see what's different.
HDA NVidia, ALC1200 Analog
HDA NVidia, ALC1200 Analog
4.0 Surround output to Front and Rear speakers
HDA NVidia, ALC1200 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
HDA NVidia, ALC1200 Analog
5.0 Surround output to Front, Center and Rear speakers
HDA NVidia, ALC1200 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
HDA NVidia, ALC1200 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
HDA NVidia, NVIDIA HDMI
HDMI Audio Output
Discard all samples (playback) or generate zero samples (capture)
take a look at your /usr/share/alsa/asound.conf file in those distros and see what's different.
I don't have such a file in /usr/share/alsa, but here is the one I found online that enabled XBMC to function and PCLOS to sometimes function:
mplayer -ao alsa:device=iec958 KDE_Startup.wav
I tried this in Current/13.0. When I had /etc/asound.conf enabled, I had no sound from either the analog or HDMI device. To test the external analog speakers I ran mplayer -ao alsa KDE_Startup.wav.
When I disabled /etc/asound.conf then I had sound from the analog device.
Running speaker-test succeeded with the analog device but not with the HDMI device.
There are no error messages when I ran speaker-test or mplayer.
That I had no sound from the analog device when I enabled /etc/asound.conf seems to indicate alsa sees the conf file.