HVA
Posts: 11
Joined: Fri Aug 03, 2012 2:28 pm

Aplay issues

Thu Jan 17, 2013 9:25 am

Dear Pi users.

I have an issue with aplay. It was working 3months ago but not anymore.
I use the Debian Wheezy (soft thing).

when I want to test my speaker I get:

pi@raspberrypi:/$ speaker-test -f 440 -t sine

speaker-test 1.0.25

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Sine wave rate is 440.0000Hz
Playback open error: -2,No such file or directory

if I want to play a wav file (which was playing well 3 months ago) i get:

pi@raspberrypi:/$ aplay test.wav
aplay: main:682: audio open error: No such file or directory

I did update the entire thing whit the rpi-update, but it didn't helped

Please help, I need to play a silly wav file!!! By any means!

HVA
Posts: 11
Joined: Fri Aug 03, 2012 2:28 pm

Re: Aplay issues

Thu Jan 17, 2013 11:04 am

Ok,

Fast fix: change the: /etc/asound.conf to:
"
pcm.!default {
type hw
card 0
}

ctl.!default {
type hw
card 0
}
"
Now, to make it even more annoing I try to play sound on Crateive USB Sound Card (the on the list of supportet pheripherals). - it is on a powered HUB.

Changed the asound.config for "card 2", but now I get:

"
pi@raspberrypi:~/cam2bmp$ aplay test.wav
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
aplay: set_params:1087: Channels count non available
"

Please help :)

HVA
Posts: 11
Joined: Fri Aug 03, 2012 2:28 pm

Re: Aplay issues

Thu Jan 17, 2013 4:10 pm

This was also solved by changing the asound.conf to:
"
defaults.ctl.card 0
defaults.pcm.card 0
defaults.pcm.device 0
"

kyelo
Posts: 64
Joined: Sun Oct 23, 2011 6:31 pm

Re: Aplay issues

Thu Jan 17, 2013 5:12 pm

What does "aplay -l" show (with and without) your USB card plugged in?

HVA
Posts: 11
Joined: Fri Aug 03, 2012 2:28 pm

Re: Aplay issues

Fri Jan 18, 2013 4:34 pm

Hi kyelo

With the USB sound card removed it shows:

Code: Select all

pi@raspberrypi:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  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
  Subdevice #7: subdevice #7
and with the USB Sound Card in place it does:

Code: Select all

pi@raspberrypi:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: U0x41e0x30d3 [USB Device 0x41e:0x30d3], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  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
  Subdevice #7: subdevice #7
As you can imagine I an very new to Linux and asound.conf content isn't tell me much. I just copied the content indicated by others trying to fix this issue. Since now is working I thing I was lucky.

Good Luck

kyelo
Posts: 64
Joined: Sun Oct 23, 2011 6:31 pm

Re: Aplay issues

Fri Jan 18, 2013 7:59 pm

O.K., So everything is playing as you want it using your USB audio card?

Great!

kyelo
Posts: 64
Joined: Sun Oct 23, 2011 6:31 pm

Re: Aplay issues

Fri Jan 18, 2013 8:55 pm

I just looked at your changes again, and I am not sure I understand what is happening.

Might you have made any changes to /etc/modprobe,d/alsa-base.conf?

HVA
Posts: 11
Joined: Fri Aug 03, 2012 2:28 pm

Re: Aplay issues

Sat Jan 26, 2013 2:54 pm

Hi Kyelo,

Thank you for trying to investigate this.

Sorry for the late replay, I was away from raspberry for a while.
I don't know sure what modification I have done to that file, I doubt I have opened it.

I have installed the new Raspbian , and tried all things as last time.
Initially Aplay gave an error like : "audio card busy"

I have changed the asound.conf to the three lines I have posted here. No error given but the no sound output at all -- from alsamixer I have increased the playback level at maximum.

in this situation the content of the file you asked about is

Code: Select all

# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7
# Cause optional modules to be loaded above generic modules
install snd /sbin/modprobe --ignore-install snd && { /sbin/modprobe --quiet snd-ioctl32$
install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi && { /sbin/modprobe --q$
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 && { /sbin/modprobe --q$
# Keep snd-pcsp from beeing loaded as first soundcard
options snd-pcsp index=-2
# Keep snd-usb-audio from beeing loaded as first soundcard
options snd-usb-audio index=-2
# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2
Thank you

HVA
Posts: 11
Joined: Fri Aug 03, 2012 2:28 pm

Re: Aplay issues

Mon Jan 28, 2013 5:21 pm

So this is not funny:

when doing: $ alsamixer --card=0
my usb sound card is 0.
it is opening alsa mixer only to say:

Code: Select all

|                    In the midst of the word he was trying to say,                    |
|                      In the midst of his laughter and glee,                          |
|                    He had softly and suddenly vanished away---                       |
|                      For the Snark was a Boojum, you see.                            |
|                                                                                      |
|                    (Lewis Carroll, "The Hunting of the Snark")                       |
|                                                                                      |
|                                                          |                           |
|                           The sound device was unplugged.|                           |
|                        Press F6 to select another sound card.   




I am so disappointed by Raspbian. The old Debian was more friendly, with beginners at least

uxiyon
Posts: 1
Joined: Wed Jul 18, 2018 9:51 pm

Re: Aplay issues

Wed Jul 18, 2018 10:26 pm

HVA wrote:
Thu Jan 17, 2013 4:10 pm
This was also solved by changing the asound.conf to:
"
defaults.ctl.card 0
defaults.pcm.card 0
defaults.pcm.device 0
"
This configuration saved me today. I write about my problem in case this could help someone (not raspberry but still ALSA on Debian):

I'm configuring an Intel NUC with only 2 HDMI outputs - Debian 9 (stretch).
I was able to output sound with mplayer with the option --alsa-device=plughw:0,3 but no sound from firefox, i.e: the default (controler ? pcm ?) was not correct from a system point of vue.
aplay -v gave me the following error message :
aplay: main:788: audio open error: No such file or directory

All I did to fix it is :

Code: Select all

cat <<EOF >/etc/asound.conf
defaults.ctl.card 0
defaults.pcm.card 0
defaults.pcm.device 3
EOF
Here are the output of aplay -l and aplay -L:

Code: Select all

root@doku:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

root@doku:~# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
hdmi:CARD=PCH,DEV=0
    HDA Intel PCH, HDMI 0
    HDMI Audio Output
hdmi:CARD=PCH,DEV=1
    HDA Intel PCH, HDMI 1
    HDMI Audio Output
dmix:CARD=PCH,DEV=3
    HDA Intel PCH, HDMI 0
    Direct sample mixing device
dmix:CARD=PCH,DEV=7
    HDA Intel PCH, HDMI 1
    Direct sample mixing device
dsnoop:CARD=PCH,DEV=3
    HDA Intel PCH, HDMI 0
    Direct sample snooping device
dsnoop:CARD=PCH,DEV=7
    HDA Intel PCH, HDMI 1
    Direct sample snooping device
hw:CARD=PCH,DEV=3
    HDA Intel PCH, HDMI 0
    Direct hardware device without any conversions
hw:CARD=PCH,DEV=7
    HDA Intel PCH, HDMI 1
    Direct hardware device without any conversions
plughw:CARD=PCH,DEV=3
    HDA Intel PCH, HDMI 0
    Hardware device with all software conversions
plughw:CARD=PCH,DEV=7
    HDA Intel PCH, HDMI 1
    Hardware device with all software conversions
Thank you !

Return to “Troubleshooting”