You are not logged in.

#1 2017-08-07 09:57:56

Ploppz
Member
Registered: 2013-09-14
Posts: 313

[solved] Alsa: how to set default soundcard?

I am having problems with sound playback because the default soundcard is set to HDMI (index 0), while it should be index 1.

Some listings:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 11: HDMI 5 [HDMI 5]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 1: ALC892 Digital [ALC892 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0


$ cat /proc/asound/cards
 0 [HDMI           ]: HDA-Intel - HDA ATI HDMI
                      HDA ATI HDMI at 0xfe960000 irq 49
 1 [Generic        ]: HDA-Intel - HD-Audio Generic
                      HD-Audio Generic at 0xfe800000 irq 51

I tried the wiki solution, but the two modules have the same name so I don't know how I can do it:

$ cat /proc/asound/modules
 0 snd_hda_intel
 1 snd_hda_intel

I also tried this exact asoundrc but it made no difference.

Last edited by Ploppz (2017-08-07 19:04:53)

Offline

#2 2017-08-07 10:47:55

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [solved] Alsa: how to set default soundcard?

Did you try the alternative method?

Although I think the asoundrc you linked should have worked. Did you remember that you must restart any application that uses ALSA, in order for it to start using the new asoundrc?

If you are using ATI/AMD graphics card with radeon driver, it is also possible to simply disable the HDMI audio: https://wiki.archlinux.org/index.php/ATI#HDMI_audio

Offline

#3 2017-08-07 11:15:01

cirrus
Member
From: Glasgow Scotland
Registered: 2012-08-24
Posts: 341
Website

Re: [solved] Alsa: how to set default soundcard?

you can also try creating an /etc/modprobe.d/alsa-base.conf
in it put this one line

options snd slots=snd-hda-intel,snd-usb-audio

after reboot
this will ensure snd-hda-intel always gets first slot, and snd-usb-audio next.

Last edited by cirrus (2017-08-07 11:16:26)

Offline

#4 2017-08-07 11:26:03

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [solved] Alsa: how to set default soundcard?

@cirrus, how would that work?

There's no card using snd-usb-audio, and as mentioned by OP, both cards are using the same module.

Offline

#5 2017-08-07 12:51:29

orrin5250
Member
Registered: 2016-10-12
Posts: 39

Re: [solved] Alsa: how to set default soundcard?

I hope I am not overstepping as I am only an Arch beginner.  But I noticed your post and had the same issue yesterday.

I found this post and it worked like a charm for me.

I can't seem to create a link to the specific post but look at #15.  I placed the code in /etc/asound.conf.

Offline

#6 2017-08-07 13:46:53

Ploppz
Member
Registered: 2013-09-14
Posts: 313

Re: [solved] Alsa: how to set default soundcard?

The alternativ method worked! Although it warns against using `type hw`, I don't think it will be a problem for me (?).

Edit

I'm having a problem starting MPD that seems to be related to Alsa..

Aug 07 15:44:57 nadir mpd[15056]: ALSA lib pcm_dmix.c:1099:(snd_pcm_dmix_open) unable to open slave
Aug 07 15:44:57 nadir mpd[15056]: alsa_output: Error opening default ALSA device: No such file or directory
Aug 07 15:44:57 nadir mpd[15056]: output: Attempting to detect a oss audio device
Aug 07 15:44:57 nadir mpd[15056]: oss_output: Error opening OSS device "/dev/dsp": No such file or directory
Aug 07 15:44:57 nadir mpd[15056]: oss_output: Error opening OSS device "/dev/sound/dsp": No such file or directory
Aug 07 15:44:57 nadir mpd[15056]: output: Attempting to detect a pulse audio device
Aug 07 15:46:27 nadir systemd[1]: mpd.service: Start operation timed out. Terminating.
Aug 07 15:46:27 nadir systemd[1]: Failed to start Music Player Daemon.
Aug 07 15:46:27 nadir systemd[1]: mpd.service: Unit entered failed state.
Aug 07 15:46:27 nadir systemd[1]: mpd.service: Failed with result 'timeout'.

This is my current .asoundrc:

pcm.!default {
    type hw
    card 1
}

ctl.!default {
    type hw
    card 1
}

Last edited by Ploppz (2017-08-07 14:01:25)

Offline

#7 2017-08-07 15:29:18

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,536

Re: [solved] Alsa: how to set default soundcard?

Does nobody follow links on wiki pages ?

create

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

options snd-hda-intel index=1,0

For details check [2] in the Select sound card section .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#8 2017-08-07 19:04:44

Ploppz
Member
Registered: 2013-09-14
Posts: 313

Re: [solved] Alsa: how to set default soundcard?

Thanks, it now works!

Offline

Board footer

Powered by FluxBB