0

Adafruit Speaker Bonnet for Raspberry Pi
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit Speaker Bonnet for Raspberry Pi

by kcerb on Thu Dec 27, 2018 3:05 am

Hello!

It seems that the pi lost my "soundcard" somehow:

Code: Select all | TOGGLE FULL SIZE
$ cat /proc/asound/cards
--- no soundcards ---
$ aplay -l
aplay: device_list:270: no soundcards found...


This is especially strange considering:

1. I had no trouble whatsoever with the original setup and install. I was listening to music, programming, and generally enjoying my Christmas morning. Then it came time for dinner so I shut down the pi and unplugged it. When I came back and plugged it back in things weren't working. I eventually figured out that alsa doesn't even see the bonnet's sound card!

2. I've searched all over the forums, threads, blog posts, stack exchange, everything I can find! I've seen lots and lots of ways that this stuff can fail and have ruled them all out. For example, power supply issues? Not here, I'm using a real power supply (MeanWell, RS-25-5) and I adjusted the voltage up to the 5.1-5.2 range. Soldering issues? Nope, the new bonnet comes with a plug-in style attachment to the board.

I'm at the point now where I'm thinking to just completely start from scratch and make a new SD card image, but I really don't want to, because this all happened once before! I had sound working, lost it out of the blue: "no soundcards"; flashed a new drive, that solved all of my problems until now.

The only variable I see is that the first time I went through this I was using the original Raspbian (Jessie) that the pi came with when I got it in 2016 and the new image is the latest (Stretch) so maybe I need to go back a major OS version?

kcerb
 
Posts: 7
Joined: Tue Oct 30, 2018 9:40 am

Re: Adafruit Speaker Bonnet for Raspberry Pi

by kcerb on Sat Dec 29, 2018 7:16 am

Update: I fixed it, but it this solution feels adjacent to the right solution.

Here's a stackexchange thread on this question (bounty of 50 points available):
https://raspberrypi.stackexchange.com/q ... iberry-dac

Basically it seems like enabling SPI for my neopixel lights killed my sound, not immediately, and not even after 4 or 5 reboots, but a day or two later after something like 10.

I commented out the spi dtoverlay line from my /boot/config.txt and the sound + lights is working! But why? Am I killing SPI and potentially wrecking something else? Is it just order dependent and I should put my dtoverlay lines for the speakers after the spi one?

Hopefully this thread can be helpful to others who need both SPI and these speakers.

kcerb
 
Posts: 7
Joined: Tue Oct 30, 2018 9:40 am

Re: Adafruit Speaker Bonnet for Raspberry Pi

by adafruit_support_carter on Fri Jan 04, 2019 3:51 pm

I commented out the spi dtoverlay line from my /boot/config.txt and the sound + lights is working!

What exactly was this line?

adafruit_support_carter
 
Posts: 8560
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit Speaker Bonnet for Raspberry Pi

by kcerb on Mon Jan 07, 2019 2:53 pm

Here are the last three lines as I have them in my working configuration. Everything before them seems to have come with the NOOBS install

Code: Select all | TOGGLE FULL SIZE
dtoverlay=hifiberry-dac
dtoverlay=i2s-mmap
#dtoverlay=spi1-3cs

kcerb
 
Posts: 7
Joined: Tue Oct 30, 2018 9:40 am

Re: Adafruit Speaker Bonnet for Raspberry Pi

by adafruit_support_carter on Mon Jan 07, 2019 3:26 pm

There's a pin conflict between the SPI1 and the I2S pins. GPIO pin 35 is SPI1 MISO and also I2S LRCLK. So it makes sense that these two overlays would conflict. It's weird that it didn't happen right away though.

adafruit_support_carter
 
Posts: 8560
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit Speaker Bonnet for Raspberry Pi

by kcerb on Tue Jan 08, 2019 2:08 am

OK, great thanks for answering that for me!

What does this mean for a project using neopixels and the speaker bonnet? Neither use #35 to my knowledge and the pixels seem to be working fine, so is it safe to say that removing the SPI1 overlay like this is an acceptable solution? Of course, any other circuit python project that needs SPI1 will not work in conjuction with the pixels and the speakers, but at the moment I don't have any other additions to this project planned.

kcerb
 
Posts: 7
Joined: Tue Oct 30, 2018 9:40 am

Re: Adafruit Speaker Bonnet for Raspberry Pi

by adafruit_support_carter on Tue Jan 08, 2019 12:00 pm

Here's the pin in question:
gpio.jpg
gpio.jpg (38.58 KiB) Viewed 70 times

It's not labeled in that image, but it is also I2S LRCLK. For example, see the wiring here:
https://learn.adafruit.com/adafruit-i2s ... -pi-wiring
So the pin can only be one of these at a time. For I2S audio, it is the only option. If you want I2S audio, you have to use that pin. Similarly for SPI1, but note that there is another SPI bus on the GPIO header on 19/21/23 - this is the one typically used. So you could still have SPI and I2S audio by using that SPI bus.

How are you currently attaching and controlling the NeoPixels?

adafruit_support_carter
 
Posts: 8560
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit Speaker Bonnet for Raspberry Pi

by kcerb on Mon Jan 14, 2019 1:15 pm

Sorry for the slow reply! My project is currently a nightlight in my kid's room, so every time I thought to go double check the GPIO number they were asleep :)


So I'm using the design from the first picture in this guide: https://learn.adafruit.com/neopixels-on ... -pi-wiring (with level-shifting chip).

I have a 5A 5V power supply (this thing https://www.google.com/search?q=meanwel ... e&ie=UTF-8) and I run it in parallel to the pi via a micro usb that I split, and to a little breadboard that has the level shifter.


Instead of GPIO18 I use GPIO12, but everything else is the same as the guide. I have 2 sets of 8 neopixels in series (NeoPixel Stick - 8 x 5050 RGBW LEDs - Cool White - ~6000K PID: 2869).

And of course the bonnet is just plugged directly in as expected.

Here's a shot of the nightlight with the cover off:

https://photos.app.goo.gl/7cJqSMMpnc8CYSrF8

kcerb
 
Posts: 7
Joined: Tue Oct 30, 2018 9:40 am

Re: Adafruit Speaker Bonnet for Raspberry Pi

by adafruit_support_carter on Mon Jan 14, 2019 1:25 pm

Cool nightlight! This all looks fine. What made you enable the second SPI port in the first place?

adafruit_support_carter
 
Posts: 8560
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.