You are not logged in.

#1 2016-08-27 21:40:26

jasonlu710
Member
Registered: 2016-08-27
Posts: 3

'aplay' doesn't work, but 'sudo aplay' and 'aplay -D sysdefault' do

Hi, I've been trying to get my sound to work on a new Arch installation. I've added my user to the 'audio' group, but sound still doesn't work.


Here are the outputs of some commands I've tested:

$ aplay /usr/share/sounds/Front_Center.wav
aplay: main:786: audio open error: No such file or directory

$ sudo 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 -D sysdefault  /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 -L
null
    Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=PCH
    HDA Intel PCH, ALC3232 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC3232 Analog
    Front speakers
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, ALC3232 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC3232 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC3232 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC3232 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC3232 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC3232 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
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

Does anyone know how I could fix this?

Offline

#2 2016-08-27 21:51:48

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: 'aplay' doesn't work, but 'sudo aplay' and 'aplay -D sysdefault' do

Do you have an ~/.asoundrc?  If so, what is in it?

Is there a /root/.asoundrc?  If so, what is in it?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2016-08-27 21:54:11

jasonlu710
Member
Registered: 2016-08-27
Posts: 3

Re: 'aplay' doesn't work, but 'sudo aplay' and 'aplay -D sysdefault' do

~/.asoundrc:

pcm.!default {
	type hw
	card 1
}

ctl.!default {
        type hw
        card 0
}

I don't have a /root/.asoundrc

Offline

#4 2016-08-27 22:10:13

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: 'aplay' doesn't work, but 'sudo aplay' and 'aplay -D sysdefault' do

Try removing the ~/.asoundrc


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2016-08-27 22:27:12

jasonlu710
Member
Registered: 2016-08-27
Posts: 3

Re: 'aplay' doesn't work, but 'sudo aplay' and 'aplay -D sysdefault' do

That worked. Thanks!

Offline

#6 2016-08-27 23:21:02

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: 'aplay' doesn't work, but 'sudo aplay' and 'aplay -D sysdefault' do

I'm not an expert on alsa configuration (we have a few around here who might chime in) but I'm pretty sure that asoundrc sets the default output to the HDMI device while keeping the controls (e.g. alsamixer) controlling the internal speakers.  It's very odd to have pcm.default and ctl.default pointing at different hardware.

If you do every need to use the HDMI audio, you'd just set both the pcm and ctl to card 1.  There are more elaborate ways to switch between outputs, but just switching in/out different ~/.asoundrc versions as needed works well for me.  If you never really use the HDMI sound, just get rid of the file all together.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB