User avatar
OutoftheBOTS
Posts: 711
Joined: Tue Aug 01, 2017 10:06 am

understanding sound and amps

Sat Sep 02, 2017 7:41 am

Ok I am trying to learn about sound.

I understand what I2S protocol is and see a number of DAC boards for sale on ebay http://www.ebay.com.au/itm/SA9227-PCM51 ... ird3bbX5BQ

Now I understand the digital I2S needs to be converted to analog (DAC) but also I will need an amp that matches my speaker.

First there is little info on these boards how do I work out if they have an amp or if they r just a DAC
Second how do I go about matching the amp to the needed speaker ??

alphanumeric
Posts: 2566
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: understanding sound and amps

Sat Sep 02, 2017 11:52 am

If you see something like "Line out stereo jack" in the description, it needs an external AMP to drive speakers. Headphones/earbuds will work directly but speakers won't. Like this one for example, https://shop.pimoroni.com/products/phat-dac
The ones that already have an amp to drive speakers usually say so, like this one, https://shop.pimoroni.com/products/phat-beat "•3W per channel" Some times you'll have to go look up the specs for the DAC used, the MAX98357A has an Output Power: 3.2W at 4Ω, 10% THD, 1.8W at 8Ω, 10% THD, with 5V supply. Watch out for the ones that are only single channel/mono. There are some that will only drive one speaker.

User avatar
OutoftheBOTS
Posts: 711
Joined: Tue Aug 01, 2017 10:06 am

Re: understanding sound and amps

Sat Sep 02, 2017 12:21 pm

So most of the I2S DACs don't seem to have an amp with them it only seems to be the MAX98357A that is both a DAC and amp all in 1 then.

So something like this will be good for most small stereo speakers http://www.ebay.com.au/itm/2PCS-PAM8403 ... 2383536755

but at 3w by 2 channels for stereo it would push the RPi 5v pin to its limit to power it??

alphanumeric
Posts: 2566
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: understanding sound and amps

Sat Sep 02, 2017 12:57 pm

I'm using this in one of my builds, https://www.adafruit.com/product/987 It has its own separate powered feed though. I use a beefy 5V 10A power supply with that build. It's overkill, the 4A version would have likely been more than enough. I breadboard circuits etc on it and wanted lots of head room.
I also run a pHat Beat in an Internet radio build. No issues running it and my Pi Zero from the one 2.5A official Pi power supply. I haven't cranked the volume up more than half way though. Haven't had the need, more than enough sound for my listening pleasure at 1/4 or 1/3 volume. The pHat Beat is a nice bit of kit. 3W per channel, build in VU meter. Connects via GPIO. Nice speaker connectors.

User avatar
Burngate
Posts: 6313
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: understanding sound and amps

Sat Sep 02, 2017 4:45 pm

OutoftheBOTS wrote:
Sat Sep 02, 2017 7:41 am
Second how do I go about matching the amp to the needed speaker ??
Which speaker?
I'm going to assume a passive speaker, because active ones (what most people buy these days) have a built-in amp and some sort of power supply.

So there are two figures you need to know - its impedance - resistance, close enough - and maximum power.
With those two, you can work out what voltage and current the amp must supply, which in turn gives you the specs for whatever's supplying power.
And if you know the voltage output of the source of the audio signal - for example, 1v p-p, which is what comes out of the jack on the Pi - then you can work out the gain needed for the amp.

So all you need to do is find an amp that will drive that speaker from that source with that power supply.

alphanumeric
Posts: 2566
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: understanding sound and amps

Sat Sep 02, 2017 6:57 pm

I've heard it said that the audio signal that comes out of the Pi's audio jack isn't the best quality. And that using a DAC via GPIO gives much better quality sound. Higher bit rate etc. Add keep in mind that the Pi Zero doesn't even have an analog audio out jack.

User avatar
OutoftheBOTS
Posts: 711
Joined: Tue Aug 01, 2017 10:06 am

Re: understanding sound and amps

Sat Sep 02, 2017 7:20 pm

I've heard it said that the audio signal that comes out of the Pi's audio jack isn't the best quality. And that using a DAC via GPIO gives much better quality sound. Higher bit rate etc. Add keep in mind that the Pi Zero doesn't even have an analog audio out jack.
Ok this is a bit of the issue that I want to understand.

What the difference between the audio jack and the I2S quality??

I do understand that the aufio jack is an analog signal and the I2S is a digital signal so digital is better for transfer from device tp device

alphanumeric
Posts: 2566
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: understanding sound and amps

Sat Sep 02, 2017 7:30 pm

Search found this, hope it helps, viewtopic.php?t=59823&p=447210

User avatar
Imperf3kt
Posts: 3677
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: understanding sound and amps

Sun Sep 03, 2017 10:04 pm

OutoftheBOTS wrote:
Sat Sep 02, 2017 12:21 pm
So most of the I2S DACs don't seem to have an amp with them it only seems to be the MAX98357A that is both a DAC and amp all in 1 then.

