Getting Fedora 20 Sound Working Again

When I updated Fedora 20 some timeĀ (but many updates) ago my sound stopped working. I don’t exactly know which update caused the problem. I don’t play audio or watch video all that often on my laptop. I expected that a pending update would resolve the problem but after a few months I figure it’s not the Fedora software but something on my system. Time to roll up the sleeves and dig in. I used this page for some excellent background, information, suggestions, etc.:

https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture

After a few days of work here’s my step-by-step to resolve the problem.

First, I listed what sound card and device IDs I have by running

aplay -l

Here’s what mine looked like when I started:

**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: VT1802 Analog [VT1802 Analog]
 Subdevices: 0/1
 Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 2: VT1802 Alt Analog [VT1802 Alt Analog]
 Subdevices: 1/1
 Subdevice #0: subdevice #0

Next I ran alsamixer to look at each device. Hit <F6> to select the device to check. I checked “default” and the two devices that you see in the list from “aplay -l” above, namely “HDA Intel PCH” and “HDA Intel HDMI.” After selecting the sound card I hit <F5> and checked each item such as “Master,” “Speaker,” “PCH,” etc. to be sure they’re not muted and set to at least 50. If an item can be muted then you’ll see either “MM” or “OO” at the bottom of the vertical level indicator. If any are muted (=”MM”) type “m” to toggle the item to unmute. The item names are a little hard to read at the base of each but they also display on the fourth line down from the top left.

I played around with the “speaker-test” program and played an audio file (a .wav file) on each card/device to see which if any played sound. Here’s the command:

aplay -D plughw:CARD,DEVICE WAV_FILE

I tried each card/device combination: 0,3, 0,7, 0,8, 1,0 and 1,2. Here’s exactly what I typed for the first card/device:

aplay -D plughw:0,3 /usr/share/skype/sounds/SkypeLogin.wav

Sound played from card/device 1.0. No sound from anything else. I didn’t expect anything when I tried the HDMI card devices since I don’t have any HDMI hardware for the sound card to send audio to.

I want the sound to be played on the the PCH card and device 0. I would also like it to always be the same card number and not change after an update. I decided to make it card 0. To set this up I first ran this command to determine what the driver is for each card:

cat /proc/asound/modules

Mine looks like:

 0 snd_hda_intel
 1 snd_hda_intel

OK, the driver for both sound cards is “snd_hda_intel.” Next I ran:

lspci -nn | grep -i audio

Here’s what my system looks like:

00:03.0 Audio device [0403]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller [8086:0c0c] (rev 06)
00:1b.0 Audio device [0403]: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller [8086:8c20] (rev 05)

Frankly I can’t tell which one is the HDMI card but it really doesn’t matter yet. The problem is to not have the card numbers move around so that one day the first card is card 0 and after an update it’s then card 1. The way to do that is to add two lines (one for each card) to /etc/modprobe.d/alsa-base.conf to specify the “index” (= card number I think) like this:

options snd-hda-intel index=0 model=auto vid=8086 pid=8c20
options snd-hda-intel index=1 model=auto vid=8086 pid=0c0c

The values for “vid” and “pid” are from the output of the “lspci -nn | grep -i audio” command. Right about at the end of line the “vid” and “pid” are surrounded by braces and the format is “[vid:pid].”

Lastly, tell alsa that you want device 0 on card 0 to be the default pcm sound device. I set up the file /etc/asound.conf as follows:

#
# Place your global alsa-lib configuration here...
#
pcm.!default {
 type hw
 card 0
 device 0
}

At this point everything is about set. The only uncertainty is which of the two lines in /etc/modprobe.d/alsa-base.conf is the PCH card. I’m not sure if I have the index values correct. I might need to switch them.

I rebooted the system, logged back in and ran the “aplay -l” command again. The results are:

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: VT1802 Analog [VT1802 Analog]
 Subdevices: 0/1
 Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 2: VT1802 Alt Analog [VT1802 Alt Analog]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 1: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 1: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 1: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
 Subdevices: 1/1
 Subdevice #0: subdevice #0

If card 0 was the HDMI card and card 1 was the PCH card I’d reverse the “index=” values in the two lines in the file /etc/modprobe.d/alsa-base.conf.

I’m done, right? Not at all. For starters I needed to run alsamixer again to inspect the default and PCH cards. I checked again for anything that outputs sound to verify that it’s not muted and/or at a very low setting. My speaker item was not muted but it was set to 0. No clue why.

Now to verify that pulseaudio is configured to talk to the right sink (=output device). I listed out the directory /dev/snd. Mine looks like this:

drwxr-xr-x. 2 root root 80 Jul 20 10:31 by-path
crw-rw----+ 1 root audio 116, 7 Jul 20 10:31 controlC0
crw-rw----+ 1 root audio 116, 2 Jul 20 10:31 controlC1
crw-rw----+ 1 root audio 116, 11 Jul 20 10:31 hwC0D0
crw-rw----+ 1 root audio 116, 6 Jul 20 10:31 hwC1D0
crw-rw----+ 1 root audio 116, 9 Jul 20 10:31 pcmC0D0c
crw-rw----+ 1 root audio 116, 8 Jul 20 10:31 pcmC0D0p
crw-rw----+ 1 root audio 116, 10 Jul 20 10:31 pcmC0D2p
crw-rw----+ 1 root audio 116, 3 Jul 20 10:31 pcmC1D3p
crw-rw----+ 1 root audio 116, 4 Jul 20 10:31 pcmC1D7p
crw-rw----+ 1 root audio 116, 5 Jul 20 10:31 pcmC1D8p
crw-rw----+ 1 root audio 116, 1 Jul 20 10:31 seq
crw-rw----+ 1 root audio 116, 33 Jul 20 10:31 timer

Next I listed out /dev/snd/by-path:

lrwxrwxrwx. 1 root root 12 Jul 20 10:31 pci-0000:00:03.0 -> ../controlC1
lrwxrwxrwx. 1 root root 12 Jul 20 10:31 pci-0000:00:1b.0 -> ../controlC0

From the “aplay -l” output just above I know that PCH is card 0 (as I wanted it to be) so pulseaudio should have it’s sink be device “pci-0000:00:1b.0” since that’s a link to control0 (control device for card 0).

Now it’s time to check pulseaudio. I ran “Pulseaudio Manager” (it’s in my Multimedia menu on KDE) and selected the “Server Information” tab. The default sink should be “alsa_output.<DEV>.<Something>” where “<DEV>” for me is the “pci-0000:00:1b.0” value. On my system the “<Something>” part says “analog-stereo.” Next I clicked on the “Devices” tab, clicked on the “alsa_output.pci-0000:00:1b.0.analog-stereo” line and clicked on the “Properties” button at the lower right. There’s a voumne control there as well. I clicked “Reset” to set it to 100%. I then clicked on the “Go to Monitor Source” button below the volume slider and set the volume there to something reasonable as well. That’s it for Pulseaudio Manager.

At this point I launched VLC, opened a video file (a TED talk) and sound poured forth from the speakers.

One last note. Now that I have sound basically working the “speaker-test” program errors out telling me that the device is busy:

speaker-test 1.0.27.2
Playback device is plughw:0,0
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Playback open error: -16,Device or resource busy

I suspect that it’s because pulseaudio has it open.

Good luck if you’re working a sound issue. I’m no expert but if I can help just send me an e-mail and I’ll try to offer a suggestion or two.