3

The command aplay only works if preceded by sudo. omxplayer test.wav will play the audio I recorded with arecord just fine. aplay text.wav does not, but sudo aplay test.wav does. The suggestions from this previous thread did not solve the issue. HDMI is definitely the default audio output.

The error I get from aplay test.wav:

aplay: main:788: audio open error: No such file or directory

Similar problems with speaker-test. When doing sudo speaker-test it works, but on its own I get:

Playback open error: -2,No such file or directory

aplay --list-devices returns:

**** List of PLAYBACK Hardware Devices ****
 card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
 Subdevices: 7/7
 Subdevice #0: subdevice #0
 Subdevice #1: subdevice #1
 Subdevice #2: subdevice #2
 Subdevice #3: subdevice #3
 Subdevice #4: subdevice #4
 Subdevice #5: subdevice #5
 Subdevice #6: subdevice #6
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
 Subdevices: 1/1
 Subdevice #0: subdevice #0

And ls -l /dev/snd returns

total 0
drwxr-xr-x  2 root root       60 Jul 19 18:22 by-id
drwxr-xr-x  2 root root       80 Jul 19 18:22 by-path
crw-rw----+ 1 root audio 116,  0 Jul 19 18:22 controlC0
crw-rw----+ 1 root audio 116, 32 Jul 19 18:22 controlC1
crw-rw----+ 1 root audio 116, 16 Jul 19 18:22 pcmC0D0p
crw-rw----+ 1 root audio 116, 17 Jul 19 18:22 pcmC0D1p
crw-rw----+ 1 root audio 116, 56 Jul 19 18:22 pcmC1D0c
crw-rw----+ 1 root audio 116,  1 Jul 19 18:22 seq
crw-rw----+ 1 root audio 116, 33 Jul 19 18:22 timer
relientkc
  • 31
  • 1
  • 5

2 Answers2

3

Check if your user included in the audio group. This might be necessary for aplay to run. If not, you can add the user to the group by running:

sudo adduser "yourname" audio
Aurora0001
  • 6,308
  • 3
  • 23
  • 38
0

Try to setup audio output device like described in https://www.raspberrypi.org/documentation/configuration/audio-config.md

I had the same issue, after update of rpi there was no sound anymore (HDMI in my case) - so nothing from aplay, chromium, etc running as pi user, but it works fine as root (or under sudo).

User pi was initially (and still is) in audio group.

This 2 things helped to solve that for me:

rm .asoundrc; # no idea why it has also bothered sound output on my side

sudo raspi-config

select "System Options" -> "Audio" -> and choose the audio output ("HDMI 1" in my case), then "Finish".

sebres
  • 101
  • 1