2

When the pulseaudio daemon is not running, I can use aplay to send sound to the speakers with

aplay -Dhw:1,0 sample.wav

alsamixer seems to do what I expect with controlling the volume on the card when I play as above; in particular master and front channels affect the volume of the sample played with above.

When I do aplay -L it lists a number of PCMs. When I select one of these PCMs for aplay, there is no sound at all. If pulseaudio is running, the aplay fails silently. If pulseaudio is not running, it fails with an error 2, unable to open file.

Most sound apps don't seem to allow low level specification of the sound hardware, so I can't get any sound at all except through aplay. I believe the problem is that the higher level PCM names are not getting mapped correctly to hardware devices.

I'll note that an older kernel with no pulseaudio had no sound problems on this machine.

These produce no sound:

aplay -Dfront sample.wav
aplay -Dpulse sample.wav

aplay -L output:

null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
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, 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

aplay -l output

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: ALC892 Analog [ALC892 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
  • 1
    If you can play sound directly to the hw, Pulseaudio is not running (or couldn't grab this device for explusive use), so playing to pulse can't work. – dirkt Apr 9 '17 at 8:40
  • @dirkt - You are right-- I added more details to the question – antlersoft Apr 9 '17 at 13:28
  • For pulseaudio, start pavucontrol and make sure your stream is going to the right output (not HDMI). Also, use paplay instead of aplay to remove complexity (and sources of errors). Without pulseaudio, have you tested aplay -D front:CARD=PCH,DEV=0 as suggested? I never understood ALSA device name matching completely, but possibly front alone can match something else. – dirkt Apr 9 '17 at 15:22
0

You have to use the full device name to select the correct card:

aplay -D front:CARD=PCH,DEV=0 sample.wav

To change the default card, add something like this to the global /etc/asound.conf or to your ~/.asoundrc:

defaults.ctl.card "PCH"
defaults.pcm.card "PCH"

To make PulseAudio use the correct card, you have to configure it (try pavucontrol).

0

The answer for me was that Pulseaudio was either misinterpreting udev or udev was handing it the wrong configuration-- I don't know enough about either to decide the question. If I change the Pulse audio default.pa to explicitly set the hardware configuration instead of getting it from udev, it works.

In default.pa, I had to uncomment these two lines:

load-module module-alsa-sink device=hw:1,0
load-module module-alsa-source device=hw:1,0

and comment these lines:

### Automatically load driver modules depending on the hardware available
#.ifexists module-udev-detect.so
#load-module module-udev-detect
#.else
### Use the static hardware detection module (for systems that lack udev support)
#load-module module-detect
#.endif

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.