I have connected Adafruit I2S Audio Bonnet for Raspberry Pi with my RPI Zero (photo attached) and run this script curl -sS https://raw.githubusercontent.com/adafr ... /i2samp.sh | bash
Script seems to be executed correctly. I have also checked all configuration files manually. Unfortunattly I do not hear any sound using speaker-test -c2 and using pygame from my python. Using my headphones I only hear "quiet noisy crackles".
What else should I check? Thank you in advance for help!
Code: Select all
from pygame import mixer
def play_audio(audio):
audio_file ='/home/pi/project/sounds/'+audio+'.mp3'
mixer.init()
mixer.music.load(audio_file)
mixer.music.set_volume(0.7)
mixer.music.play()
print ('Start')
play_audio('tracker_starting')
print ('Stop')
Code: Select all
Support for your operating system is experimental. Please visit
forums.adafruit.com if you experience issues with this product.
This script will install everything needed to use
i2s amplifier
--- Warning ---
Always be careful when running scripts and commands
copied from the internet. Ensure they are from a
trusted source.
If you want to see what this script does before
running it, you should run:
\curl -sS github.com/adafruit/Raspberry-Pi-Installer-Scripts/i2samp
Do you wish to continue? [y/N] y
Checking hardware requirements...
Adding Device Tree Entry to /boot/config.txt
dtoverlay already active
i2s mmap dtoverlay already active
Commenting out Blacklist entry in
/etc/modprobe.d/raspi-blacklist.conf
Default sound driver currently not loaded
Configuring sound output
Installing aplay systemd unit
Removed /etc/systemd/system/multi-user.target.wants/aplay.service.
You can optionally activate '/dev/zero' playback in
the background at boot. This will remove all
popping/clicking but does use some processor time.
Activate '/dev/zero' playback in background? [RECOMMENDED] [y/N] y
Created symlink /etc/systemd/system/multi-user.target.wants/aplay.service → /etc/systemd/system/aplay.service.
We can now test your i2s amplifier
Set your speakers at a low volume if possible!
Do you wish to test your system now? [y/N] y
Testing...
speaker-test 1.2.4
Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 96 to 1048576
Period size range from 32 to 349526
Using max buffer size 1048576
Periods = 4
was set period_size = 262144
was set buffer_size = 1048576
0 - Front Left
1 - Front Right
Time per period = 4.721727
0 - Front Left
1 - Front Right
Time per period = 4.738282
0 - Front Left
1 - Front Right
Time per period = 4.669380
0 - Front Left
1 - Front Right
Time per period = 4.642552
0 - Front Left
1 - Front Right
Time per period = 4.682734
All done!
Enjoy your new i2s amplifier!
Some changes made to your system require
your computer to reboot to take effect.