You are not logged in.

#1 2015-08-09 23:25:37

Hsere
Member
Registered: 2015-08-09
Posts: 1

Several misc. ALSA questions (changing the default device?)

Background: been running Arch for a few years, but still a newbie in terms of knowledge.  Searching through the forum, I've found several posts on similar issues, but haven't found a clear explanation as to what exactly is going on here.  My apologies if I've missed it.

The situation: after moving my Arch Linux HD to a new rig (new graphics card, new MoBo, basically new everything), I have no sound whatsoever.  After some digging around on the Wiki, I tried speaker-test, and got the following output:

# speaker-test -c 2

ALSA lib pcm_dmix.c:1024:(snd_pcm_dmix_open) unable to open slave

speaker-test 1.0.29

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Playback open error: -2,No such file or directory

Seems like it might be trying to use the wrong device.  Looking through the speaker-test man page, I see that I can use

aplay -L

to list all available sound devices.  Here's the output from that:

# aplay -L

null
    Discard all samples (playback) or generate zero samples (capture)
hdmi:CARD=HDMI,DEV=0
    HDA Intel HDMI, HDMI 0
    HDMI Audio Output
default:CARD=PCH
    HDA Intel PCH, ALC892 Analog
    Default Audio Device
sysdefault:CARD=PCH
    HDA Intel PCH, ALC892 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    Front speakers
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Digital
    IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
    HDA NVidia, HDMI 1
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
    HDA NVidia, HDMI 2
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 3
    HDMI Audio Output

"default" is listed as "HDA Intel ALC892 Analog", which is the device I'm trying to use -- it's the onboard sound-out on my MoBo.  So is "front", but "front" has "DEV=0" listed, while "default" doesn't (I'm honestly not completely sure how the format of "aplay -L" works -- if someone could explain it, that would be great).  To see if that's relevant, I try specifying speaker-test to use "front".  This time, white noise comes through the speakers, and the following output shows (it keeps going until I CTRL-C it):

speaker-test -Dfront:PCH -c 2

speaker-test 1.0.29

Playback device is front:PCH
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 1048576
Period size range from 32 to 524288
Using max buffer size 1048576
Periods = 4
was set period_size = 262144
was set buffer_size = 1048576
 0 - Front Left
 1 - Front Right
Time per period = 10.929596
 0 - Front Left
 1 - Front Right
Time per period = 9.306849

It seems like "front" is working.  So, apparently ALSA is trying to use the entry "default", which for some reason isn't working.  Okay, now we're getting somewhere!

But now I'm kind of stuck.  I tried to open alsamixer to see if there's an option to change the default, but no luck.  Also, alsamixer seems to list the onboard sound as Device 1, while "aplay -L" lists it as Device 0.  Do the two programs populate from different sources, or something of that nature?  Or am I looking at completely different classification systems?

Based upon googling and Arch Wiki searching, it seems like I may need to mess with .asoundrc or asound.conf (which, so far as I can tell, are basically the ALSA equivalent of xorg.conf).  But according to the alsa-project wiki, neither of those files should be necessary for ALSA to work, so I worry that I may just needlessly complicate things by making them (http://www.alsa-project.org/main/index.php/Asoundrc).

Also, here's the output from cat /etc/modprobe.d/alsa-base.conf and cat /proc/asound/modules.  I'm not entirely clear on how these fit into the system, but I figure they might be helpful.  Also, can anyone explain exactly what these files do?

cat /etc/modprobe.d/alsa-base.conf

options snd slots=snd_hda_intel
options snd_hda_intel index=0
options snd_usb_audio index=3
cat /proc/asound/modules

 0 snd_hda_intel
 1 snd_hda_intel
 2 snd_hda_intel

Thanks very much.

Offline

#2 2015-11-14 08:13:53

schef
Member
Registered: 2009-04-16
Posts: 71

Re: Several misc. ALSA questions (changing the default device?)

You should change

#/etc/modprobe.d/alsa-base.conf
options snd-hda-intel index=1,0

It is because HDMI is the device 0 and PCH is the device 1
look at

[root@sluga]# aplay -l
**** 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: 1/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

Watch out. I used lowercase L.

Offline

Board footer

Powered by FluxBB