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.binCode: 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?)
Thanx in advance..