So something like this will be good for most small stereo speakers http://www.ebay.com.au/itm/2PCS-PAM8403 ... 2383536755

but at 3w by 2 channels for stereo it would push the RPi 5v pin to its limit to power it??
I have one of those.
They are 1.2A - fine for the 5v pin if nothing else is connected.
I(A) = P(W) / V(V)
3w +3w = 6w/5v=1.2A

I do not suggest buying one though, I experience highly unstable power when powering mine through the 5v pin and testing it extensively, found its specs to be a bunch of lies.

On one of my power supplies, it draws 5.4v somehow, despite the power supply only being rated for 5v, 2A
55:55:44:44:4C
52:4C:52:42:41

User avatar
davidcoton
Posts: 5084
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: understanding sound and amps

Sun Sep 03, 2017 10:38 pm

Imperf3kt wrote:
Sun Sep 03, 2017 10:04 pm
On one of my power supplies, it draws 5.4v somehow, despite the power supply only being rated for 5v, 2A
It does not "draw" 5.4V. The voltage is what the PSU delivers into that load. If a 5V nominal PSU delivers 5.4V, that is an issue (and probably a problem) with the PSU, or with your meter.
The amp (amplifier) will draw a current, measured in Amps (Amperes). At a supply voltage of 5V, while delivering a maximum volume signal into a suitable load, and assuming 100% efficiency (not practical!), you can expect it to draw 1.2A.
With a 5V supply, it will be unusual to get 3W into an 8Ω. (The RMS voltage needs to be almost 5V at the speaker, so the supply needs to be >14V).
Note that speaker/amplifier power ratings are as bad as powerbank capacity specs -- there are ways of deriving power figures ("music power") that exceed the normally expected RMS power figure by a large margin.
Signature retired

User avatar
OutoftheBOTS
Posts: 711
Joined: Tue Aug 01, 2017 10:06 am

Re: understanding sound and amps

Mon Sep 04, 2017 6:44 am

OMG manufactures lying about their specs, NOOOOOOO that would never happen :)

So at the end of the day the RPi is going to struggle to provide enough Watts in the first place then due to inefficiency in the amp but also it unlikely to provide enough power at 5v for a 8ohm speacker.

Does anyone know how many ohms the AIY speaker was and what was the specs for the amp in the AIY hat as it got the job done for basic speak sound.

alphanumeric
Posts: 2566
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: understanding sound and amps

Mon Sep 04, 2017 9:29 am

OutoftheBOTS wrote:
Mon Sep 04, 2017 6:44 am
OMG manufactures lying about their specs, NOOOOOOO that would never happen :)

So at the end of the day the RPi is going to struggle to provide enough Watts in the first place then due to inefficiency in the amp but also it unlikely to provide enough power at 5v for a 8ohm speacker.

Does anyone know how many ohms the AIY speaker was and what was the specs for the amp in the AIY hat as it got the job done for basic speak sound.
Only if you run it at full volume. How often are you going to do that? If you're running at 1/2 or 1/4 of full volume your only putting out 1/2 or 1/4 of that full 3 Watts. And drawing less current. I hardly ever come close to going to half volume. Only when I'm showing it off, etc. Most of the time I'm down around 1/4 volume or so. If your anting lots of watts maybe look at something like this, https://shop.pimoroni.com/products/pi-digiamp It has its own power supply input.

hippy
Posts: 7911
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: understanding sound and amps

Mon Sep 04, 2017 10:52 am

alphanumeric wrote:
Sat Sep 02, 2017 6:57 pm
I've heard it said that the audio signal that comes out of the Pi's audio jack isn't the best quality.
That is almost certainly correct; it won't be as high quality as a digital stream fed to something which can deliver better analogue out than a Pi can.

But when I fed the analogue output of my Pi 3B into my Hi-Fi it sounded absolutely fine to me, far better than I was led to expect from how others had described it.

To me it's not what's best but what's acceptable. I would suggest trying it because no one other than you is able to say if you will find it acceptable or not.

If using small 'transistor radio speakers' such as used with the AIY I would imagine Pi analogue would be good enough, no need to make that a digital system, and it would be a pointless and costly exercise to do that.

To avoid worrying over amps and speakers I would personally just get a set of powered desktop PC speakers and take the analogue out of the Pi.

alphanumeric
Posts: 2566
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: understanding sound and amps

Mon Sep 04, 2017 11:22 am

hippy wrote:
Mon Sep 04, 2017 10:52 am
alphanumeric wrote:
Sat Sep 02, 2017 6:57 pm
I've heard it said that the audio signal that comes out of the Pi's audio jack isn't the best quality.
That is almost certainly correct; it won't be as high quality as a digital stream fed to something which can deliver better analogue out than a Pi can.

