Sound is a very complex topic. I'm not going to cover everything possible nor am I going to explain any of the whys and wherefores. Those explanations are beyond me and will require someone with a more complete understanding of the issues to step forward and write about them.
Also beyond the scope of this post is how to change kernel options. There are plenty of sources for how to configure your kernel. Please reference these if you're lost in the discussion of kernel options which appears later in this post.
This post is simply a collection of some items you can check for and some steps you can take if you're having problems with sound. This post is therefore limited in scope and the information it presents. As I learn more, I'll update this post. Good luck!
Tips and Suggestions
1 ) Check your kernel configuration.
This is critical. In fact, it's much more critical than most people realise. Part of the problem is that the kernel can be fooled into silently loading too many sound drivers. These can conflict resulting in no sound at all or sound for some and no sound for other programs.
The first step is to determine exactly what you need as drivers. I use both of two different methods for this. In a terminal window:
Code: Select all
lspci | grep AudioCode: Select all
alsamixerOn my current system I get the following results:
Code: Select all
lspci | grep Audio
00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia (Intel HDA)
01:00.1 Audio device: ATI Technologies Inc R700 Audio Device [Radeon HD 4000 Series]
alsamixer
Card: HDA ATI SB
Chip: Realtek ALC889ACode: Select all
[*] Support digital beep via input layer
[*] Support jack plugging notification via input layer
[*] Build Realtek HD-audio codec support
[*] Build ATI HDMI HD-audio codec support
[*] Build INTEL HDMI HD-audio codec support
[*] Enable generic HD-audio codec parserI chose the Realtek codec because of the information displayed from alsamixer, the ATI HDMI codec because that's the chip on the graphics card<1> and the INTEL codec to ensure that the complete framework for the Intel HDA specification was present.
If I had built this kernel based solely on lspci, I wouldn't have known I also needed the Realtek codec. When I did, this incomplete kernel resulted in only a few channels when opening any mixer. Sound was present, but only the front speakers worked.
Don't make the mistake of building all of the HDA codecs!!! Depending on the release level of the kernel you're running some of these HDA codecs will silently conflict with each other without any hint of a problem. Build only the codecs you actually need. I can't stress this enough.
One of the things I've found helpful is to compile all the Sound settings in the kernel as modules. Doing so allows me to see what modules the kernel detects and automatically loads.
2 ) Remove or move file ~/.asoundrc to another location.<1>
i.e.
Code: Select all
mv ~/.asoundrc ~/asoundrcCode: Select all
rm ~/asoundrc3 ) Check your backend.
No. This doesn't mean stand up and find your backside. Sound input to the alsa drivers are eventually fed from an "audio backend". That is to say that the drivers take sound information from your backends and process that to drive your audio chip(s). Depending on which desktop you have installed and what your USE settings are, you'll have either the "gstreamer" or "xine" backends. Most people end up with both backends installed. I have KDE, xfce4, fluxbox and lxde installed. Combined with my USE flags, I have both backends installed. But wait! It's more complicated than that.
If you have pulseaudio {as most people do by default} then your default backend might be listed as PulseAudio. What happens is that pulseaudio inserts itself in the audio stream and becomes the backend. The reason for this is to much more easily permit things like having music play in the background, have "PC speaker" style beeps and be able to talk on skype or in an online game all at the same time. Your sound chip is able to process only a single audio stream at a time. Sound servers like pulseaudio take in multiple sound stream sources and combine them to produce a single soundstream for passing off the the actual backend doing the passing off to your alsa driver(s).
Note that I indicated pulseaudio might be listed. This, apparently, is going to be a function of version release. Currently {as of Mar 26, 2010), pulseaudio is not listed on my desktop system after the latest round of updates. Go figure.
I'm going to use KDE as my example here because it provides a clear example of the kind of thing you're looking for. Besides, it's what I normally use so I'm being lazy as well.
Using the KDE application launcher of your choice, open "System Settings". Under computer administration, open "Multimedia". In the left pane will be a hierarchical listing of "sources" and in the right pane will be a list of available sound players. Usually, this screen opens with "music" highlighted and with "PulseAudio" listed as the only available sound player. Depending on the configuration of your system, other things that can appear here include and are not limited to:
Code: Select all
PulseAudio Sound Server
HDA ATI SB ()
HDA ATI HDMI
Jack Audio Connection Kit
... etcIf none of them work, you need to go back and check your kernel configuration.
If the first one in the list doesn't work but the next one does, then you need to change the order of the items in the list. You can do this by highlighting the desired sound player and then using the "prefer" button to move it to the top. Do this for all the source sound events in the left hand pane including the default source sound.
4 ) Check your player software.
Different media players such as amarok, audacious, qmmp, kmplayer et al will recognize different sound player backends. I'm going to use amarok as an example. Conceptually, most of the different media players permit you to change/configure sound player backends. You'll need to check the media players you use.
In amarok under Settings ==> Configure Amarok, click on the "Playback" tab. There will be a button labeled "Sound System Configuration". On the button itself will be written the sound player server currently configured for the KDE desktop. In my case, it says "phonon". Click this button.
A screen identical to the "Multimedia" screen discussed above will display. However, amarok usually displays the actual available hardware devices first then sound servers like pulseaudio and jack. This screen works exactly as described above. Configure as you need.
5 ) When all else fails: Check your BIOS!<1>
I'm suggesting two different checks here. The first is to confirm that you have the latest available BIOS for your system. The second is to check your actual BIOS settings. Warning: If checking/updating your BIOS is more than you're currently prepared to do, find a technically competent friend to help you. I will not be responsible if you 'brick' your motherboard!!!
If you're using a built in sound chip {as most people do}, ensuring that you have the latest available BIOS just makes sense. The percentage of BIOS updates I've personally seen which include sound chip related updates is quite high. In my opinion, if you don't include BIOS updates which are purely information to expand the use of newer CPU chips, such sound related updates are in the double digit percentages {i.e. over 10%}. I've done no factual research to back this up. But I really have seen a lot of sound related BIOS updates.
Most people don't think of BIOS settings in terms of sound other than to activate or inactivate their built in sound chip. But modern motherboards can be much more complex than that. I'll give you my current system's motherboard as an example.
This motherboard uses an ATI chipset with a built in graphics chip. The IGP is the RD4250. This is an HDMI capable graphics chip which means it has ATI HDMI sound. In the BIOS, I've inactivated the IGP in favor of a separate graphics card utilising the ATI RD4650 {this is the R700 series reference from 'lspci' in 1 ) }. I therefore have 3 different possible hardware related sound processors. The potential for conflict is real and needs to be checked for.
6) When all else really, really fails <2>
Re-emerge all packages having to do with or using sound. Execute:
Code: Select all
USE="-alsa -pulseaudio -jack emerge -puNDv @worldCode: Select all
Calculating dependencies... done!
[ebuild R ] media-libs/libsndfile-1.0.21 USE="sqlite -alsa* -minimal" 0 kB
[ebuild R ] media-libs/libao-0.8.8 USE="mmap nas -alsa* -doc -pulseaudio*" 0 kB
[ebuild R ] media-libs/mediastreamer-2.3.0-r1 USE="X ipv6 speex theora x264 -alsa* (-coreaudio) -debug -examples -gsm -ilbc -jack* -oss -portaudio -video" 0 kB
[ebuild R ] dev-java/sun-jdk-1.6.0.18-r1 USE="X nsplugin -alsa* -derby -doc -examples -jce -odbc" 0 kB
[ebuild R ] net-wireless/bluez-4.62 USE="consolekit cups gstreamer pcmcia usb -alsa* -caps -debug -old-daemons -test-programs" 0 kB
[ebuild R ] media-sound/pulseaudio-0.9.21.2-r1 USE="X asyncns bluetooth caps dbus glib ipv6 libsamplerate tcpd udev -alsa* -avahi -doc -gnome -hal -jack* -lirc (-oss) -realtime (-system-wide) -test" 0 kB
[ebuild R ] sys-power/pm-utils-1.2.6.1 USE="networkmanager -alsa* -debug -ntp" VIDEO_CARDS="-intel -radeon" 0 kB
[ebuild R ] net-libs/xulrunner-1.9.2-r5 USE="dbus java libnotify startup-notification -alsa* -custom-optimization -debug -gnome -system-sqlite -wifi" 0 kB
[ebuild R ] www-client/mozilla-firefox-3.6-r5 USE="dbus java libnotify startup-notification -alsa* -bindist -custom-optimization -gnome -system-sqlite -wifi" LINGUAS="en -af -ar -as -be -bg -bn -bn_BD -bn_IN -ca -cs -cy -da -de -el -en_GB -en_US -eo -es -es_AR -es_CL -es_ES -es_MX -et -eu -fa -fi -fr -fy -fy_NL -ga -ga_IE -gl -gu -gu_IN -he -hi -hi_IN -hr -hu -id -is -it -ja -ka -kk -kn -ko -ku -lt -lv -mk -ml -mr -nb -nb_NO -nl -nn -nn_NO -oc -or -pa -pa_IN -pl -pt -pt_BR -pt_PT -rm -ro -ru -si -sk -sl -sq -sr -sv -sv_SE -ta -ta_LK -te -th -tr -uk -vi -zh_CN -zh_TW" 0 kB
[ebuild R ] media-libs/libsdl-1.2.14-r1 USE="X aalib audio dga directfb fbcon joystick libcaca nas opengl video xv -alsa* -custom-cflags -ggi -oss (-ps3) -pulseaudio* -svga -tslib -xinerama" 0 kB
[ebuild R ] media-video/ffmpeg-0.5_p21602 USE="3dnow 3dnowext X encode hardcoded-tables jpeg2k mmx mmxext mp3 network sdl speex ssse3 theora threads vorbis x264 xvid zlib -alsa* (-altivec) -bindist -cpudetection -custom-cflags -debug -dirac -doc -faac -faad -gsm -ieee1394 -jack* -opencore-amr -oss -pic -schroedinger -test -v4l -v4l2 -vdpau" VIDEO_CARDS="nvidia" 0 kB
[ebuild R ] media-sound/mpg123-1.10.1 USE="ipv6 mmx nas network sdl sse -3dnow -3dnowext -alsa* (-altivec) -jack* -oss -portaudio -pulseaudio*" 0 kB
[ebuild R ] media-libs/libquicktime-1.1.5 USE="X aac dv encode ffmpeg gtk jpeg lame mmx opengl png vorbis x264 -alsa* -doc -schroedinger" 0 kB
[ebuild R ] media-video/mplayer-1.0_rc4_p20100213-r1 USE="X a52 aac aalib ass cddb cdio cdparanoia dga dirac directfb dts dv dvd dvdnav enca encode faac faad fbcon ftp gif iconv ipv6 jpeg jpeg2k libcaca live lzo mmx mng mp3 nas network opengl osdmenu png quicktime rar real rtc samba schroedinger sdl shm speex sse theora toolame tremor truetype twolame unicode vorbis win32codecs x264 xscreensaver xv xvid xvmc -3dnow -3dnowext -alsa* (-altivec) -bidi -bindist -bl -bs2b -cpudetection -custom-cpuopts -debug -doc -dvb -dxr3 -esd -ggi -gmplayer -jack* -joystick -ladspa -lirc -mad -md5sum -mmxext -nut -openal -opencore-amr -oss -pnm -pulseaudio* -pvr -radio -sse2 -ssse3 -svga -tga -v4l -v4l2 -vdpau -vidix -xanim -xinerama -zoran" VIDEO_CARDS="vesa -mga -s3virge -tdfx" 0 kB
[ebuild R ] media-sound/sox-14.3.0 USE="encode ffmpeg flac id3tag ogg png wavpack -alsa* -ao -debug -ladspa -mad -oss -pulseaudio* -sndfile" 0 kB
[ebuild R ] media-video/gpac-0.4.5-r1 USE="a52 aac ffmpeg ipv6 javascript jpeg jpeg2k ogg opengl png sdl ssl theora truetype vorbis xml xvid -alsa* -amr -debug -jack* -mad -oss -pulseaudio* -wxwidgets" 0 kB
[ebuild R ] app-emulation/wine-1.1.40 USE="X cups dbus fontconfig gecko gphoto2 hal jpeg ldap mp3 nas ncurses opengl perl png samba scanner ssl threads truetype xcomposite xml -alsa* -capi -custom-cflags -esd -gnutls -gsm -jack* -lcms -openal -oss -pulseaudio* -test -win64 -xinerama" 0 kB
[ebuild R ] net-libs/ptlib-2.6.6 USE="asn audio ffmpeg ftp ipv6 jabber ldap pch sasl sdl snmp soap ssl stun video wav xml xmlrpc -alsa* -debug -doc -dtmf -esd -examples -http -ieee1394 -mail -odbc -oss -qos -remote -serial -shmvideo -socks -telnet -tts -v4l -v4l2 -vxml" 0 kB
[ebuild R ] media-gfx/gimp-2.6.8 USE="aalib dbus exif hal jpeg mmx mng pdf png python sse svg tiff webkit wmf -alsa* (-altivec) -curl -debug -doc -gnome -lcms -smp" 0 kB
[ebuild R ] media-plugins/gst-plugins-meta-0.10-r4 USE="X a52 dvd ffmpeg flac lame mpeg ogg taglib theora vorbis xv -alsa* -dvb -esd -mad -mythtv -oss -pulseaudio*" 0 kB
[ebuild R ] media-libs/xine-lib-1.1.18.1 USE="X a52 aac aalib css directfb dts fbcon flac gtk imagemagick ipv6 libcaca mmap mng modplug musepack nls opengl samba sdl speex theora truetype v4l vcd vorbis wavpack win32codecs xcb xv xvmc -alsa* (-altivec) -dxr3 -esd -gnome -jack* -mad -oss -pulseaudio* (-real) -vidix (-vis) -xinerama" 0 kB
[ebuild R ] media-video/transcode-1.1.5-r1 USE="X a52 aac dv dvd iconv imagemagick jpeg lzo mjpeg mmx mp3 mpeg ogg quicktime sdl sse theora truetype vorbis x264 xml xvid -3dnow -alsa* (-altivec) -nuv -oss -postproc -sse2 -v4l2" 0 kB
[ebuild R ] media-sound/phonon-4.4.0 USE="gstreamer xcb xine -alsa* (-aqua) -debug -pulseaudio*" 0 kB
[ebuild R ] kde-base/kdelibs-4.4.1-r1 USE="acl bzip2 fam handbook jpeg2k kerberos mmx nls openexr opengl semantic-desktop spell sse ssl -3dnow -alsa* (-altivec) (-aqua) -bindist -debug -doc (-kdeenablefinal) (-kdeprefix) -lzma -policykit -sse2 -test -zeroconf" 0 kB
[ebuild R ] kde-base/libkcompactdisc-4.4.1 USE="-alsa* (-aqua) -debug (-kdeenablefinal) (-kdeprefix)" 0 kB
[ebuild R ] kde-base/kmix-4.4.1 USE="handbook -alsa* (-aqua) -debug (-kdeenablefinal) (-kdeprefix) -pulseaudio*" 0 kB
[ebuild R ] kde-base/phonon-kde-4.4.1 USE="xine -alsa* (-aqua) -debug (-kdeenablefinal) (-kdeprefix)" 0 kBCode: Select all
emerge libsndfile libao mediastreamer sun-jdk bluez pulseaudio pm-utils ... Once you've re-emerged all your sound packages, then reboot. Yep. Reboot. It's the surest way to be certain everything is running and re-started cleanly.
Start of additional relevant notes:<1>
a) Physical sound volume:
Regarding my comment above " ... test sound will play at full volume." - I'm leaving this warning 'as is' even though it's not strictly true. The reason for leaving the warning is that it's a good idea to always start your physical volume low when testing sound. It's much better to start testing sound at low volumes then gradually increase the physical volume to confirm the presence or lack of sound than it is terrify into wakefulness 4 cats, all 7 dogs, the SO and one's mother to say nothing about saving one's ears and speakers. {Long story. Don't ask.}
Back to the clarification at hand. It turns out that after further refining the kernel Intel HDA tweaks mentioned above, the alsa volume settings for PCM are now respected. {sigh} Kernel settings are critical!
b) Why use alsamixer? Why can't I use kmixer or some other gui mixer?
Alsamixer will attempt to respect ~/.asoundrc. {see 2) above} However, if ~/.asoundrc isn't present, alsamixer will open the first available physical sound chip. It will ignore pulseaudio, jack and any other soundserver you may have installed. i.e. Since you're looking for clarification of hardware information, alsamixer will directly give you this. All the other mixers I've worked with respect your system sound settings. For directly querying the hardware, other mixers are not helpful.
Note that I'm not currently recommending hardware listers. The tips and suggestions here are what most people are likely to have installed if they're working on sound issues on their systems.
c) Radeon fglrx placeholder:
This isn't yet a 'tip'. Rather, it represents something I will be checking sometime in the future. The latest proprietary ati-drivers {e.g. fglrx} either include or may include in the future support for HDMI based sound in linux. I don't know how this plays or may play with other sound drivers which may be present/active in your kernel. I point this out in the spirit of things to check for if you're having problems with sound and also happen to be running fglrx.
Currently, the only way I know to check for a problem in this area is to unmerge ati-drivers, change to fx86-video-ati and recheck your sound. Note that, in theory, this applies to all hardware with HDMI {graphics chips} support. YMMV and all the other usual disclaimers. If anyone has further clarifying information, please feel free to post.
Note that i) I will be checking the impact of ati-drivers in the fairly near future and ii) on my primary test system, kmixer currently reports two hardware tabs. The second tab is labeled 'Ati HDMI'. I'm guessing that this is the HDMI support present in the my RV730 Radeon chip on my graphics card. It only has a single IEC entry at this time so it's not currently usable.
end of this update) <1>
coda)
This ends my list of things to check if you're having problems with sound.
It should be clear that there are many reasons why sound may stop working or work for some programs and not others. Generally, when people tell me that a new release of the kernel breaks their sound or a package update of their favorite player doesn't work, I can often trace it back to an originally borked but silent configuration issue. The kernel gets fixed or the player gets fixed and the broken configuration rears it's head and says "No sound for you!". There is always a potential for conflict between sound drivers in the kernel as well. Given the number of sound chips out there, the different motherboards they can appear in and the features{bugs} a given motherboard manufacturer my have in any given motherboard revision, it's not always possible for the kernel folk to be certain that multiple sound drivers won't install themselves. This seems to be especially true for the HDA codecs.
It should also be clear that with multiple sound player backends installed, a single borked backend will result in some players working and other players failing depending on which backend a given player is configured for. You need to follow tip 4) for each and every media player you use.
The following listings are for informational purposes:
I'm including a list of related packages and their associated USE flags from my system.
Code: Select all
emerge -pv alsa-plugins jack pulseaudio phonon xine-lib gstreamer
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild R ] media-sound/pulseaudio-0.9.21.1 USE="X alsa asyncns avahi caps dbus glib hal ipv6 jack libsamplerate tcpd udev -bluetooth -doc -gnome -lirc (-oss) (-system-wide) -test" 0 kB
[ebuild R ] media-libs/gstreamer-0.10.25 USE="nls -test" 0 kB
[ebuild R ] media-sound/jack-3.1.1 0 kB
[ebuild R ] media-libs/xine-lib-1.1.18 USE="X a52 aac aalib alsa css directfb dts fbcon flac gtk imagemagick ipv6 jack libcaca mad mmap mng modplug musepack nls opengl pulseaudio samba sdl speex theora truetype v4l vcd vorbis wavpack xcb xinerama xv xvmc (-altivec) -dxr3 -esd -gnome -oss (-real) (-vidix) (-vis) (-win32codecs)" 0 kB
[ebuild R ] media-plugins/alsa-plugins-1.0.22 USE="ffmpeg jack libsamplerate pulseaudio speex -debug" 0 kB
[ebuild R ] media-sound/phonon-4.3.80-r1 USE="alsa gstreamer pulseaudio xcb xine (-aqua) -debug" 0 kBCode: Select all
lsmod
Module Size Used by
radeon 443856 2
ttm 30156 1 radeon
drm_kms_helper 18389 1 radeon
drm 125723 5 radeon,ttm,drm_kms_helper
i2c_algo_bit 4273 1 radeon
it87 16007 0
hwmon_vid 1668 1 it87
hwmon 1305 1 it87
snd_seq_dummy 1231 0
snd_seq_oss 23339 0
snd_seq_midi_event 4596 1 snd_seq_oss
snd_seq 40972 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_seq_device 4475 3 snd_seq_dummy,snd_seq_oss,snd_seq
snd_pcm_oss 29843 0
snd_mixer_oss 12325 1 snd_pcm_oss
dm_mod 50033 0
snd_hda_codec_atihdmi 2187 1
snd_hda_codec_realtek 234478 1
snd_hda_intel 17768 8
snd_hda_codec 52883 3 snd_hda_codec_atihdmi,snd_hda_codec_realtek,snd_hda_intel
snd_hwdep 5208 1 snd_hda_codec
snd_pcm 53924 4 snd_pcm_oss,snd_hda_intel,snd_hda_codec
snd_timer 15370 3 snd_seq,snd_pcm
snd 43840 25 snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,
snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,
snd_pcm,snd_timer
soundcore 4431 1 snd
snd_page_alloc 5879 2 snd_hda_intel,snd_pcm
r8169 30780 0 <1> Edited for clarification and additions Mar 10, 2010
<2> Edited for new additions Mar 26, 2010
Applied manual line wrapping to the lsmod output to minimize layout breakage. -- desultory





