1

Pi B+ & AMP+ Audio playing with mplayer, not with Python Pygame

Hi guys...

Got the Amp+ to work on 5/5/2015 Fresh Raspbian.

A sample MP3 is playing with success with "mplayer" in the Speakers.

Now that i know the Pi and AMP+ are working together, i went back to my project ("Music on hold" audio player)

This project is coded in Python using Pygame as an Audio Module.

When i started the Python App (that was working properly with the Pi standard 3.5mm audio connector prior to the AMP+ Install)

The Python app react properly on screen, but faint static is heard in the Speakers.

When i Kill the Python App, the Static stops.

Here is the result of aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_amp], device 0: HifiBerry AMP HiFi tas5713-hifi-0 []
Subdevices: 0/1
Subdevice #0: subdevice #0

The (simplified) python code is:

import pygame
pygame.mixer.init()
pygame.mixer.music.load("123.mp3")
pygame.mixer.music.play()
**Loop while playing**
pygame.mixer.stop()
pygame.mixer.quit()

I have a visual progress bar that follows the playback speed, but only faint static is heard in the speaker.

The Python App would not run until i deleted the /etc/asound.conf
It was complaining it was old or currupted (deleted it and rebooted)

Any ideas?

Thanks

NJ




8 comments

Please sign in to leave a comment.