You are not logged in.
After setting up Arch and ALSA
aplay /some/sound/file.wav
speaker-testonly output sound if I run them like this
aplay -D default:CARD=PCH /some/sound/file.wav
speaker-test -D default:CARD=PCHIf I try running them without -D i get the following errors:
[root@dlaptop ~]# LANG=C aplay /usr/share/sounds/alsa/Front_Center.wav 
ALSA lib pcm_dmix.c:1024:(snd_pcm_dmix_open) unable to open slave
aplay: main:722: audio open error: No such file or directory[root@dlaptop ~]# LANG=C speaker-test 
speaker-test 1.0.29
Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
ALSA lib pcm_dmix.c:1024:(snd_pcm_dmix_open) unable to open slave
Playback open error: -2,No such file or directoryaplay -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: ALC283 Analog [ALC283 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0aplay -L:
null
    Discard all samples (playback) or generate zero samples (capture)
hdmi:CARD=HDMI,DEV=0
    HDA Intel HDMI, HDMI 0
    HDMI Audio Output
hdmi:CARD=HDMI,DEV=1
    HDA Intel HDMI, HDMI 1
    HDMI Audio Output
hdmi:CARD=HDMI,DEV=2
    HDA Intel HDMI, HDMI 2
    HDMI Audio Output
default:CARD=PCH
    HDA Intel PCH, ALC283 Analog
    Default Audio Device
sysdefault:CARD=PCH
    HDA Intel PCH, ALC283 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    Front speakers
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakerslsmod | grep snd:
snd_hda_codec_hdmi     53248  1
snd_soc_sst_acpi       16384  0
snd_hda_codec_realtek    77824  1
snd_hda_codec_generic    69632  1 snd_hda_codec_realtek
snd_soc_rt5640         86016  0
snd_soc_rl6231         16384  1 snd_soc_rt5640
snd_soc_core          159744  1 snd_soc_rt5640
snd_compress           20480  1 snd_soc_core
snd_pcm_dmaengine      16384  1 snd_soc_core
regmap_i2c             16384  1 snd_soc_rt5640
snd_hda_intel          28672  0
snd_hda_controller     28672  1 snd_hda_intel
snd_hda_codec          98304  5 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel,snd_hda_controller
snd_hda_core           28672  5 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec,snd_hda_controller
snd_hwdep              16384  1 snd_hda_codec
snd_pcm                90112  7 snd_soc_rt5640,snd_soc_core,snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_controller,snd_pcm_dmaengine
snd_timer              28672  1 snd_pcm
snd                    69632  10 snd_hda_codec_realtek,snd_soc_core,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel,snd_compress
soundcore              16384  1 snd
i2c_core               49152  12 drm,i915,i2c_i801,snd_soc_rt5640,i2c_hid,i2c_designware_platform,regmap_i2c,drm_kms_helper,i2c_algo_bit,nvidia,v4l2_common,videodevI'm not running any other sound related programs. The Kernel is the default Linux Kernel of the Arch ISO.
Thanks in advance!
Offline

The CARD=PCH is the difference. Without that, asla is trying to use the HDMI output.
Set card 1 as your default in either ~/.asoundrc or /etc/asound.conf as described in the wiki.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I set the PCH card as default in /etc/asound.conf, but now I'm getting a new error:
/etc/asound.conf:
pcm.!default{
	type hw
	card PCH
}
ctl.!default{
	type hw
	card PCH
}Errors:
[root@dlaptop ~]# LANG=C aplay /usr/share/sounds/alsa/Front_Center.wav 
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: set_params:1239: Channels count non available[root@dlaptop ~]# LANG=C speaker-test 
speaker-test 1.0.29
Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Channels count (1) not available for playbacks: Invalid argument
Setting of hwparams failed: Invalid argumentI tried both commands with the -c option and different channel counts between 1 and 8 but all threw the same error.
Offline

I'm far from an expert on configuring alsa, but I have a very similar setup to yours (where HDMI was the default primary output and both outputs were Intel). I also had some trouble trying to use "card PCM" or other variations in ~/asoundrc. I went with /etc/asound.conf with the following:
defaults.pcm.card 1
defaults.pcm.device 0
defaults.ctl.card 1You may want to give this a shot.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Rather than messing with asound.conf, which is basically guaranteed to screw things up, use the index option for the kernel modules. To set HDMI as the second device, this will do (as root):
echo "options snd-hda-intel index=1" > /etc/modprobe.d/alsa.confExplanation: Now you have HDMI at index 0, making it the default. The above modprobe config will give it index 1 instead, and so the other device will get index 0.
Offline
@ Gusar
Thanks a lot, that fixed it!
Offline

Both devices use snd-hda-intel, don't they?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Both devices use snd-hda-intel, don't they?
Yes. My method relies on HDMI always being initialized first, so the option will always apply to it. Which might not sound robust, but it hasn't failed me yet 
Last edited by Gusar (2015-08-09 01:18:26)
Offline

Ah, thanks - I'll have to give this a shot on my system.  I've always been confused about how to configure things well when multiple devices use the same driver module.
Last edited by Trilby (2015-08-09 01:20:14)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline