User avatar
Deepak J
Posts: 11
Joined: Wed Apr 16, 2014 7:04 am

No audio output

Wed Sep 10, 2014 11:06 am

Hi,
I've been trying to play some music(mp3 and wav) in my pi, but end up getting some errors.So I did some troubleshooting myself referring the net but still couldn't get the pi to play the music. I'm trying to play through the analog audio port.
I got an output in the analog port using the following code given in elinux:

Code: Select all

cd /opt/vc/src/hello_pi/
./rebuild.sh
cd hello_audio

./hello_audio.bin
The following are the outputs of some of the commands that i came across:

Code: Select all


pi@raspberrypi ~ $ cat /proc/asound/cards
 0 [ALSA           ]: bcm2835 - bcm2835 ALSA
                      bcm2835 ALSA

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
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

pi@raspberrypi ~ $ sudo aplay /usr/share/sounds/alsa/Front_Center.wav
ALSA lib pcm_hw.c:1401:(_snd_pcm_hw_open) Invalid value for card
aplay: main:682: audio open error: No such file or directory

pi@raspberrypi ~ $ sudo mpg321 abc.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2, and 3.
Version 0.3.2-1 (2012/03/25). Written and copyrights by Joe Drew,
now maintained by Nanakos Chrysostomos and others.
Uses code from various people. See 'README' for more!
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
Playing MPEG stream from abc.mp3 ...
MPEG 1.0 layer III, 128 kbit/s, 44100 Hz stereo
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm_hw.c:1401:(_snd_pcm_hw_open) Invalid value for card
Can't find a suitable libao driver. (Is device in use?)
Any help would be greatly appreciated.. :) I only require the audio out of the analog port and wouldn't mind if there is no audio output through the HDMI port..
Thanx in advance.. :D
Quit, don't quit? Noodles, don't noodles? You are too concerned about what was and what will be. There is a saying: yesterday is history, tomorrow is a mystery, but today is a gift. That is why it is called the "present."
- Master Oogway

User avatar
joan
Posts: 14960
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: No audio output

Wed Sep 10, 2014 12:37 pm

Have you tried

amixer cset numid=3 1

which is meant to force the Aux socket rather than HDMI.

User avatar
Deepak J
Posts: 11
Joined: Wed Apr 16, 2014 7:04 am

Re: No audio output

Wed Sep 10, 2014 5:10 pm

joan wrote:Have you tried

amixer cset numid=3 1

which is meant to force the Aux socket rather than HDMI.
Yep I tried that with the following output:

Code: Select all

pi@raspberrypi ~ $ sudo amixer cset numid=3 1
numid=3,iface=MIXER,name='PCM Playback Route'
  ; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0
  : values=1
But when I tried to play the mp3 got the above errors...
Quit, don't quit? Noodles, don't noodles? You are too concerned about what was and what will be. There is a saying: yesterday is history, tomorrow is a mystery, but today is a gift. That is why it is called the "present."
- Master Oogway

User avatar
Deepak J
Posts: 11
Joined: Wed Apr 16, 2014 7:04 am

Re: No audio output

Wed Sep 10, 2014 5:47 pm

Ohkk i managed to play mp3 files after executing the following commands using mpg321 and also using cvlc

Code: Select all

sudo modprobe snd_pcm_oss
sudo modprobe snd_mixer_oss
I can play wav files using cvlc but then the cvlc program doesn't terminate itself after the audio is played.

In the graphical way vlc plays both .mp3 and .wav properly but while playing wav files it outputs an error
"No audio device"
Quit, don't quit? Noodles, don't noodles? You are too concerned about what was and what will be. There is a saying: yesterday is history, tomorrow is a mystery, but today is a gift. That is why it is called the "present."
- Master Oogway

Return to “Troubleshooting”