No sound- Adafruit I2S Audio Bonnet for Raspberry Pi

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
kpul
 
Posts: 5
Joined: Tue Jun 28, 2022 3:17 am

No sound- Adafruit I2S Audio Bonnet for Raspberry Pi

Post by kpul »

HI,

I have connected Adafruit I2S Audio Bonnet for Raspberry Pi with my RPI Zero (photo attached)
audio1.jpg
audio1.jpg (518.88 KiB) Viewed 498 times
audio2.jpg
audio2.jpg (660.39 KiB) Viewed 498 times
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')
This is a script output:

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.

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: No sound- Adafruit I2S Audio Bonnet for Raspberry Pi

Post by mikeysklar »

Thank you for the photos and script output.

Which version of Pi OS are you running? Is it Raspian Lite as the guide suggests?
2017-11-2 Raspbian PIXEL ('full') has broken something in volume control. I2S works, but there's no software volume setup, if you need this, try Raspbian Lite - will try to fix as soon as we figure out why :)
Have you launched alsamixer and checked the volume level?

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: No sound- Adafruit I2S Audio Bonnet for Raspberry Pi

Post by mikeysklar »

Thank you for the photos and script output.

Which version of Pi OS are you running? Is it Raspian Lite as the guide suggests?
2017-11-2 Raspbian PIXEL ('full') has broken something in volume control. I2S works, but there's no software volume setup, if you need this, try Raspbian Lite - will try to fix as soon as we figure out why :)
Have you launched alsamixer and checked the volume level?

User avatar
kpul
 
Posts: 5
Joined: Tue Jun 28, 2022 3:17 am

Re: No sound- Adafruit I2S Audio Bonnet for Raspberry Pi

Post by kpul »

Hi Thank you for quick reply.
My OS version is
pi@raspberrypi:~/instinct $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"


I run alsamixer and I see those cards. Is this a correct one?
cards.png
cards.png (58.89 KiB) Viewed 487 times
and those volume controls. I cannot change the volume once the rpi_hifiberry is selected
alsamixer.png
alsamixer.png (34.34 KiB) Viewed 487 times
Is is the right card detected for Adafruit I2S Audio Bonnet?

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: No sound- Adafruit I2S Audio Bonnet for Raspberry Pi

Post by mikeysklar »

The hifi berry is the correct driver / card association. Alsamixer looks good.

Since you are running the current Bullseye which I'm unsure about support on can you go back to the legacy Pi OS Lite release? You can install it on another microSD card if you have one.

Raspberry Pi OS Lite (Legacy)
https://downloads.raspberrypi.org/raspi ... ite.img.xz

User avatar
kpul
 
Posts: 5
Joined: Tue Jun 28, 2022 3:17 am

Re: No sound- Adafruit I2S Audio Bonnet for Raspberry Pi

Post by kpul »

Hi, I have prepared a SD card with this OS version and will give a try. I will let you know if this works here.

User avatar
kpul
 
Posts: 5
Joined: Tue Jun 28, 2022 3:17 am

Re: No sound- Adafruit I2S Audio Bonnet for Raspberry Pi

Post by kpul »

Hi,
I was able to sucessfully tested in on Raspberry Pi OS Lite (Legacy). It works fine. I have tested it on different hardware unit (Raspberry Zero connected with Adafruit I2S Audio Bonnet )

When inserted the same SD card (Raspberry Pi OS Lite, that was working on the hardware as above) to second unit (Raspberry Zero connected with Berry GPS IMU and Adafruit I2S Audio Bonnet om top of it) I cannot get any sound. Configuration is the same (same SD cards) so I assume this is something related to wrong connection between Raspberry and Adafruit I2S Audio Bonnet. I checked the pin configuration and found that my second unit was not connected correctly. Pins 18,16,19 and 21 were not connected.
p1.jpg
p1.jpg (127.07 KiB) Viewed 155 times

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: No sound- Adafruit I2S Audio Bonnet for Raspberry Pi

Post by mikeysklar »

When you remove the GPS unit I take it the second unit works correctly with the i2s bonnet as well?

I just wanted to confirm that the conflict is with the GPS unit and not anything else about the second Pi.

User avatar
kpul
 
Posts: 5
Joined: Tue Jun 28, 2022 3:17 am

Re: No sound- Adafruit I2S Audio Bonnet for Raspberry Pi

Post by kpul »

The problem was that Adafruit was only connected with first 10 pins through the GPS module.
Image from iOS.jpg
Image from iOS.jpg (671.17 KiB) Viewed 146 times
With first unit it was connected directly with all pins
Image from iOS2.jpg
Image from iOS2.jpg (900.29 KiB) Viewed 146 times
What I need to do is to change an order RPI->Adafruit (with all pins) and GPS on top of it with 10 pins

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: No sound- Adafruit I2S Audio Bonnet for Raspberry Pi

Post by mikeysklar »

Thank you for the clarification. Re-ordering the stack makes perfect sense with i2s sandwiched in the middle between the Pi Zero and GPS.

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”