But when I fed the analogue output of my Pi 3B into my Hi-Fi it sounded absolutely fine to me, far better than I was led to expect from how others had described it.

To me it's not what's best but what's acceptable. I would suggest trying it because no one other than you is able to say if you will find it acceptable or not.

If using small 'transistor radio speakers' such as used with the AIY I would imagine Pi analogue would be good enough, no need to make that a digital system, and it would be a pointless and costly exercise to do that.

To avoid worrying over amps and speakers I would personally just get a set of powered desktop PC speakers and take the analogue out of the Pi.
I have an external amp fed by a Pi 3B's analog out. Mini laptop like speakers. Sounds "OK" to me. I hardly ever listen to music on that Pi though. More YouTube videos etc. Pi foundation 7 inch touch screen and I wanted sound of some type available (in case I needed it) without tying up and GPIO pins. I breadboard stuff on that Pi and have a GPIO ribbon cable with breakout board attached.

Somebody I know offered me a pHat Beat at a good price so I bought it. Then mated it to a Pi Zero. The Zero doesn't have any analog audio out so its a good match. Then setup an internet radio. I listen to music on that Pi quit a lot. I used an old set of Logitech R20 speakers. The electronics were dead so I removed everything except the speakers and hooked them up to the pHat Beat. I just taped over the holes where the on/off switch and volume used to be. I put the pHat Beat in the subwoofer box. Didn't use the subwoofer, just the case it was in.

My KODI Pi feeds sound to my TV via the HDMI. External speakers would likely be better but as you say, it sounds perfectly fine for my ears. ;)

Anyway, lots of options, only limited by your imagination and budget, lol.

User avatar
OutoftheBOTS
Posts: 711
Joined: Tue Aug 01, 2017 10:06 am

Re: understanding sound and amps

Mon Sep 04, 2017 12:33 pm

That's it. lots of options and I am trying to learn what all the options r and the the difference between then all.

I use RPi zero W a lot because of size and only use the RPi3 when I am doing something that requires a lot of computing power like computer vision.

RPi zero W doesn't have the audio jack options anyway. I have just been using the easiest option of Bluetooth speakers as the speakers have everything on-board and the OS will take care of everything else and you can just plug and play. Although the RPi zero W is great for size I do often find that I am pushing it to it's limit (i am running full Jessy and maybe should be running the lite version). With my robots I can be playing music then having a robot dance (move lots of servos at once) while flashing RGB lights and putting images on a SPI screen. The Bluetooh can struggle to keep up sometimes and even though I dropped the sample rate on the MP3 music file at times the music can slow or become broken.

Looking at having a play with I2S as another option and I love hacking things and learning new stuff.

It would be nice to be able to drive it all off the RPi zero W and not need a separate power supply for the amp. All my robot struggle for space (in fact ther is never enough space to fit all my wish list ha ha )

alphanumeric
Posts: 2566
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: understanding sound and amps

Mon Sep 04, 2017 12:56 pm

I use I2C quit a lot. I have RTC breakout boards added to a couple of my builds. And sensor breakout boards added, etc. Finding the python code for some is an issue. I get a lot of the sensor boards from Adafuit and they seem to be more geared towards Arduino than Pi. I don't have the skills to port it over myself.

The Speaker pHat may be a good compromise for a robot. https://shop.pimoroni.com/products/speaker-phat If you don't need stereo or super hi fidelity sound. Speaker is included too. Mono so less power draw. I don't work for or have any affiliation with Pimoroni. I just happen to buy quit a bit of stuff from them. I have plans for a rover project, just need more parts. Not sure I'll have any sound other than maybe a buzzer for a horn. I have a Pi Zero with Explorer pHat but that's about as far as its gone so far. Other Pi projects on the go.

Last time I took an inventory I had two 3B's, two A+'s, and 3 Zero W's. All but two Zero W's are in use.
My project build pictures are here if your interested in having a look see. https://1drv.ms/f/s!AjOYwiwlwDtpgUMsp2qnevKpGEHb

alphanumeric
Posts: 2566
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: understanding sound and amps

Mon Sep 04, 2017 1:07 pm

The rumored 3A should be a nice compromise between the Zero W not having enough processing power for some projects. And the 3B being too big for some projects. Assuming it actually see's the light of day.;) I used A+'s with my headless sense hat setups, as I didn't need all the ports the 3B has, of all the processing power. I could have used Zero's but the A+ is easier to mount to the sense hat. The 4 mounting holes line right up. Don't need the WIFI either, they have a RTC added to keep accurate time.

chitester
Posts: 5
Joined: Wed Sep 12, 2018 8:45 am

Re: understanding sound and amps

Wed Sep 12, 2018 8:48 am

I found TFA9882 from NXP, https://www.mouser.com/datasheet/2/302/ ... 127930.pdf. Is a perfect replacement for MAX98357A? It is about 40% cheaper than MAX98357A.

Return to “General discussion”