hello - newbie here…
I have an old Pi Zero W & yesterday purchased a 'Audio Amp SHIM (3W Mono Amp) + a 4ohm 3w speaker.
My intention was to learn a little by putting this lot together and getting it to play a single wav/mp3 file (say an engine running for 10 secs)
I have spent hours researching and testing a few packages (even the ones recommended by Pimoroni) 😀
…but can I get a ‘peep’ out of the speaker - no I cant. Tried 32 bit with desktop and headless. command line ‘sudo speaker-test’…all kinds of stuff
Is there a simple ‘dummy’ process anywhere out there ?
It might be a connection issue? The “shim” connections can be a bit finicky some times. If you have a spare female GPIO header kicking around, try plugging that in on top of the shim, just for testing. If it then works you’ll know one or more of the pins isn’t making a good connection.
Did you get any error messages, during install, or in the console?
Thanks, had seen that mentioned a couple of times, will give it a try when I have the strength 😁
err msg :
speaker-test 1.2.8
Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Playback open error: -524,Unknown error 524
ps
Also tried putting a female 40pin header on top of the shim to ‘clamp’ it down - same message 👍
Also, tried a clean (lite) install of 32bit Raspberry OS - followed the advice for Mopidy install (tried both install.sh & ‘manual’ method) then getting various conflicts re python version unable to install the ‘Iris’ add-on…
So, without sounding defeatist I am going to seek an alternative way of outputting a sound for a model boat - I just thought I would try to make use of a couple of ‘Pi’ bits I had lying around, but this is way too complex and time consuming for me to do, for what is essentially a basic task 😊😊
On the Pi side of things I have used the Pirate Audio Speaker, and the Phat Beat. I haven’t touched either one in ages, as far as installs go. They get used, I just haven’t had to start over from scratch in a while. The Pi OS on those Pi’s is a few versions back from the current release.
This may do the trick. It can drive a speaker, plus you could add some lights if you wanted. And no having to install or mess with an OS in the background. Battery friendly too.
Tiny FX W - Wireless LED Effects Controller
I have the (non wireless) kit. I have plans to add it to a model car, I just have to find my round 2it. ;)
Forgot to post this link to older versions of Raspbian. They can come in handy sometimes, especially if installers were written for older versions.
Index of /raspbian/images
Thanks for all your input alphanumeric, I will give an old OS a go and NOT automatically do a sudo update/install 😁
I got the line out version and I’ve been down the same road as you. Or the same dead end street. Have a look at this discussion and maybe you’ll get some clues if you’ve got the courage.
I’m trying to let it go. I’ve wasted too much time on this.
Now we know why it’s called “Pirate” audio. Good luck to you.
Since this is just the amplifier and doesn’t have to involve all the confusing stuff involving the screen, music player, streaming services, and all of that, I think you should be successful just configuring the audio to use the existing Linux driver.
The installation section of the Pirate Audio documentation mentions a few RPi-specific things that are meant to get the driver recognised. I’m not very familiar with the RPi’s config.txt file, but it seems that the idea is to get the computer to load a device tree overlay that then activates the proper driver.
Looking at the mentioned overlay, however, I doubt that it would work: it is given as “hifiberry-dac”, but the only example of this overlay I can find is this one. The codec specified in the file is some TI codec, whereas the Audio Amp SHIM and the Pirate Audio Speaker both use the MAX98357A codec.
Now, I have built a Linux kernel for another kind of single-board computer, specifying the MAX98357A codec in its device tree, and this will load the driver and expose it via ALSA, letting me use alsamixer and other tools. Maybe there is an easier solution for the RPi that just involves a different overlay. Of course, the driver also needs to be available as a kernel module, which may or may not be the case under the RPi flavour of Linux.
Those instructions in the install section for the Pirate Audio Speaker worked for me on a Pi Zero. As I mentioned earlier, it’s on an older version of Pi OS. I built an itty bitty beat box for my grand daughter to play with. I’m not using the LCD.
Build an Itty Bitty Beat Box
With the current version of Pi OS, config.txt has moved. It’s now “boot/firmware/config.txt”. If you edit the file in the old location, it will have no effect. I do believe the overlay sets up i2s?
Pirate Audio Speaker at Raspberry Pi GPIO Pinout
PCM at Raspberry Pi GPIO Pinout
I was just confused about the codec mentioned in the overlay because it doesn’t seem to be the correct one. I have actually deployed the MAX98357A codec driver in Linux on another single-board computer, as well as driven the codec using a driver in a completely different software environment.
But perhaps I have either referenced the wrong overlay and that the instructions achieve the correct result using a different overlay, or maybe the TI codec mentioned in the referenced overlay is compatible. Thinking about it, the MAX98357A doesn’t actually need much setup, and maybe the TI codec is the same, so they could be interchangeable in principle.
The obstacle for many people is, of course, the complexity of troubleshooting the issue in the Linux environment.
£40 !!!
I can order an already configured board from AliExpess for a tenner 🤣